diff --git a/acinclude.m4 b/acinclude.m4 index 99a5691ec8..38e6161a53 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1006,6 +1006,10 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) AC_CHECK_LINUX_FUNC([bdi_init], [#include ], [bdi_init(NULL);]) + AC_CHECK_LINUX_FUNC([super_setup_bdi], + [#include ], + [struct super_block *sb; + super_setup_bdi(sb);]) AC_CHECK_LINUX_FUNC([PageChecked], [#include #include ], diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index a0bcc85fa8..f87d137b32 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -113,7 +113,13 @@ afs_fill_super(struct super_block *sb, void *data, int silent) #if defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) sb->s_d_op = &afs_dentry_operations; #endif - +#if defined(HAVE_LINUX_SUPER_SETUP_BDI) + code = super_setup_bdi(sb); + if (code) + goto out; + sb->s_bdi->name = "openafs"; + sb->s_bdi->ra_pages = 32; +#else /* used for inodes backing_dev_info field, also */ afs_backing_dev_info = kzalloc(sizeof(struct backing_dev_info), GFP_NOFS); #if defined(HAVE_LINUX_BDI_INIT) @@ -131,6 +137,7 @@ afs_fill_super(struct super_block *sb, void *data, int silent) /* The name specified here will appear in the flushing thread name - flush-afs */ bdi_register(afs_backing_dev_info, NULL, "afs"); #endif +#endif /* HAVE_LINUX_SUPER_SETUP_BDI */ #if !defined(AFS_NONFSTRANS) sb->s_export_op = &afs_export_ops; #endif @@ -157,7 +164,9 @@ out: if (bdi_init_done) bdi_destroy(afs_backing_dev_info); #endif +#if !defined(HAVE_LINUX_SUPER_SETUP_BDI) kfree(afs_backing_dev_info); +#endif module_put(THIS_MODULE); }