/* Forward declarations */
static int afs_root(struct super_block *afsp);
-int afs_fill_super(struct super_block *sb, void *data, int silent);
+static int afs_fill_super(struct super_block *sb, void *data, int silent);
/*
#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) {
+ 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) {
+ const char *dev_name, void *data, struct vfsmount *mnt)
+{
return get_sb_nodev(fs_type, flags, data, afs_fill_super, mnt);
}
#else
static struct super_block *
afs_get_sb(struct file_system_type *fs_type, int flags,
- const char *dev_name, void *data) {
+ const char *dev_name, void *data)
+{
return get_sb_nodev(fs_type, flags, data, afs_fill_super);
}
#endif
struct backing_dev_info *afs_backing_dev_info;
-int
+static int
afs_fill_super(struct super_block *sb, void *data, int silent)
{
int code = 0;
__module_get(THIS_MODULE);
afs_globalVFS = sb;
+#if defined(SB_NOATIME)
+ sb->s_flags |= SB_NOATIME;
+#else
sb->s_flags |= MS_NOATIME;
+#endif
sb->s_blocksize = 1024;
sb->s_blocksize_bits = 10;
sb->s_magic = AFS_VFSMAGIC;
#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)
/* 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
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);
}
* statp is in user space, so we need to cobble together a statfs, then
* copy it.
*/
-int
+static int
#if defined(STATFS_TAKES_DENTRY)
afs_statfs(struct dentry *dentry, struct kstatfs *statp)
#else