diff --git a/acinclude.m4 b/acinclude.m4 index 4b1a9298f8..4903bbd493 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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]) diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index 8104dea943..22146d7502 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -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, };