diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index 6e67e12401..47247cab2d 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -80,9 +80,7 @@ struct file_system_type afs_fs_type = { .fs_flags = FS_BINARY_MOUNTDATA, }; -struct backing_dev_info afs_backing_dev_info = { - .ra_pages = 32, -}; +struct backing_dev_info *afs_backing_dev_info; int afs_fill_super(struct super_block *sb, void *data, int silent) @@ -107,13 +105,17 @@ afs_fill_super(struct super_block *sb, void *data, int silent) sb->s_blocksize_bits = 10; sb->s_magic = AFS_VFSMAGIC; sb->s_op = &afs_sops; /* Super block (vfs) ops */ + /* used for inodes backing_dev_info field, also */ + afs_backing_dev_info = osi_Alloc(sizeof(struct backing_dev_info)); #if defined(HAVE_BDI_INIT) - bdi_init(&afs_backing_dev_info); + bdi_init(afs_backing_dev_info); #endif + afs_backing_dev_info->name = "openafs"; + afs_backing_dev_info->ra_pages = 32; #if defined (STRUCT_SUPER_BLOCK_HAS_S_BDI) - sb->s_bdi = &afs_backing_dev_info; + sb->s_bdi = afs_backing_dev_info; /* The name specified here will appear in the flushing thread name - flush-afs */ - bdi_register(&afs_backing_dev_info, NULL, "afs"); + bdi_register(afs_backing_dev_info, NULL, "afs"); #endif #if !defined(AFS_NONFSTRANS) sb->s_export_op = &afs_export_ops; @@ -316,8 +318,9 @@ afs_put_super(struct super_block *sbp) osi_linux_verify_alloced_memory(); #if defined(HAVE_BDI_INIT) - bdi_destroy(&afs_backing_dev_info); + bdi_destroy(afs_backing_dev_info); #endif + osi_Free(afs_backing_dev_info, sizeof(struct backing_dev_info)); AFS_GUNLOCK(); sbp->s_dev = 0; diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index a72b752637..708b1ba135 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -49,7 +49,7 @@ #define MAX_ERRNO 1000L #endif -extern struct backing_dev_info afs_backing_dev_info; +extern struct backing_dev_info *afs_backing_dev_info; extern struct vcache *afs_globalVp; extern int afs_notify_change(struct dentry *dp, struct iattr *iattrp); @@ -2463,7 +2463,7 @@ afs_fill_inode(struct inode *ip, struct vattr *vattr) if (vattr) vattr2inode(ip, vattr); - ip->i_mapping->backing_dev_info = &afs_backing_dev_info; + ip->i_mapping->backing_dev_info = afs_backing_dev_info; /* Reset ops if symlink or directory. */ if (S_ISREG(ip->i_mode)) { ip->i_op = &afs_file_iops;