Linux: 2.6.37 - replace get_sb with mount

With kernel 2.6.37 the new entry point for mounting a filesystem
is the mount() operation instead of get_sb().

Replace afs_get_sb with afs_mount if the new operation is
available, and use mount_nodev instead of get_sb_nodev.

Note that this is not strictly required for 2.6.37 since the old
interfaces are still around, but we might as well switch now.

Reviewed-on: http://gerrit.openafs.org/3245
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 2ea841feac2de8ade987c18cb7043aacfebe0d83)
Change-Id: I1f17068a1a06654568f30b75c5c65da0100995cd
Reviewed-on: http://gerrit.openafs.org/3251
This commit is contained in:
Marc Dionne 2010-11-02 20:54:20 -04:00 committed by Derrick Brashear
parent fee1799019
commit 4209e98c2d
2 changed files with 18 additions and 1 deletions

View File

@ -770,6 +770,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
AC_CHECK_LINUX_STRUCT([inode], [i_security], [fs.h])
AC_CHECK_LINUX_STRUCT([file_operations], [flock], [fs.h])
AC_CHECK_LINUX_STRUCT([file_operations], [sendfile], [fs.h])
AC_CHECK_LINUX_STRUCT([file_system_type], [mount], [fs.h])
AC_CHECK_LINUX_STRUCT([nameidata], [path], [namei.h])
AC_CHECK_LINUX_STRUCT([proc_dir_entry], [owner], [proc_fs.h])
AC_CHECK_LINUX_STRUCT([super_block], [s_bdi], [fs.h])

View File

@ -45,7 +45,19 @@ static int afs_root(struct super_block *afsp);
int afs_fill_super(struct super_block *sb, void *data, int silent);
#ifdef GET_SB_HAS_STRUCT_VFSMOUNT
/*
* afs_mount (2.6.37+) and afs_get_sb (2.6.36-) are the entry
* points from the vfs when mounting afs. The super block
* structure is setup in the afs_fill_super callback function.
*/
#if defined(STRUCT_FILE_SYSTEM_TYPE_HAS_MOUNT)
static struct dentry *
afs_mount(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data) {
return mount_nodev(fs_type, flags, data, afs_fill_super);
}
#elif defined(GET_SB_HAS_STRUCT_VFSMOUNT)
static int
afs_get_sb(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data, struct vfsmount *mnt) {
@ -62,7 +74,11 @@ afs_get_sb(struct file_system_type *fs_type, int flags,
struct file_system_type afs_fs_type = {
.owner = THIS_MODULE,
.name = "afs",
#if defined(STRUCT_FILE_SYSTEM_TYPE_HAS_MOUNT)
.mount = afs_mount,
#else
.get_sb = afs_get_sb,
#endif
.kill_sb = kill_anon_super,
.fs_flags = FS_BINARY_MOUNTDATA,
};