VFS: Enable future NFS superblock sharing [try #2]
Subsystems (46)
David Howells
maintainercover VFS: Enable future NFS superblock sharing [try #2]
These two patches are a precursor to the NFS superblock sharing patches. The NFS superblock sharing patches group NFS files together into superblocks by {server, protocol, FSID}.
Ideally we'd represent each FSID tree retrieved from the server as a single tree in the client, rooted at the root of the FSID tree. However, things are much more messy than that for two reasons:
(1) We may jump directly into the middle of a tree (consider mountd), and we may not be able to access the common root of a tree on the server.
This means we may know about several subtrees of a particular filesystem on the server, but not be able to get the bits connecting them. Consider /home: the automounter might mount various users' home directories, but it may not actually be able to mount the directory in which they live.
(2) We can't simply assume that the hidden common bit of the paths forms a real tree. Symbolic links on the server may distort our perception of reality, and if the common part suddenly becomes visible, we may find that the dentry tree we've constructed is out of shape.
So what we want to do with NFS is have the ability to have separate trees within one superblock, and to splice the root of one as a branch on another when we find a connection.
The getsb patch permits the get_sb() op to return an arbitrary root for a superblock, allowing multiple trees to be set up within the superblock, or permitting a subtree to be returned (similar to mount --bind).
The statfs patch permits the statfs() op to find out which bit of the tree is being probed. In the NFS case, this is because the actual root dentry is a dummy that is never actually used (since we aren't necessarily sure of what the root actually is). For FUSE this might be because different dentries map to different data sources.
[try #2] is updated to 2.6.17-git2.
David
David Howells
maintainerPATCH 1/2 VFS: Permit filesystem to override root dentry on mount [try #2]
The attached patch extends the get_sb() filesystem operation to take an extra argument that permits the VFS to pass in the target vfsmount that defines the mountpoint.
The filesystem is then required to manually set the superblock and root dentry pointers. For most filesystems, this should be done with simple_set_mnt() which will set the superblock pointer and then set the root dentry to the superblock's s_root (as per the old default behaviour).
The get_sb() op now returns an integer as there's now no need to return the superblock pointer.
This patch permits a superblock to be implicitly shared amongst several mount points, such as can be done with NFS to avoid potential inode aliasing. In such a case, simple_set_mnt() would not be called, and instead the mnt_root and mnt_sb would be set directly.
The patch also makes the following changes:
(*) the get_sb_*() convenience functions in the core kernel now take a vfsmount
pointer argument and return an integer, so most filesystems have to change very little.
(*) If one of the convenience function is not used, then get_sb() should
normally call simple_set_mnt() to instantiate the vfsmount. This will always return 0, and so can be tail-called from get_sb().
(*) generic_shutdown_super() now calls shrink_dcache_sb() to clean up the
dcache upon superblock destruction rather than shrink_dcache_anon().
This is required because the superblock may now have multiple trees that aren't actually bound to s_root, but that still need to be cleaned up. The currently called functions assume that the whole tree is rooted at s_root, and that anonymous dentries are not the roots of trees which results in dentries being left unculled.
However, with the way NFS superblock sharing are currently set to be implemented, these assumptions are violated: the root of the filesystem is simply a dummy dentry and inode (the real inode for '/' may well be inaccessible), and all the vfsmounts are rooted on anonymous[*] dentries with child trees.
[*] Anonymous until discovered from another tree.
(*) The documentation has been adjusted, including the additional bit of
changing ext2_* into foo_* in the documentation.
---
Documentation/filesystems/Locking | 7 +- Documentation/filesystems/porting | 7 +- Documentation/filesystems/vfs.txt | 4 + arch/ia64/kernel/perfmon.c | 7 +- arch/powerpc/platforms/cell/spufs/inode.c | 6 +- drivers/infiniband/core/uverbs_main.c | 7 +- drivers/isdn/capi/capifs.c | 6 +- drivers/misc/ibmasm/ibmasmfs.c | 7 +- drivers/oprofile/oprofilefs.c | 6 +- drivers/usb/core/inode.c | 6 +- drivers/usb/gadget/inode.c | 6 +- fs/9p/vfs_super.c | 21 +++--- fs/adfs/super.c | 7 +- fs/affs/super.c | 7 +- fs/afs/super.c | 24 +++--- fs/autofs/init.c | 6 +- fs/autofs4/init.c | 6 +- fs/befs/linuxvfs.c | 7 +- fs/bfs/inode.c | 6 +- fs/binfmt_misc.c | 6 +- fs/block_dev.c | 6 +- fs/cifs/cifsfs.c | 10 +-- fs/coda/inode.c | 6 +- fs/configfs/mount.c | 6 +- fs/cramfs/inode.c | 7 +- fs/debugfs/inode.c | 8 +- fs/devfs/base.c | 8 +- fs/devpts/inode.c | 6 +- fs/efs/super.c | 6 +- fs/eventpoll.c | 13 ++- fs/ext2/super.c | 6 +- fs/ext3/super.c | 6 +- fs/freevxfs/vxfs_super.c | 7 +- fs/fuse/inode.c | 8 +- fs/hfs/super.c | 7 +- fs/hfsplus/super.c | 8 +- fs/hostfs/hostfs_kern.c | 8 +- fs/hpfs/super.c | 7 +- fs/hppfs/hppfs_kern.c | 8 +- fs/hugetlbfs/inode.c | 6 +- fs/inotify_user.c | 4 + fs/isofs/inode.c | 7 +- fs/jffs/inode-v23.c | 7 +- fs/jffs2/super.c | 49 +++++++------ fs/jfs/super.c | 7 +- fs/libfs.c | 12 ++- fs/minix/inode.c | 7 +- fs/msdos/namei.c | 9 +- fs/namespace.c | 9 ++ fs/ncpfs/inode.c | 6 +- fs/nfs/inode.c | 96 +++++++++++++++----------- fs/nfsd/nfsctl.c | 6 +- fs/ntfs/super.c | 7 +- fs/ocfs2/dlm/dlmfs.c | 6 +- fs/ocfs2/super.c | 12 ++- fs/openpromfs/inode.c | 6 +- fs/pipe.c | 9 +- fs/proc/root.c | 6 +- fs/qnx4/inode.c | 7 +- fs/ramfs/inode.c | 13 ++- fs/reiserfs/super.c | 9 +- fs/romfs/inode.c | 7 +- fs/smbfs/inode.c | 6 +- fs/super.c | 109 ++++++++++++++++------------- fs/sysfs/mount.c | 6 +- fs/sysv/super.c | 13 ++- fs/udf/super.c | 6 +- fs/ufs/super.c | 6 +- fs/vfat/namei.c | 9 +- fs/xfs/linux-2.6/xfs_super.c | 8 +- include/linux/fs.h | 25 ++++--- include/linux/ramfs.h | 4 + ipc/mqueue.c | 8 +- kernel/cpuset.c | 8 +- kernel/futex.c | 8 +- mm/shmem.c | 6 +- net/socket.c | 7 +- net/sunrpc/rpc_pipe.c | 6 +- security/inode.c | 8 +- security/selinux/selinuxfs.c | 7 +- 80 files changed, 474 insertions(+), 383 deletions(-)
Documentation/filesystems/Locking +4 -3
@@ -142,15 +142,16 @@ see also dquot_operations section. --------------------------- file_system_type --------------------------- prototypes: - struct super_block *(*get_sb) (struct file_system_type *, int, - const char *, void *); + struct int (*get_sb) (struct file_system_type *, int, + const char *, void *, struct vfsmount *); void (*kill_sb) (struct super_block *); locking rules: may block BKL get_sb yes yes kill_sb yes yes -->get_sb() returns error or a locked superblock (exclusive on ->s_umount). +->get_sb() returns error or 0 with locked superblock attached to the vfsmount +(exclusive on ->s_umount). ->kill_sb() takes a write-locked superblock, does all shutdown work on it, unlocks and drops the reference.
Documentation/filesystems/porting +4 -3
@@ -50,10 +50,11 @@ Turn your foo_read_super() into a functi success and negative number in case of error (-EINVAL unless you have more informative error value to report). Call it foo_fill_super(). Now declare -struct super_block foo_get_sb(struct file_system_type *fs_type, - int flags, const char *dev_name, void *data) +int foo_get_sb(struct file_system_type *fs_type, + int flags, const char *dev_name, void *data, struct vfsmount *mnt) { - return get_sb_bdev(fs_type, flags, dev_name, data, ext2_fill_super); + return get_sb_bdev(fs_type, flags, dev_name, data, foo_fill_super, + mnt); } (or similar with s/bdev/nodev/ or s/bdev/single/, depending on the kind of
Documentation/filesystems/vfs.txt +2 -2
@@ -113,8 +113,8 @@ members are defined: struct file_system_type { const char *name; int fs_flags; - struct super_block *(*get_sb) (struct file_system_type *, int, - const char *, void *); + struct int (*get_sb) (struct file_system_type *, int, + const char *, void *, struct vfsmount *); void (*kill_sb) (struct super_block *); struct module *owner; struct file_system_type * next;
arch/ia64/kernel/perfmon.c +4 -3
@@ -595,10 +595,11 @@ pfm_get_unmapped_area(struct file *file, } -static struct super_block * -pfmfs_get_sb (struct file_system_type *fs_type,int flags,const char *dev_name,void *data) +static int +pfmfs_get_sb (struct file_system_type *fs_type,int flags,const char *dev_name,void *data, +struct vfsmount *mnt) { -return get_sb_pseudo (fs_type,"pfm:" ,NULL ,PFMFS_MAGIC ); +return get_sb_pseudo (fs_type,"pfm:" ,NULL ,PFMFS_MAGIC , mnt); }static struct file_system_type pfm_fs_type = {
arch/powerpc/platforms/cell/spufs/inode.c +3 -3
@@ -428,11 +428,11 @@ spufs_fill_super(struct super_block *sb,return spufs_create_root (sb, data); } -static struct super_block * +static int spufs_get_sb (struct file_system_type *fstype,int flags, -const char *name,void *data) +const char *name,void *data,struct vfsmount *mnt) { -return get_sb_single (fstype, flags, data, spufs_fill_super); +return get_sb_single (fstype, flags, data, spufs_fill_super, mnt); }static struct file_system_type spufs_type = {
drivers/infiniband/core/uverbs_main.c +4 -3
@@ -821,11 +821,12 @@ static void ib_uverbs_remove_one(structkref_put (&uverbs_dev->ref, ib_uverbs_release_dev); } -static struct super_block *uverbs_event_get_sb (struct file_system_type *fs_type,int flags, -const char *dev_name,void *data) +static int uverbs_event_get_sb (struct file_system_type *fs_type,int flags, +const char *dev_name,void *data, +struct vfsmount *mnt) {return get_sb_pseudo (fs_type,"infinibandevent:" ,NULL , -INFINIBANDEVENTFS_MAGIC ); +INFINIBANDEVENTFS_MAGIC , mnt); }static struct file_system_type uverbs_event_fs = {
drivers/isdn/capi/capifs.c +3 -3
@@ -121,10 +121,10 @@ fail:return -ENOMEM ; } -static struct super_block *capifs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int capifs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_single (fs_type, flags, data, capifs_fill_super); +return get_sb_single (fs_type, flags, data, capifs_fill_super, mnt); }static struct file_system_type capifs_fs_type = {
drivers/misc/ibmasm/ibmasmfs.c +4 -3
@@ -90,10 +90,11 @@ static void ibmasmfs_create_files (strucstatic int ibmasmfs_fill_super (struct super_block *sb,void *data,int silent); -static struct super_block *ibmasmfs_get_super (struct file_system_type *fst, -int flags,const char *name,void *data) +static int ibmasmfs_get_super (struct file_system_type *fst, +int flags,const char *name,void *data, +struct vfsmount *mnt) { -return get_sb_single (fst, flags, data, ibmasmfs_fill_super); +return get_sb_single (fst, flags, data, ibmasmfs_fill_super, mnt); }static struct super_operations ibmasmfs_s_ops = {
drivers/oprofile/oprofilefs.c +3 -3
@@ -272,10 +272,10 @@ static int oprofilefs_fill_super(struct } -static struct super_block *oprofilefs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int oprofilefs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_single (fs_type, flags, data, oprofilefs_fill_super); +return get_sb_single (fs_type, flags, data, oprofilefs_fill_super, mnt); }
drivers/usb/core/inode.c +3 -3
@@ -543,10 +543,10 @@ static void fs_remove_file (struct dentr/* --------------------------------------------------------------------- */ -static struct super_block *usb_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int usb_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_single (fs_type, flags, data, usbfs_fill_super); +return get_sb_single (fs_type, flags, data, usbfs_fill_super, mnt); }static struct file_system_type usb_fs_type = {
drivers/usb/gadget/inode.c +3 -3
@@ -2064,11 +2064,11 @@ gadgetfs_fill_super (struct super_block }/* "mount -t gadgetfs path /dev/gadget" ends up here */ -static struct super_block * +static int gadgetfs_get_sb (struct file_system_type *t,int flags, -const char *path,void *opts) +const char *path,void *opts,struct vfsmount *mnt) { -return get_sb_single (t, flags, opts, gadgetfs_fill_super); +return get_sb_single (t, flags, opts, gadgetfs_fill_super, mnt); } static void
fs/9p/vfs_super.c +12 -9
@@ -99,12 +99,13 @@ v9fs_fill_super(struct super_block *sb,* @flags: mount flags * @dev_name: device name that was mounted * @data: mount options +* @mnt: mountpoint record to be instantiated * */ -static struct super_block *v9fs_get_sb (struct file_system_type - *fs_type,int flags, -const char *dev_name,void *data) +static int v9fs_get_sb (struct file_system_type *fs_type,int flags, +const char *dev_name,void *data, +struct vfsmount *mnt) {struct super_block *sb =NULL ;struct v9fs_fcall *fcall =NULL ;
@@ -123,17 +124,19 @@ static struct super_block *v9fs_get_sb(s v9ses =kzalloc (sizeof (struct v9fs_session_info ),GFP_KERNEL );if (!v9ses) -return ERR_PTR (-ENOMEM ); +return -ENOMEM ;if ((newfid =v9fs_session_init (v9ses, dev_name, data)) <0 ) {dprintk (DEBUG_ERROR ,"problem initiating session\n" ); - sb =ERR_PTR (newfid); + retval = newfid; goto out_free_session; } sb =sget (fs_type,NULL , v9fs_set_super, v9ses); -if (IS_ERR (sb)) +if (IS_ERR (sb)) { + retval =PTR_ERR (sb); goto out_close_session; + }v9fs_fill_super (sb, v9ses, flags); inode =v9fs_get_inode (sb,S_IFDIR | mode);
@@ -184,19 +187,19 @@ static struct super_block *v9fs_get_sb(s goto put_back_sb; } -return sb; +return simple_set_mnt (mnt, sb); out_close_session:v9fs_session_close (v9ses); out_free_session:kfree (v9ses); -return sb; +return retval; put_back_sb:/* deactivate_super calls v9fs_kill_super which will frees the rest */ up_write (&sb->s_umount);deactivate_super (sb); -return ERR_PTR (retval); +return retval; }/**
fs/adfs/super.c +4 -3
@@ -470,10 +470,11 @@ error:return -EINVAL ; } -static struct super_block *adfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int adfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, adfs_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, adfs_fill_super, + mnt); }static struct file_system_type adfs_fs_type = {
fs/affs/super.c +4 -3
@@ -524,10 +524,11 @@ affs_statfs(struct super_block *sb, strureturn 0 ; } -static struct super_block *affs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int affs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, affs_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, affs_fill_super, + mnt); }static struct file_system_type affs_fs_type = {
fs/afs/super.c +13 -11
@@ -38,9 +38,9 @@ struct afs_mount_params {static void afs_i_init_once (void *foo,kmem_cache_t *cachep,unsigned long flags); -static struct super_block *afs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name, -void *data); +static int afs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name, +void *data,struct vfsmount *mnt);static struct inode *afs_alloc_inode (struct super_block *sb);
@@ -294,10 +294,11 @@ static int afs_fill_super(struct super_b* get an AFS superblock * - TODO: don't use get_sb_nodev(), but rather call sget() directly */ -static struct super_block *afs_get_sb (struct file_system_type *fs_type, -int flags, -const char *dev_name, -void *options) +static int afs_get_sb (struct file_system_type *fs_type, +int flags, +const char *dev_name, +void *options, +struct vfsmount *mnt) {struct afs_mount_params params;struct super_block *sb;
@@ -311,7 +312,7 @@ static struct super_block *afs_get_sb(st ret =afscm_start ();if (ret <0 ) {_leave (" = %d" , ret); -return ERR_PTR (ret); +return ret; }/* parse the options */
@@ -348,18 +349,19 @@ static struct super_block *afs_get_sb(st goto error; } sb->s_flags |=MS_ACTIVE ; +simple_set_mnt (mnt, sb);afs_put_volume (params.volume);afs_put_cell (params.default_cell); -_leave (" = %p" , sb); -return sb; +_leave (" = 0 [%p]" ,0 , sb); +return 0 ; error:afs_put_volume (params.volume);afs_put_cell (params.default_cell);afscm_stop ();_leave (" = %d" , ret); -return ERR_PTR (ret); +return ret; }/* end afs_get_sb() */ /*****************************************************************************/
fs/autofs/init.c +3 -3
@@ -14,10 +14,10 @@ #include <linux/module.h>#include <linux/init.h> #include "autofs_i.h" -static struct super_block *autofs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int autofs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_nodev (fs_type, flags, data, autofs_fill_super); +return get_sb_nodev (fs_type, flags, data, autofs_fill_super, mnt); }static struct file_system_type autofs_fs_type = {
fs/autofs4/init.c +3 -3
@@ -14,10 +14,10 @@ #include <linux/module.h>#include <linux/init.h> #include "autofs_i.h" -static struct super_block *autofs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int autofs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_nodev (fs_type, flags, data, autofs4_fill_super); +return get_sb_nodev (fs_type, flags, data, autofs4_fill_super, mnt); }static struct file_system_type autofs_fs_type = {
fs/befs/linuxvfs.c +4 -3
@@ -899,11 +899,12 @@ befs_statfs(struct super_block *sb, strureturn 0 ; } -static struct super_block * +static int befs_get_sb (struct file_system_type *fs_type,int flags,const char *dev_name, -void *data) +void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, befs_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, befs_fill_super, + mnt); }static struct file_system_type befs_fs_type = {
fs/bfs/inode.c +3 -3
@@ -410,10 +410,10 @@ out:return -EINVAL ; } -static struct super_block *bfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int bfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, bfs_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, bfs_fill_super, mnt); }static struct file_system_type bfs_fs_type = {
fs/binfmt_misc.c +3 -3
@@ -740,10 +740,10 @@ static int bm_fill_super(struct super_blreturn err; } -static struct super_block *bm_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int bm_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_single (fs_type, flags, data, bm_fill_super); +return get_sb_single (fs_type, flags, data, bm_fill_super, mnt); }static struct linux_binfmt misc_format = {
fs/block_dev.c +3 -3
@@ -300,10 +300,10 @@ static struct super_operations bdev_sops .clear_inode = bdev_clear_inode, }; -static struct super_block *bd_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int bd_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_pseudo (fs_type,"bdev:" , &bdev_sops,0x62646576 ); +return get_sb_pseudo (fs_type,"bdev:" , &bdev_sops,0x62646576 , mnt); }static struct file_system_type bd_type = {
fs/cifs/cifsfs.c +5 -5
@@ -460,9 +460,9 @@ #endif .remount_fs = cifs_remount, }; -static struct super_block * +static int cifs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +int flags,const char *dev_name,void *data,struct vfsmount *mnt) {int rc;struct super_block *sb =sget (fs_type,NULL , set_anon_super,NULL );
@@ -470,7 +470,7 @@ cifs_get_sb(struct file_system_type *fs_cFYI (1 , ("Devname: %s flags: %d " , dev_name, flags));if (IS_ERR (sb)) -return sb; +return PTR_ERR (sb); sb->s_flags = flags;
@@ -478,10 +478,10 @@ cifs_get_sb(struct file_system_type *fs_if (rc) {up_write (&sb->s_umount);deactivate_super (sb); -return ERR_PTR (rc); +return rc; } sb->s_flags |=MS_ACTIVE ; -return sb; +return simple_set_mnt (mnt, sb); } static ssize_t cifs_file_writev(struct file *file, const struct iovec *iov,
fs/coda/inode.c +3 -3
@@ -307,10 +307,10 @@ static int coda_statfs(struct super_bloc/* init_coda: used by filesystems.c to register coda */ -static struct super_block *coda_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int coda_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_nodev (fs_type, flags, data, coda_fill_super); +return get_sb_nodev (fs_type, flags, data, coda_fill_super, mnt); }struct file_system_type coda_fs_type = {
fs/configfs/mount.c +3 -3
@@ -103,10 +103,10 @@ static int configfs_fill_super(struct sureturn 0 ; } -static struct super_block *configfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int configfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_single (fs_type, flags, data, configfs_fill_super); +return get_sb_single (fs_type, flags, data, configfs_fill_super, mnt); }static struct file_system_type configfs_fs_type = {
fs/cramfs/inode.c +4 -3
@@ -528,10 +528,11 @@ static struct super_operations cramfs_op .statfs = cramfs_statfs, }; -static struct super_block *cramfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int cramfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, cramfs_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, cramfs_fill_super, + mnt); }static struct file_system_type cramfs_fs_type = {
fs/debugfs/inode.c +4 -4
@@ -111,11 +111,11 @@ static int debug_fill_super(struct superreturn simple_fill_super (sb,DEBUGFS_MAGIC , debug_files); } -static struct super_block *debug_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name, -void *data) +static int debug_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name, +void *data,struct vfsmount *mnt) { -return get_sb_single (fs_type, flags, data, debug_fill_super); +return get_sb_single (fs_type, flags, data, debug_fill_super, mnt); }static struct file_system_type debug_fs_type = {
fs/devfs/base.c +4 -4
@@ -2549,11 +2549,11 @@ static int devfs_fill_super(struct superreturn -EINVAL ; }/* End Function devfs_fill_super */ -static struct super_block *devfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name, -void *data) +static int devfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name, +void *data,struct vfsmount *mnt) { -return get_sb_single (fs_type, flags, data, devfs_fill_super); +return get_sb_single (fs_type, flags, data, devfs_fill_super, mnt); }static struct file_system_type devfs_fs_type = {
fs/devpts/inode.c +3 -3
@@ -130,10 +130,10 @@ fail:return -ENOMEM ; } -static struct super_block *devpts_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int devpts_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_single (fs_type, flags, data, devpts_fill_super); +return get_sb_single (fs_type, flags, data, devpts_fill_super, mnt); }static struct file_system_type devpts_fs_type = {
fs/efs/super.c +3 -3
@@ -18,10 +18,10 @@ #include <linux/vfs.h>static int efs_statfs (struct super_block *s,struct kstatfs *buf);static int efs_fill_super (struct super_block *s,void *d,int silent); -static struct super_block *efs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int efs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, efs_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, efs_fill_super, mnt); }static struct file_system_type efs_fs_type = {
fs/eventpoll.c +7 -6
@@ -268,9 +268,9 @@ static int ep_poll(struct eventpoll *ep, int maxevents, long timeout);static int eventpollfs_delete_dentry (struct dentry *dentry);static struct inode *ep_eventpoll_inode (void ); -static struct super_block *eventpollfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name, -void *data); +static int eventpollfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name, +void *data,struct vfsmount *mnt);/* * This semaphore is used to serialize ep_free() and eventpoll_release_file().
@@ -1595,11 +1595,12 @@ eexit_1: } -static struct super_block * +static int eventpollfs_get_sb (struct file_system_type *fs_type,int flags, -const char *dev_name,void *data) +const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_pseudo (fs_type,"eventpoll:" ,NULL ,EVENTPOLLFS_MAGIC ); +return get_sb_pseudo (fs_type,"eventpoll:" ,NULL ,EVENTPOLLFS_MAGIC , + mnt); }
fs/ext2/super.c +3 -3
@@ -1087,10 +1087,10 @@ static int ext2_statfs (struct super_bloreturn 0 ; } -static struct super_block *ext2_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int ext2_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, ext2_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, ext2_fill_super, mnt); }#ifdef CONFIG_QUOTA
fs/ext3/super.c +3 -3
@@ -2646,10 +2646,10 @@ out:#endif -static struct super_block *ext3_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int ext3_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, ext3_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, ext3_fill_super, mnt); }static struct file_system_type ext3_fs_type = {
fs/freevxfs/vxfs_super.c +4 -3
@@ -241,10 +241,11 @@ out:/* * The usual module blurb. */ -static struct super_block *vxfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int vxfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, vxfs_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, vxfs_fill_super, + mnt); }static struct file_system_type vxfs_fs_type = {
fs/fuse/inode.c +4 -4
@@ -569,11 +569,11 @@ static int fuse_fill_super(struct super_return err; } -static struct super_block *fuse_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name, -void *raw_data) +static int fuse_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name, +void *raw_data,struct vfsmount *mnt) { -return get_sb_nodev (fs_type, flags, raw_data, fuse_fill_super); +return get_sb_nodev (fs_type, flags, raw_data, fuse_fill_super, mnt); }static struct file_system_type fuse_fs_type = {
fs/hfs/super.c +4 -3
@@ -413,10 +413,11 @@ bail:return res; } -static struct super_block *hfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int hfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data, +struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, hfs_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, hfs_fill_super, mnt); }static struct file_system_type hfs_fs_type = {
fs/hfsplus/super.c +5 -3
@@ -450,10 +450,12 @@ static void hfsplus_destroy_inode(struct#define HFSPLUS_INODE_SIZE sizeof(struct hfsplus_inode_info) -static struct super_block *hfsplus_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int hfsplus_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data, +struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, hfsplus_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, hfsplus_fill_super, + mnt); }static struct file_system_type hfsplus_fs_type = {
fs/hostfs/hostfs_kern.c +4 -4
@@ -993,11 +993,11 @@ static int hostfs_fill_sb_common(structreturn (err); } -static struct super_block *hostfs_read_sb (struct file_system_type *type, -int flags,const char *dev_name, -void *data) +static int hostfs_read_sb (struct file_system_type *type, +int flags,const char *dev_name, +void *data,struct vfsmount *mnt) { -return (get_sb_nodev (type, flags, data, hostfs_fill_sb_common)); +return get_sb_nodev (type, flags, data, hostfs_fill_sb_common, mnt); }static struct file_system_type hostfs_type = {
fs/hpfs/super.c +4 -3
@@ -662,10 +662,11 @@ bail0:return -EINVAL ; } -static struct super_block *hpfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int hpfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, hpfs_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, hpfs_fill_super, + mnt); }static struct file_system_type hpfs_fs_type = {
fs/hppfs/hppfs_kern.c +4 -4
@@ -769,11 +769,11 @@ static int hppfs_fill_super(struct superreturn (err); } -static struct super_block *hppfs_read_super (struct file_system_type *type, -int flags,const char *dev_name, -void *data) +static int hppfs_read_super (struct file_system_type *type, +int flags,const char *dev_name, +void *data,struct vfsmount *mnt) { -return (get_sb_nodev (type, flags, data, hppfs_fill_super)); +return get_sb_nodev (type, flags, data, hppfs_fill_super, mnt); }static struct file_system_type hppfs_type = {
fs/hugetlbfs/inode.c +3 -3
@@ -723,10 +723,10 @@ void hugetlb_put_quota(struct address_sp } } -static struct super_block *hugetlbfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int hugetlbfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_nodev (fs_type, flags, data, hugetlbfs_fill_super); +return get_sb_nodev (fs_type, flags, data, hugetlbfs_fill_super, mnt); }static struct file_system_type hugetlbfs_fs_type = {
fs/inotify_user.c +2 -2
@@ -674,9 +674,9 @@ out:static struct super_block *inotify_get_sb (struct file_system_type *fs_type,int flags, -const char *dev_name,void *data) +const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_pseudo (fs_type,"inotify" ,NULL ,0xBAD1DEA ); +return get_sb_pseudo (fs_type,"inotify" ,NULL ,0xBAD1DEA , mnt); }static struct file_system_type inotify_fs_type = {
fs/isofs/inode.c +4 -3
@@ -1399,10 +1399,11 @@ struct inode *isofs_iget(struct super_blreturn inode; } -static struct super_block *isofs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int isofs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, isofs_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, isofs_fill_super, + mnt); }static struct file_system_type iso9660_fs_type = {
fs/jffs/inode-v23.c +4 -3
@@ -1785,10 +1785,11 @@ static struct super_operations jffs_ops .remount_fs = jffs_remount, }; -static struct super_block *jffs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int jffs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, jffs_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, jffs_fill_super, + mnt); }static struct file_system_type jffs_fs_type = {
fs/jffs2/super.c +27 -22
131 lines not on this page · raw message
fs/jfs/super.c +4 -3
@@ -565,10 +565,11 @@ static void jfs_unlockfs(struct super_bl } } -static struct super_block *jfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int jfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, jfs_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, jfs_fill_super, + mnt); }static int jfs_sync_fs (struct super_block *sb,int wait)
fs/libfs.c +6 -6
@@ -196,9 +196,9 @@ struct inode_operations simple_dir_inode* Common helper for pseudo-filesystems (sockfs, pipefs, bdev - stuff that * will never be mountable) */ -struct super_block * -get_sb_pseudo (struct file_system_type *fs_type,char *name, -struct super_operations *ops,unsigned long magic) +int get_sb_pseudo (struct file_system_type *fs_type,char *name, +struct super_operations *ops,unsigned long magic, +struct vfsmount *mnt) {struct super_block *s =sget (fs_type,NULL , set_anon_super,NULL );static struct super_operations default_ops = {.statfs = simple_statfs};
@@ -207,7 +207,7 @@ get_sb_pseudo(struct file_system_type *fstruct qstr d_name = {.name = name, .len =strlen (name)};if (IS_ERR (s)) -return s; +return PTR_ERR (s); s->s_flags =MS_NOUSER ; s->s_maxbytes = ~0ULL ;
@@ -232,12 +232,12 @@ get_sb_pseudo(struct file_system_type *fd_instantiate (dentry, root); s->s_root = dentry; s->s_flags |=MS_ACTIVE ; -return s; +return simple_set_mnt (mnt, s); Enomem:up_write (&s->s_umount);deactivate_super (s); -return ERR_PTR (-ENOMEM ); +return -ENOMEM ; }int simple_link (struct dentry *old_dentry,struct inode *dir,struct dentry *dentry)
fs/minix/inode.c +4 -3
@@ -559,10 +559,11 @@ void minix_truncate(struct inode * inodeV2_minix_truncate (inode); } -static struct super_block *minix_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int minix_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, minix_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, minix_fill_super, + mnt); }static struct file_system_type minix_fs_type = {
fs/msdos/namei.c +5 -4
@@ -661,11 +661,12 @@ static int msdos_fill_super(struct superreturn 0 ; } -static struct super_block *msdos_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name, -void *data) +static int msdos_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name, +void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, msdos_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, msdos_fill_super, + mnt); }static struct file_system_type msdos_fs_type = {
fs/namespace.c +9 -0
@@ -86,6 +86,15 @@ struct vfsmount *alloc_vfsmnt(const charreturn mnt; } +int simple_set_mnt (struct vfsmount *mnt,struct super_block *sb) +{ + mnt->mnt_sb = sb; + mnt->mnt_root =dget (sb->s_root); +return 0 ; +} + +EXPORT_SYMBOL (simple_set_mnt); +void free_vfsmnt (struct vfsmount *mnt) {kfree (mnt->mnt_devname);
fs/ncpfs/inode.c +3 -3
@@ -957,10 +957,10 @@ out:return result; } -static struct super_block *ncp_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int ncp_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_nodev (fs_type, flags, data, ncp_fill_super); +return get_sb_nodev (fs_type, flags, data, ncp_fill_super, mnt); }static struct file_system_type ncp_fs_type = {
fs/nfs/inode.c +58 -38
222 lines not on this page · raw message
fs/nfsd/nfsctl.c +3 -3
@@ -494,10 +494,10 @@ #endifreturn simple_fill_super (sb,0x6e667364 , nfsd_files); } -static struct super_block *nfsd_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int nfsd_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_single (fs_type, flags, data, nfsd_fill_super); +return get_sb_single (fs_type, flags, data, nfsd_fill_super, mnt); }static struct file_system_type nfsd_fs_type = {
fs/ntfs/super.c +4 -3
@@ -3093,10 +3093,11 @@ struct kmem_cache *ntfs_index_ctx_cache;/* Driver wide mutex. */ DEFINE_MUTEX (ntfs_lock); -static struct super_block *ntfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int ntfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, ntfs_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, ntfs_fill_super, + mnt); }static struct file_system_type ntfs_fs_type = {
fs/ocfs2/dlm/dlmfs.c +3 -3
@@ -574,10 +574,10 @@ static struct inode_operations dlmfs_fil .getattr = simple_getattr, }; -static struct super_block *dlmfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int dlmfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_nodev (fs_type, flags, data, dlmfs_fill_super); +return get_sb_nodev (fs_type, flags, data, dlmfs_fill_super, mnt); }static struct file_system_type dlmfs_fs_type = {
fs/ocfs2/super.c +7 -5
@@ -672,12 +672,14 @@ read_super_error:return status; } -static struct super_block *ocfs2_get_sb (struct file_system_type *fs_type, -int flags, -const char *dev_name, -void *data) +static int ocfs2_get_sb (struct file_system_type *fs_type, +int flags, +const char *dev_name, +void *data, +struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, ocfs2_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, ocfs2_fill_super, + mnt); }static struct file_system_type ocfs2_fs_type = {
fs/openpromfs/inode.c +3 -3
@@ -1054,10 +1054,10 @@ out_no_root:return -ENOMEM ; } -static struct super_block *openprom_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int openprom_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_single (fs_type, flags, data, openprom_fill_super); +return get_sb_single (fs_type, flags, data, openprom_fill_super, mnt); }static struct file_system_type openprom_fs_type = {
fs/pipe.c +4 -5
@@ -979,12 +979,11 @@ no_files:* any operations on the root directory. However, we need a non-trivial * d_name - pipe: will go nicely and kill the special-casing in procfs. */ - -static struct super_block * -pipefs_get_sb (struct file_system_type *fs_type,int flags, -const char *dev_name,void *data) +static int pipefs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data, +struct vfsmount *mnt) { -return get_sb_pseudo (fs_type,"pipe:" ,NULL ,PIPEFS_MAGIC ); +return get_sb_pseudo (fs_type,"pipe:" ,NULL ,PIPEFS_MAGIC , mnt); }static struct file_system_type pipe_fs_type = {
fs/proc/root.c +3 -3
@@ -26,10 +26,10 @@ #ifdef CONFIG_SYSCTLstruct proc_dir_entry *proc_sys_root;#endif -static struct super_block *proc_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int proc_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_single (fs_type, flags, data, proc_fill_super); +return get_sb_single (fs_type, flags, data, proc_fill_super, mnt); }static struct file_system_type proc_fs_type = {
fs/qnx4/inode.c +4 -3
@@ -561,10 +561,11 @@ static void destroy_inodecache(void) "qnx4_inode_cache: not all structures were freed\n"); } -static struct super_block *qnx4_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int qnx4_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, qnx4_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, qnx4_fill_super, + mnt); }static struct file_system_type qnx4_fs_type = {
fs/ramfs/inode.c +7 -6
@@ -185,16 +185,17 @@ static int ramfs_fill_super(struct superreturn 0 ; } -struct super_block *ramfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +int ramfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_nodev (fs_type, flags, data, ramfs_fill_super); +return get_sb_nodev (fs_type, flags, data, ramfs_fill_super, mnt); } -static struct super_block *rootfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int rootfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_nodev (fs_type, flags|MS_NOUSER , data, ramfs_fill_super); +return get_sb_nodev (fs_type, flags|MS_NOUSER , data, ramfs_fill_super, + mnt); }static struct file_system_type ramfs_fs_type = {
fs/reiserfs/super.c +5 -4
@@ -2249,11 +2249,12 @@ static ssize_t reiserfs_quota_write(stru#endif -static struct super_block *get_super_block (struct file_system_type *fs_type, -int flags,const char *dev_name, -void *data) +static int get_super_block (struct file_system_type *fs_type, +int flags,const char *dev_name, +void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, reiserfs_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, reiserfs_fill_super, + mnt); }static int __init init_reiserfs_fs (void )
fs/romfs/inode.c +4 -3
@@ -607,10 +607,11 @@ static struct super_operations romfs_ops .remount_fs = romfs_remount, }; -static struct super_block *romfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int romfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, romfs_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, romfs_fill_super, + mnt); }static struct file_system_type romfs_fs_type = {
fs/smbfs/inode.c +3 -3
@@ -782,10 +782,10 @@ out:return error; } -static struct super_block *smb_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int smb_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_nodev (fs_type, flags, data, smb_fill_super); +return get_sb_nodev (fs_type, flags, data, smb_fill_super, mnt); }static struct file_system_type smb_fs_type = {
fs/super.c +62 -47
237 lines not on this page · raw message
fs/sysfs/mount.c +3 -3
@@ -66,10 +66,10 @@ static int sysfs_fill_super(struct superreturn 0 ; } -static struct super_block *sysfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int sysfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_single (fs_type, flags, data, sysfs_fill_super); +return get_sb_single (fs_type, flags, data, sysfs_fill_super, mnt); }static struct file_system_type sysfs_fs_type = {
fs/sysv/super.c +7 -6
@@ -506,16 +506,17 @@ failed:/* Every kernel module contains stuff like this. */ -static struct super_block *sysv_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int sysv_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, sysv_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, sysv_fill_super, + mnt); } -static struct super_block *v7_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int v7_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, v7_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, v7_fill_super, mnt); }static struct file_system_type sysv_fs_type = {
fs/udf/super.c +3 -3
@@ -94,10 +94,10 @@ static unsigned int udf_count_free(strucstatic int udf_statfs (struct super_block *,struct kstatfs *);/* UDF filesystem type */ -static struct super_block *udf_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int udf_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, udf_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, udf_fill_super, mnt); }static struct file_system_type udf_fstype = {
fs/ufs/super.c +3 -3
@@ -1311,10 +1311,10 @@ out:#endif -static struct super_block *ufs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int ufs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, ufs_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, ufs_fill_super, mnt); }static struct file_system_type ufs_fs_type = {
fs/vfat/namei.c +5 -4
@@ -1023,11 +1023,12 @@ static int vfat_fill_super(struct super_return 0 ; } -static struct super_block *vfat_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name, -void *data) +static int vfat_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name, +void *data,struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, vfat_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, vfat_fill_super, + mnt); }static struct file_system_type vfat_fs_type = {
fs/xfs/linux-2.6/xfs_super.c +5 -3
@@ -900,14 +900,16 @@ fail_vfsop:return -error; } -STATIC struct super_block * +STATIC intxfs_fs_get_sb (struct file_system_type *fs_type,int flags,const char *dev_name, -void *data) +void *data, +struct vfsmount *mnt) { -return get_sb_bdev (fs_type, flags, dev_name, data, xfs_fs_fill_super); +return get_sb_bdev (fs_type, flags, dev_name, data, xfs_fs_fill_super, + mnt); } STATIC struct super_operations xfs_super_operations = {
include/linux/fs.h +15 -10
@@ -1270,23 +1270,26 @@ find_exported_dentry(struct super_blockstruct file_system_type {const char *name;int fs_flags; -struct super_block *(*get_sb) (struct file_system_type *,int , -const char *,void *); +int (*get_sb) (struct file_system_type *,int , +const char *,void *,struct vfsmount *);void (*kill_sb) (struct super_block *);struct module *owner;struct file_system_type * next;struct list_head fs_supers; }; -struct super_block *get_sb_bdev (struct file_system_type *fs_type, +extern int get_sb_bdev (struct file_system_type *fs_type,int flags,const char *dev_name,void *data, -int (*fill_super)(struct super_block *,void *,int )); -struct super_block *get_sb_single (struct file_system_type *fs_type, +int (*fill_super)(struct super_block *,void *,int ), +struct vfsmount *mnt); +extern int get_sb_single (struct file_system_type *fs_type,int flags,void *data, -int (*fill_super)(struct super_block *,void *,int )); -struct super_block *get_sb_nodev (struct file_system_type *fs_type, +int (*fill_super)(struct super_block *,void *,int ), +struct vfsmount *mnt); +extern int get_sb_nodev (struct file_system_type *fs_type,int flags,void *data, -int (*fill_super)(struct super_block *,void *,int )); +int (*fill_super)(struct super_block *,void *,int ), +struct vfsmount *mnt);void generic_shutdown_super (struct super_block *sb);void kill_block_super (struct super_block *sb);void kill_anon_super (struct super_block *sb);
@@ -1297,8 +1300,10 @@ struct super_block *sget(struct file_sysint (*test)(struct super_block *,void *), int (*set)(struct super_block *,void *), void *data); -struct super_block *get_sb_pseudo (struct file_system_type *,char *, -struct super_operations *ops,unsigned long ); +extern int get_sb_pseudo (struct file_system_type *,char *, +struct super_operations *ops,unsigned long , +struct vfsmount *mnt); +extern int simple_set_mnt (struct vfsmount *mnt,struct super_block *sb);int __put_super (struct super_block *sb);int __put_super_and_need_restart (struct super_block *sb);void unnamed_dev_init (void );
include/linux/ramfs.h +2 -2
@@ -2,8 +2,8 @@ #ifndef _LINUX_RAMFS_H#define _LINUX_RAMFS_Hstruct inode *ramfs_get_inode (struct super_block *sb,int mode,dev_t dev); -struct super_block *ramfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data); +extern int ramfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt);#ifndef CONFIG_MMU extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
ipc/mqueue.c +4 -4
@@ -205,11 +205,11 @@ static int mqueue_fill_super(struct supereturn 0 ; } -static struct super_block *mqueue_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name, -void *data) +static int mqueue_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name, +void *data,struct vfsmount *mnt) { -return get_sb_single (fs_type, flags, data, mqueue_fill_super); +return get_sb_single (fs_type, flags, data, mqueue_fill_super, mnt); }static void init_once (void *foo,kmem_cache_t * cachep,unsigned long flags)
kernel/cpuset.c +4 -4
@@ -392,11 +392,11 @@ static int cpuset_fill_super(struct supereturn 0 ; } -static struct super_block *cpuset_get_sb (struct file_system_type *fs_type, -int flags,const char *unused_dev_name, -void *data) +static int cpuset_get_sb (struct file_system_type *fs_type, +int flags,const char *unused_dev_name, +void *data,struct vfsmount *mnt) { -return get_sb_single (fs_type, flags, data, cpuset_fill_super); +return get_sb_single (fs_type, flags, data, cpuset_fill_super, mnt); }static struct file_system_type cpuset_fs_type = {
kernel/futex.c +4 -4
@@ -1056,11 +1056,11 @@ asmlinkage long sys_futex(u32 __user *ua (unsigned long)uaddr2, val2, val3); } -static struct super_block * -futexfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int futexfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data, +struct vfsmount *mnt) { -return get_sb_pseudo (fs_type,"futex" ,NULL ,0xBAD1DEA ); +return get_sb_pseudo (fs_type,"futex" ,NULL ,0xBAD1DEA , mnt); }static struct file_system_type futex_fs_type = {
mm/shmem.c +3 -3
@@ -2233,10 +2233,10 @@ #endif }; -static struct super_block *shmem_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int shmem_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_nodev (fs_type, flags, data, shmem_fill_super); +return get_sb_nodev (fs_type, flags, data, shmem_fill_super, mnt); }static struct file_system_type tmpfs_fs_type = {
net/socket.c +4 -3
@@ -335,10 +335,11 @@ static struct super_operations sockfs_op .statfs = simple_statfs, }; -static struct super_block *sockfs_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int sockfs_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_pseudo (fs_type,"socket:" , &sockfs_ops,SOCKFS_MAGIC ); +return get_sb_pseudo (fs_type,"socket:" , &sockfs_ops,SOCKFS_MAGIC , + mnt); }static struct vfsmount *sock_mnt__read_mostly ;
net/sunrpc/rpc_pipe.c +3 -3
@@ -815,11 +815,11 @@ out:return -ENOMEM ; } -static struct super_block * +static int rpc_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +int flags,const char *dev_name,void *data,struct vfsmount *mnt) { -return get_sb_single (fs_type, flags, data, rpc_fill_super); +return get_sb_single (fs_type, flags, data, rpc_fill_super, mnt); }static struct file_system_type rpc_pipe_fs_type = {
security/inode.c +4 -4
@@ -135,11 +135,11 @@ static int fill_super(struct super_blockreturn simple_fill_super (sb,SECURITYFS_MAGIC , files); } -static struct super_block *get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name, -void *data) +static int get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name, +void *data,struct vfsmount *mnt) { -return get_sb_single (fs_type, flags, data, fill_super); +return get_sb_single (fs_type, flags, data, fill_super, mnt); }static struct file_system_type fs_type = {
security/selinux/selinuxfs.c +4 -3
@@ -1345,10 +1345,11 @@ err: goto out; } -static struct super_block *sel_get_sb (struct file_system_type *fs_type, -int flags,const char *dev_name,void *data) +static int sel_get_sb (struct file_system_type *fs_type, +int flags,const char *dev_name,void *data, +struct vfsmount *mnt) { -return get_sb_single (fs_type, flags, data, sel_fill_super); +return get_sb_single (fs_type, flags, data, sel_fill_super, mnt); }static struct file_system_type sel_fs_type = {
David Howells
maintainerPATCH 2/2 VFS: Permit filesystem to perform statfs with a known root dentry [try #2]
In reply to David HowellsThe attached patch gives the statfs superblock operation a dentry pointer rather than a superblock pointer.
This complements the get_sb() patch. That reduced the significance of sb->s_root, allowing NFS to place a fake root there. However, NFS does require a dentry to use as a target for the statfs operation. This permits the root in the vfsmount to be used instead.
linux/mount.h has been added where necessary to make allyesconfig build successfully.
Interest has also been expressed for use with the FUSE and XFS filesystems.
---
Documentation/filesystems/Locking | 2 +- Documentation/filesystems/vfs.txt | 2 +- arch/alpha/kernel/osf_sys.c | 2 +- arch/mips/kernel/sysirix.c | 12 ++++++------ arch/parisc/hpux/sys_hpux.c | 10 +++++----- arch/sparc64/solaris/fs.c | 4 ++-- fs/adfs/super.c | 8 ++++---- fs/affs/super.c | 5 +++-- fs/befs/linuxvfs.c | 5 +++-- fs/bfs/inode.c | 3 ++- fs/cifs/cifsfs.c | 3 ++- fs/coda/inode.c | 6 +++--- fs/coda/upcall.c | 4 ++-- fs/compat.c | 8 ++++---- fs/cramfs/inode.c | 4 +++- fs/efs/super.c | 6 +++--- fs/ext2/super.c | 5 +++-- fs/ext3/super.c | 5 +++-- fs/fat/inode.c | 8 ++++---- fs/freevxfs/vxfs_super.c | 13 +++++++------ fs/fuse/inode.c | 3 ++- fs/hfs/super.c | 4 +++- fs/hfsplus/super.c | 4 +++- fs/hostfs/hostfs_kern.c | 4 ++-- fs/hpfs/super.c | 3 ++- fs/hppfs/hppfs_kern.c | 2 +- fs/hugetlbfs/inode.c | 4 ++-- fs/isofs/inode.c | 6 ++++-- fs/jffs/inode-v23.c | 4 ++-- fs/jffs2/fs.c | 4 ++-- fs/jffs2/os-linux.h | 2 +- fs/jfs/super.c | 4 ++-- fs/libfs.c | 4 ++-- fs/minix/inode.c | 10 +++++----- fs/ncpfs/inode.c | 5 +++-- fs/nfs/inode.c | 5 +++-- fs/nfsd/nfs4xdr.c | 2 +- fs/nfsd/vfs.c | 2 +- fs/ntfs/super.c | 7 ++++--- fs/ocfs2/super.c | 10 +++++----- fs/open.c | 26 +++++++++++++------------- fs/qnx4/inode.c | 6 ++++-- fs/reiserfs/super.c | 8 ++++---- fs/romfs/inode.c | 4 ++-- fs/smbfs/inode.c | 6 +++--- fs/smbfs/proc.c | 4 ++-- fs/smbfs/proto.h | 2 +- fs/super.c | 2 +- fs/sysv/inode.c | 3 ++- fs/udf/super.c | 6 ++++-- fs/ufs/super.c | 3 ++- fs/xfs/linux-2.6/xfs_super.c | 4 ++-- include/linux/coda_psdev.h | 2 +- include/linux/fs.h | 6 +++--- include/linux/mount.h | 5 +++++ include/linux/security.h | 14 +++++++------- kernel/acct.c | 2 +- mm/shmem.c | 4 ++-- security/dummy.c | 2 +- security/selinux/hooks.c | 6 +++--- 60 files changed, 175 insertions(+), 144 deletions(-)
Documentation/filesystems/Locking +1 -1
@@ -99,7 +99,7 @@ prototypes: int (*sync_fs)(struct super_block *sb, int wait); void (*write_super_lockfs) (struct super_block *); void (*unlockfs) (struct super_block *); - int (*statfs) (struct super_block *, struct kstatfs *); + int (*statfs) (struct dentry *, struct kstatfs *); int (*remount_fs) (struct super_block *, int *, char *); void (*clear_inode) (struct inode *); void (*umount_begin) (struct super_block *);
Documentation/filesystems/vfs.txt +1 -1
@@ -211,7 +211,7 @@ struct super_operations { int (*sync_fs)(struct super_block *sb, int wait); void (*write_super_lockfs) (struct super_block *); void (*unlockfs) (struct super_block *); - int (*statfs) (struct super_block *, struct kstatfs *); + int (*statfs) (struct dentry *, struct kstatfs *); int (*remount_fs) (struct super_block *, int *, char *); void (*clear_inode) (struct inode *); void (*umount_begin) (struct super_block *);
arch/alpha/kernel/osf_sys.c +1 -1
@@ -244,7 +244,7 @@ do_osf_statfs(struct dentry * dentry, st unsigned long bufsiz) {struct kstatfs linux_stat; -int error =vfs_statfs (dentry->d_inode->i_sb, &linux_stat); +int error =vfs_statfs (dentry, &linux_stat);if (!error) error =linux_to_osf_statfs (&linux_stat, buffer, bufsiz);return error;
arch/mips/kernel/sysirix.c +6 -6
@@ -694,7 +694,7 @@ asmlinkage int irix_statfs(const char __if (error) goto out; - error =vfs_statfs (nd.dentry->d_inode->i_sb, &kbuf); + error =vfs_statfs (nd.dentry, &kbuf);if (error) goto dput_and_out;
@@ -732,7 +732,7 @@ asmlinkage int irix_fstatfs(unsigned int goto out; } - error =vfs_statfs (file->f_dentry->d_inode->i_sb, &kbuf); + error =vfs_statfs (file->f_dentry, &kbuf);if (error) goto out_f;
@@ -1360,7 +1360,7 @@ asmlinkage int irix_statvfs(char __user error =user_path_walk (fname, &nd);if (error) goto out; - error =vfs_statfs (nd.dentry->d_inode->i_sb, &kbuf); + error =vfs_statfs (nd.dentry, &kbuf);if (error) goto dput_and_out;
@@ -1406,7 +1406,7 @@ asmlinkage int irix_fstatvfs(int fd, str error = -EBADF ; goto out; } - error =vfs_statfs (file->f_dentry->d_inode->i_sb, &kbuf); + error =vfs_statfs (file->f_dentry, &kbuf);if (error) goto out_f;
@@ -1611,7 +1611,7 @@ asmlinkage int irix_statvfs64(char __use error =user_path_walk (fname, &nd);if (error) goto out; - error =vfs_statfs (nd.dentry->d_inode->i_sb, &kbuf); + error =vfs_statfs (nd.dentry, &kbuf);if (error) goto dput_and_out;
@@ -1658,7 +1658,7 @@ asmlinkage int irix_fstatvfs64(int fd, s error = -EBADF ; goto out; } - error =vfs_statfs (file->f_dentry->d_inode->i_sb, &kbuf); + error =vfs_statfs (file->f_dentry, &kbuf);if (error) goto out_f;
arch/parisc/hpux/sys_hpux.c +5 -5
@@ -145,7 +145,7 @@ static int hpux_ustat(dev_t dev, struct s =user_get_super (dev);if (s ==NULL ) goto out; - err =vfs_statfs (s, &sbuf); + err =vfs_statfs (s->s_root, &sbuf);drop_super (s);if (err) goto out;
@@ -186,12 +186,12 @@ struct hpux_statfs {int16_t f_pad; }; -static int vfs_statfs_hpux (struct super_block *sb,struct hpux_statfs *buf) +static int vfs_statfs_hpux (struct dentry *dentry,struct hpux_statfs *buf) {struct kstatfs st;int retval; - retval =vfs_statfs (sb, &st); + retval =vfs_statfs (dentry, &st);if (retval)return retval;
@@ -219,7 +219,7 @@ asmlinkage long hpux_statfs(const char _ error =user_path_walk (path, &nd);if (!error) {struct hpux_statfs tmp; - error =vfs_statfs_hpux (nd.dentry->d_inode->i_sb, &tmp); + error =vfs_statfs_hpux (nd.dentry, &tmp);if (!error &©_to_user (buf, &tmp,sizeof (tmp))) error = -EFAULT ;path_release (&nd);
@@ -237,7 +237,7 @@ asmlinkage long hpux_fstatfs(unsigned in file =fget (fd);if (!file) goto out; - error =vfs_statfs_hpux (file->f_dentry->d_inode->i_sb, &tmp); + error =vfs_statfs_hpux (file->f_dentry, &tmp);if (!error &©_to_user (buf, &tmp,sizeof (tmp))) error = -EFAULT ;fput (file);
arch/sparc64/solaris/fs.c +2 -2
@@ -356,7 +356,7 @@ static int report_statvfs(struct vfsmounint error;struct sol_statvfs __user *ss =A (buf); - error =vfs_statfs (mnt->mnt_sb, &s); + error =vfs_statfs (mnt->mnt_root, &s);if (!error) {const char *p = mnt->mnt_sb->s_type->name;int i =0 ;
@@ -392,7 +392,7 @@ static int report_statvfs64(struct vfsmoint error;struct sol_statvfs64 __user *ss =A (buf); - error =vfs_statfs (mnt->mnt_sb, &s); + error =vfs_statfs (mnt->mnt_root, &s);if (!error) {const char *p = mnt->mnt_sb->s_type->name;int i =0 ;
fs/adfs/super.c +4 -4
@@ -196,17 +196,17 @@ static int adfs_remount(struct super_bloreturn parse_options (sb, data); } -static int adfs_statfs (struct super_block *sb,struct kstatfs *buf) +static int adfs_statfs (struct dentry *dentry,struct kstatfs *buf) { -struct adfs_sb_info *asb =ADFS_SB (sb); +struct adfs_sb_info *asb =ADFS_SB (dentry->d_sb); buf->f_type =ADFS_SUPER_MAGIC ; buf->f_namelen = asb->s_namelen; - buf->f_bsize = sb->s_blocksize; + buf->f_bsize = dentry->d_sb->s_blocksize; buf->f_blocks = asb->s_size; buf->f_files = asb->s_ids_per_zone * asb->s_map_size; buf->f_bavail = - buf->f_bfree =adfs_map_free (sb); + buf->f_bfree =adfs_map_free (dentry->d_sb); buf->f_ffree = (long )(buf->f_bfree * buf->f_files) / (long )buf->f_blocks;return 0 ;
fs/affs/super.c +3 -2
@@ -18,7 +18,7 @@ #include "affs.h"extern struct timezone sys_tz; -static int affs_statfs (struct super_block *sb,struct kstatfs *buf); +static int affs_statfs (struct dentry *dentry,struct kstatfs *buf);static int affs_remount (struct super_block *sb,int *flags,char *data); static void
@@ -508,8 +508,9 @@ affs_remount(struct super_block *sb, int }static int -affs_statfs (struct super_block *sb,struct kstatfs *buf) +affs_statfs (struct dentry *dentry,struct kstatfs *buf) { +struct super_block *sb = dentry->d_sb;int free; pr_debug("AFFS: statfs() partsize=%d, reserved=%d\n",AFFS_SB(sb)->s_partition_size,
fs/befs/linuxvfs.c +3 -2
@@ -49,7 +49,7 @@ static int befs_nls2utf(struct super_blo char **out, int *out_len);static void befs_put_super (struct super_block *);static int befs_remount (struct super_block *,int *,char *); -static int befs_statfs (struct super_block *,struct kstatfs *); +static int befs_statfs (struct dentry *,struct kstatfs *);static int parse_options (char *,befs_mount_options *);static const struct super_operations befs_sops = {
@@ -880,8 +880,9 @@ befs_remount(struct super_block *sb, int }static int -befs_statfs (struct super_block *sb,struct kstatfs *buf) +befs_statfs (struct dentry *dentry,struct kstatfs *buf) { +struct super_block *sb = dentry->d_sb;befs_debug (sb,"---> befs_statfs()" );
fs/bfs/inode.c +2 -1
@@ -203,8 +203,9 @@ static void bfs_put_super(struct super_b s->s_fs_info =NULL ; } -static int bfs_statfs (struct super_block *s,struct kstatfs *buf) +static int bfs_statfs (struct dentry *dentry,struct kstatfs *buf) { +struct super_block *s = dentry->d_sb;struct bfs_sb_info *info =BFS_SB (s);u64 id =huge_encode_dev (s->s_bdev->bd_dev); buf->f_type =BFS_MAGIC ;
fs/cifs/cifsfs.c +2 -1
@@ -166,8 +166,9 @@ cifs_put_super(struct super_block *sb) }static int -cifs_statfs (struct super_block *sb,struct kstatfs *buf) +cifs_statfs (struct dentry *dentry,struct kstatfs *buf) { +struct super_block *sb = dentry->d_sb;int xid;int rc = -EOPNOTSUPP ;struct cifs_sb_info *cifs_sb;
fs/coda/inode.c +3 -3
@@ -36,7 +36,7 @@ #include "coda_int.h"/* VFS super_block ops */ static void coda_clear_inode (struct inode *);static void coda_put_super (struct super_block *); -static int coda_statfs (struct super_block *sb,struct kstatfs *buf); +static int coda_statfs (struct dentry *dentry,struct kstatfs *buf);static kmem_cache_t * coda_inode_cachep;
@@ -278,13 +278,13 @@ struct inode_operations coda_file_inode_ .setattr = coda_setattr, }; -static int coda_statfs (struct super_block *sb,struct kstatfs *buf) +static int coda_statfs (struct dentry *dentry,struct kstatfs *buf) {int error;lock_kernel (); - error =venus_statfs (sb, buf); + error =venus_statfs (dentry, buf);unlock_kernel ();
fs/coda/upcall.c +2 -2
@@ -611,7 +611,7 @@ int venus_pioctl(struct super_block *sb,return error; } -int venus_statfs (struct super_block *sb,struct kstatfs *sfs) +int venus_statfs (struct dentry *dentry,struct kstatfs *sfs) {union inputArgs *inp;union outputArgs *outp;
@@ -620,7 +620,7 @@ int venus_statfs(struct super_block *sb, insize = max_t(unsigned int, INSIZE(statfs), OUTSIZE(statfs));UPARG (CODA_STATFS ); - error =coda_upcall (coda_sbp (sb), insize, &outsize, inp); + error =coda_upcall (coda_sbp (dentry->d_sb), insize, &outsize, inp);if (!error) { sfs->f_blocks = outp->coda_statfs.stat.f_blocks;
fs/compat.c +4 -4
@@ -197,7 +197,7 @@ asmlinkage long compat_sys_statfs(const error =user_path_walk (path, &nd);if (!error) {struct kstatfs tmp; - error =vfs_statfs (nd.dentry->d_inode->i_sb, &tmp); + error =vfs_statfs (nd.dentry, &tmp);if (!error) error =put_compat_statfs (buf, &tmp);path_release (&nd);
@@ -215,7 +215,7 @@ asmlinkage long compat_sys_fstatfs(unsig file =fget (fd);if (!file) goto out; - error =vfs_statfs (file->f_dentry->d_inode->i_sb, &tmp); + error =vfs_statfs (file->f_dentry, &tmp);if (!error) error =put_compat_statfs (buf, &tmp);fput (file);
@@ -265,7 +265,7 @@ asmlinkage long compat_sys_statfs64(cons error =user_path_walk (path, &nd);if (!error) {struct kstatfs tmp; - error =vfs_statfs (nd.dentry->d_inode->i_sb, &tmp); + error =vfs_statfs (nd.dentry, &tmp);if (!error) error =put_compat_statfs64 (buf, &tmp);path_release (&nd);
@@ -286,7 +286,7 @@ asmlinkage long compat_sys_fstatfs64(uns file =fget (fd);if (!file) goto out; - error =vfs_statfs (file->f_dentry->d_inode->i_sb, &tmp); + error =vfs_statfs (file->f_dentry, &tmp);if (!error) error =put_compat_statfs64 (buf, &tmp);fput (file);
fs/cramfs/inode.c +3 -1
@@ -322,8 +322,10 @@ out:return -EINVAL ; } -static int cramfs_statfs (struct super_block *sb,struct kstatfs *buf) +static int cramfs_statfs (struct dentry *dentry,struct kstatfs *buf) { +struct super_block *sb = dentry->d_sb; + buf->f_type =CRAMFS_MAGIC ; buf->f_bsize =PAGE_CACHE_SIZE ; buf->f_blocks =CRAMFS_SB (sb)->blocks;
fs/efs/super.c +3 -3
@@ -15,7 +15,7 @@ #include <linux/slab.h>#include <linux/buffer_head.h> #include <linux/vfs.h> -static int efs_statfs (struct super_block *s,struct kstatfs *buf); +static int efs_statfs (struct dentry *dentry,struct kstatfs *buf);static int efs_fill_super (struct super_block *s,void *d,int silent); static int efs_get_sb(struct file_system_type *fs_type,
@@ -322,8 +322,8 @@ out_no_fs:return -EINVAL ; } -static int efs_statfs (struct super_block *s,struct kstatfs *buf) { -struct efs_sb_info *sb =SUPER_INFO (s); +static int efs_statfs (struct dentry *dentry,struct kstatfs *buf) { +struct efs_sb_info *sb =SUPER_INFO (dentry->d_sb); buf->f_type =EFS_SUPER_MAGIC ;/* efs magic number */ buf->f_bsize =EFS_BLOCKSIZE ;/* blocksize */
fs/ext2/super.c +3 -2
@@ -39,7 +39,7 @@ #include "xip.h"static void ext2_sync_super (struct super_block *sb,struct ext2_super_block *es);static int ext2_remount (struct super_block * sb,int * flags,char * data); -static int ext2_statfs (struct super_block * sb,struct kstatfs * buf); +static int ext2_statfs (struct dentry * dentry,struct kstatfs * buf);void ext2_error (struct super_block * sb,const char * function,const char * fmt, ...)
@@ -1038,8 +1038,9 @@ restore_opts:return err; } -static int ext2_statfs (struct super_block * sb,struct kstatfs * buf) +static int ext2_statfs (struct dentry * dentry,struct kstatfs * buf) { +struct super_block *sb = dentry->d_sb;struct ext2_sb_info *sbi =EXT2_SB (sb);unsigned long overhead;int i;
fs/ext3/super.c +3 -2
@@ -58,7 +58,7 @@ static int ext3_sync_fs(struct super_blostatic const char *ext3_decode_error (struct super_block * sb,int errno,char nbuf[16 ]);static int ext3_remount (struct super_block * sb,int * flags,char * data); -static int ext3_statfs (struct super_block * sb,struct kstatfs * buf); +static int ext3_statfs (struct dentry * dentry,struct kstatfs * buf);static void ext3_unlockfs (struct super_block *sb);static void ext3_write_super (struct super_block * sb);static void ext3_write_super_lockfs (struct super_block *sb);
@@ -2318,8 +2318,9 @@ #endifreturn err; } -static int ext3_statfs (struct super_block * sb,struct kstatfs * buf) +static int ext3_statfs (struct dentry * dentry,struct kstatfs * buf) { +struct super_block *sb = dentry->d_sb;struct ext3_sb_info *sbi =EXT3_SB (sb);struct ext3_super_block *es = sbi->s_es;unsigned long overhead;
fs/fat/inode.c +4 -4
@@ -539,18 +539,18 @@ static int fat_remount(struct super_blocreturn 0 ; } -static int fat_statfs (struct super_block *sb,struct kstatfs *buf) +static int fat_statfs (struct dentry *dentry,struct kstatfs *buf) { -struct msdos_sb_info *sbi =MSDOS_SB (sb); +struct msdos_sb_info *sbi =MSDOS_SB (dentry->d_sb);/* If the count of free cluster is still unknown, counts it here. */ if (sbi->free_clusters ==-1 ) { -int err =fat_count_free_clusters (sb); +int err =fat_count_free_clusters (dentry->d_sb);if (err)return err; } - buf->f_type = sb->s_magic; + buf->f_type = dentry->d_sb->s_magic; buf->f_bsize = sbi->cluster_size; buf->f_blocks = sbi->max_cluster -FAT_START_ENT ; buf->f_bfree = sbi->free_clusters;
fs/freevxfs/vxfs_super.c +7 -6
@@ -40,6 +40,7 @@ #include <linux/kernel.h>#include <linux/slab.h> #include <linux/stat.h> #include <linux/vfs.h> +#include <linux/mount.h> #include "vxfs.h" #include "vxfs_extern.h"
@@ -55,7 +56,7 @@ MODULE_ALIAS("vxfs"); /* makes mount -tstatic void vxfs_put_super (struct super_block *); -static int vxfs_statfs (struct super_block *,struct kstatfs *); +static int vxfs_statfs (struct dentry *,struct kstatfs *);static int vxfs_remount (struct super_block *,int *,char *);static struct super_operations vxfs_super_ops = {
@@ -90,12 +91,12 @@ vxfs_put_super(struct super_block *sbp)/** * vxfs_statfs - get filesystem information -* @sbp: VFS superblock +* @dentry: VFS dentry to locate superblock * @bufp: output buffer * * Description: * vxfs_statfs fills the statfs buffer @bufp with information -* about the filesystem described by @sbp. +* about the filesystem described by @dentry. * * Returns: * Zero.
@@ -107,12 +108,12 @@ vxfs_put_super(struct super_block *sbp)* This is everything but complete... */ static int -vxfs_statfs (struct super_block *sbp,struct kstatfs *bufp) +vxfs_statfs (struct dentry *dentry,struct kstatfs *bufp) { -struct vxfs_sb_info *infp =VXFS_SBI (sbp); +struct vxfs_sb_info *infp =VXFS_SBI (dentry->d_sb); bufp->f_type =VXFS_SUPER_MAGIC ; - bufp->f_bsize = sbp->s_blocksize; + bufp->f_bsize = dentry->d_sb->s_blocksize; bufp->f_blocks = infp->vsi_raw->vs_dsize; bufp->f_bfree = infp->vsi_raw->vs_free; bufp->f_bavail =0 ;
fs/fuse/inode.c +2 -1
@@ -236,8 +236,9 @@ static void convert_fuse_statfs(struct k/* fsid is left zero */ } -static int fuse_statfs (struct super_block *sb,struct kstatfs *buf) +static int fuse_statfs (struct dentry *dentry,struct kstatfs *buf) { +struct super_block *sb = dentry->d_sb;struct fuse_conn *fc =get_fuse_conn_super (sb);struct fuse_req *req;struct fuse_statfs_out outarg;
fs/hfs/super.c +3 -1
@@ -80,8 +80,10 @@ static void hfs_put_super(struct super_b* * changed f_files/f_ffree to reflect the fs_ablock/free_ablocks. */ -static int hfs_statfs (struct super_block *sb,struct kstatfs *buf) +static int hfs_statfs (struct dentry *dentry,struct kstatfs *buf) { +struct super_block *sb = dentry->d_sb; + buf->f_type =HFS_SUPER_MAGIC ; buf->f_bsize = sb->s_blocksize; buf->f_blocks = (u32 )HFS_SB (sb)->fs_ablocks *HFS_SB (sb)->fs_div;
fs/hfsplus/super.c +3 -1
@@ -212,8 +212,10 @@ static void hfsplus_put_super(struct sup sb->s_fs_info =NULL ; } -static int hfsplus_statfs (struct super_block *sb,struct kstatfs *buf) +static int hfsplus_statfs (struct dentry *dentry,struct kstatfs *buf) { +struct super_block *sb = dentry->d_sb; + buf->f_type =HFSPLUS_SUPER_MAGIC ; buf->f_bsize = sb->s_blocksize; buf->f_blocks =HFSPLUS_SB (sb).total_blocks <<HFSPLUS_SB (sb).fs_shift;
fs/hostfs/hostfs_kern.c +2 -2
@@ -239,7 +239,7 @@ static int read_inode(struct inode *ino)return (err); } -int hostfs_statfs (struct super_block *sb,struct kstatfs *sf) +int hostfs_statfs (struct dentry *dentry,struct kstatfs *sf) {/* do_statfs uses struct statfs64 internally, but the linux kernel * struct statfs still has 32-bit versions for most of these fields,
@@ -252,7 +252,7 @@ int hostfs_statfs(struct super_block *sblong long f_files;long long f_ffree; - err =do_statfs (HOSTFS_I (sb->s_root->d_inode)->host_filename, + err =do_statfs (HOSTFS_I (dentry->d_sb->s_root->d_inode)->host_filename, &sf->f_bsize, &f_blocks, &f_bfree, &f_bavail, &f_files, &f_ffree, &sf->f_fsid,sizeof (sf->f_fsid), &sf->f_namelen, sf->f_spare);
fs/hpfs/super.c +2 -1
@@ -135,8 +135,9 @@ static unsigned count_bitmaps(struct supreturn count; } -static int hpfs_statfs (struct super_block *s,struct kstatfs *buf) +static int hpfs_statfs (struct dentry *dentry,struct kstatfs *buf) { +struct super_block *s = dentry->d_sb;struct hpfs_sb_info *sbi =hpfs_sb (s);lock_kernel ();
fs/hppfs/hppfs_kern.c +1 -1
@@ -616,7 +616,7 @@ static const struct file_operations hppf .fsync = hppfs_fsync, }; -static int hppfs_statfs (struct super_block *sb,struct kstatfs *sf) +static int hppfs_statfs (struct dentry *dentry,struct kstatfs *sf) { sf->f_blocks =0 ; sf->f_bfree =0 ;
fs/hugetlbfs/inode.c +2 -2
@@ -467,9 +467,9 @@ static int hugetlbfs_set_page_dirty(strureturn 0 ; } -static int hugetlbfs_statfs (struct super_block *sb,struct kstatfs *buf) +static int hugetlbfs_statfs (struct dentry *dentry,struct kstatfs *buf) { -struct hugetlbfs_sb_info *sbinfo =HUGETLBFS_SB (sb); +struct hugetlbfs_sb_info *sbinfo =HUGETLBFS_SB (dentry->d_sb); buf->f_type =HUGETLBFS_MAGIC ; buf->f_bsize =HPAGE_SIZE ;
fs/isofs/inode.c +4 -2
@@ -56,7 +56,7 @@ #endif }static void isofs_read_inode (struct inode *); -static int isofs_statfs (struct super_block *,struct kstatfs *); +static int isofs_statfs (struct dentry *,struct kstatfs *);static kmem_cache_t *isofs_inode_cachep;
@@ -901,8 +901,10 @@ out_freesbi:return -EINVAL ; } -static int isofs_statfs (struct super_block *sb,struct kstatfs *buf) +static int isofs_statfs (struct dentry *dentry,struct kstatfs *buf) { +struct super_block *sb = dentry->d_sb; + buf->f_type =ISOFS_SUPER_MAGIC ; buf->f_bsize = sb->s_blocksize; buf->f_blocks = (ISOFS_SB(sb)->s_nzones
fs/jffs/inode-v23.c +2 -2
@@ -377,9 +377,9 @@ jffs_new_inode(const struct inode * dir,/* Get statistics of the file system. */ static int -jffs_statfs (struct super_block *sb,struct kstatfs *buf) +jffs_statfs (struct dentry *dentry,struct kstatfs *buf) { -struct jffs_control *c = (struct jffs_control *) sb->s_fs_info; +struct jffs_control *c = (struct jffs_control *) dentry->d_sb->s_fs_info;struct jffs_fmcontrol *fmc;lock_kernel ();
fs/jffs2/fs.c +2 -2
@@ -192,9 +192,9 @@ int jffs2_setattr(struct dentry *dentry,return rc; } -int jffs2_statfs (struct super_block *sb,struct kstatfs *buf) +int jffs2_statfs (struct dentry *dentry,struct kstatfs *buf) { -struct jffs2_sb_info *c =JFFS2_SB_INFO (sb); +struct jffs2_sb_info *c =JFFS2_SB_INFO (dentry->d_sb);unsigned long avail; buf->f_type =JFFS2_SUPER_MAGIC ;
fs/jffs2/os-linux.h +1 -1
@@ -175,7 +175,7 @@ void jffs2_clear_inode (struct inode *);void jffs2_dirty_inode (struct inode *inode);struct inode *jffs2_new_inode (struct inode *dir_i,int mode,struct jffs2_raw_inode *ri); -int jffs2_statfs (struct super_block *,struct kstatfs *); +int jffs2_statfs (struct dentry *,struct kstatfs *);void jffs2_write_super (struct super_block *);int jffs2_remount_fs (struct super_block *,int *,char *);int jffs2_do_fill_super (struct super_block *sb,void *data,int silent);
fs/jfs/super.c +2 -2
@@ -139,9 +139,9 @@ #endifkmem_cache_free (jfs_inode_cachep, ji); } -static int jfs_statfs (struct super_block *sb,struct kstatfs *buf) +static int jfs_statfs (struct dentry *dentry,struct kstatfs *buf) { -struct jfs_sb_info *sbi =JFS_SBI (sb); +struct jfs_sb_info *sbi =JFS_SBI (dentry->d_sb);s64 maxinodes;struct inomap *imap =JFS_IP (sbi->ipimap)->i_imap;
fs/libfs.c +2 -2
@@ -20,9 +20,9 @@ int simple_getattr(struct vfsmount *mnt,return 0 ; } -int simple_statfs (struct super_block *sb,struct kstatfs *buf) +int simple_statfs (struct dentry *dentry,struct kstatfs *buf) { - buf->f_type = sb->s_magic; + buf->f_type = dentry->d_sb->s_magic; buf->f_bsize =PAGE_CACHE_SIZE ; buf->f_namelen =NAME_MAX ;return 0 ;
fs/minix/inode.c +5 -5
@@ -19,7 +19,7 @@ #include <linux/vfs.h>static void minix_read_inode (struct inode * inode);static int minix_write_inode (struct inode * inode,int wait); -static int minix_statfs (struct super_block *sb,struct kstatfs *buf); +static int minix_statfs (struct dentry *dentry,struct kstatfs *buf);static int minix_remount (struct super_block * sb,int * flags,char * data);static void minix_delete_inode (struct inode *inode)
@@ -296,11 +296,11 @@ out_bad_sb:return -EINVAL ; } -static int minix_statfs (struct super_block *sb,struct kstatfs *buf) +static int minix_statfs (struct dentry *dentry,struct kstatfs *buf) { -struct minix_sb_info *sbi =minix_sb (sb); - buf->f_type = sb->s_magic; - buf->f_bsize = sb->s_blocksize; +struct minix_sb_info *sbi =minix_sb (dentry->d_sb); + buf->f_type = dentry->d_sb->s_magic; + buf->f_bsize = dentry->d_sb->s_blocksize; buf->f_blocks = (sbi->s_nzones - sbi->s_firstdatazone) << sbi->s_log_zone_size; buf->f_bfree =minix_count_free_blocks (sbi); buf->f_bavail = buf->f_bfree;
fs/ncpfs/inode.c +3 -2
@@ -39,7 +39,7 @@ #include "getopt.h"static void ncp_delete_inode (struct inode *);static void ncp_put_super (struct super_block *); -static int ncp_statfs (struct super_block *,struct kstatfs *); +static int ncp_statfs (struct dentry *,struct kstatfs *);static kmem_cache_t * ncp_inode_cachep;
@@ -724,13 +724,14 @@ #endif /* CONFIG_NCPFS_NLS */kfree (server); } -static int ncp_statfs (struct super_block *sb,struct kstatfs *buf) +static int ncp_statfs (struct dentry *dentry,struct kstatfs *buf) {struct dentry * d;struct inode * i;struct ncp_inode_info * ni;struct ncp_server * s;struct ncp_volume_info vi; +struct super_block *sb = dentry->d_sb;int err;__u8 dh;
fs/nfs/inode.c +3 -2
@@ -65,7 +65,7 @@ static int nfs_write_inode(struct inodestatic void nfs_delete_inode (struct inode *);static void nfs_clear_inode (struct inode *);static void nfs_umount_begin (struct super_block *); -static int nfs_statfs (struct super_block *,struct kstatfs *); +static int nfs_statfs (struct dentry *,struct kstatfs *);static int nfs_show_options (struct seq_file *,struct vfsmount *);static int nfs_show_stats (struct seq_file *,struct vfsmount *);static void nfs_zap_acl_cache (struct inode *);
@@ -534,8 +534,9 @@ #endif /* CONFIG_NFS_V3_ACL */ }static int -nfs_statfs (struct super_block *sb,struct kstatfs *buf) +nfs_statfs (struct dentry *dentry,struct kstatfs *buf) { +struct super_block *sb = dentry->d_sb;struct nfs_server *server =NFS_SB (sb);unsigned char blockbits;unsigned long blockres;
fs/nfsd/nfs4xdr.c +1 -1
@@ -1310,7 +1310,7 @@ nfsd4_encode_fattr(struct svc_fh *fhp, sif ((bmval0 & (FATTR4_WORD0_FILES_FREE |FATTR4_WORD0_FILES_TOTAL )) || (bmval1 & (FATTR4_WORD1_SPACE_AVAIL |FATTR4_WORD1_SPACE_FREE |FATTR4_WORD1_SPACE_TOTAL ))) { - status =vfs_statfs (dentry->d_inode->i_sb, &statfs); + status =vfs_statfs (dentry, &statfs);if (status) goto out_nfserr; }
fs/nfsd/vfs.c +1 -1
@@ -1737,7 +1737,7 @@ int nfsd_statfs(struct svc_rqst *rqstp, struct svc_fh *fhp, struct kstatfs *stat) { int err = fh_verify(rqstp, fhp, 0, MAY_NOP); -if (!err &&vfs_statfs (fhp->fh_dentry->d_inode->i_sb,stat)) +if (!err &&vfs_statfs (fhp->fh_dentry,stat)) err = nfserr_io;return err; }
fs/ntfs/super.c +4 -3
@@ -2601,10 +2601,10 @@ static unsigned long __get_nr_free_mft_r/** * ntfs_statfs - return information about mounted NTFS volume -* @sb: super block of mounted volume +* @dentry: dentry from mounted volume * @sfs: statfs structure in which to return the information * -* Return information about the mounted NTFS volume @sb in the statfs structure +* Return information about the mounted NTFS volume @dentry in the statfs structure * pointed to by @sfs (this is initialized with zeros before ntfs_statfs is * called). We interpret the values to be correct of the moment in time at * which we are called. Most values are variable otherwise and this isn't just
@@ -2617,8 +2617,9 @@ static unsigned long __get_nr_free_mft_r* * Return 0 on success or -errno on error. */ -static int ntfs_statfs (struct super_block *sb,struct kstatfs *sfs) +static int ntfs_statfs (struct dentry *dentry,struct kstatfs *sfs) { +struct super_block *sb = dentry->d_sb;s64 size;ntfs_volume *vol =NTFS_SB (sb);ntfs_inode *mft_ni =NTFS_I (vol->mft_ino);
fs/ocfs2/super.c +5 -5
@@ -100,7 +100,7 @@ static int ocfs2_initialize_mem_caches(vstatic void ocfs2_free_mem_caches (void );static void ocfs2_delete_osb (struct ocfs2_super *osb); -static int ocfs2_statfs (struct super_block *sb,struct kstatfs *buf); +static int ocfs2_statfs (struct dentry *dentry,struct kstatfs *buf);static int ocfs2_sync_fs (struct super_block *sb,int wait);
@@ -857,7 +857,7 @@ static void ocfs2_put_super(struct supermlog_exit_void (); } -static int ocfs2_statfs (struct super_block *sb,struct kstatfs *buf) +static int ocfs2_statfs (struct dentry *dentry,struct kstatfs *buf) {struct ocfs2_super *osb;u32 numbits, freebits;
@@ -866,9 +866,9 @@ static int ocfs2_statfs(struct super_blostruct buffer_head *bh =NULL ;struct inode *inode =NULL ; -mlog_entry ("(%p, %p)\n" , sb, buf); +mlog_entry ("(%p, %p)\n" , dentry->d_sb, buf); - osb =OCFS2_SB (sb); + osb =OCFS2_SB (dentry->d_sb); inode = ocfs2_get_system_file_inode(osb, GLOBAL_BITMAP_SYSTEM_INODE,
@@ -891,7 +891,7 @@ static int ocfs2_statfs(struct super_blo freebits = numbits -le32_to_cpu (bm_lock->id1.bitmap1.i_used); buf->f_type =OCFS2_SUPER_MAGIC ; - buf->f_bsize = sb->s_blocksize; + buf->f_bsize = dentry->d_sb->s_blocksize; buf->f_namelen =OCFS2_MAX_FILENAME_LEN ; buf->f_blocks = ((sector_t ) numbits) * (osb->s_clustersize >> osb->sb->s_blocksize_bits);
fs/open.c +13 -13
@@ -31,18 +31,18 @@ #include <linux/audit.h>#include <asm/unistd.h> -int vfs_statfs (struct super_block *sb,struct kstatfs *buf) +int vfs_statfs (struct dentry *dentry,struct kstatfs *buf) {int retval = -ENODEV ; -if (sb) { +if (dentry) { retval = -ENOSYS ; -if (sb->s_op->statfs) { +if (dentry->d_sb->s_op->statfs) {memset (buf,0 ,sizeof (*buf)); - retval =security_sb_statfs (sb); + retval =security_sb_statfs (dentry);if (retval)return retval; - retval = sb->s_op->statfs (sb, buf); + retval = dentry->d_sb->s_op->statfs (dentry, buf);if (retval ==0 && buf->f_frsize ==0 ) buf->f_frsize = buf->f_bsize; }
@@ -52,12 +52,12 @@ int vfs_statfs(struct super_block *sb, sEXPORT_SYMBOL (vfs_statfs); -static int vfs_statfs_native (struct super_block *sb,struct statfs *buf) +static int vfs_statfs_native (struct dentry *dentry,struct statfs *buf) {struct kstatfs st;int retval; - retval =vfs_statfs (sb, &st); + retval =vfs_statfs (dentry, &st);if (retval)return retval;
@@ -95,12 +95,12 @@ static int vfs_statfs_native(struct supereturn 0 ; } -static int vfs_statfs64 (struct super_block *sb,struct statfs64 *buf) +static int vfs_statfs64 (struct dentry *dentry,struct statfs64 *buf) {struct kstatfs st;int retval; - retval =vfs_statfs (sb, &st); + retval =vfs_statfs (dentry, &st);if (retval)return retval;
@@ -130,7 +130,7 @@ asmlinkage long sys_statfs(const char __ error =user_path_walk (path, &nd);if (!error) {struct statfs tmp; - error =vfs_statfs_native (nd.dentry->d_inode->i_sb, &tmp); + error =vfs_statfs_native (nd.dentry, &tmp);if (!error &©_to_user (buf, &tmp,sizeof (tmp))) error = -EFAULT ;path_release (&nd);
@@ -149,7 +149,7 @@ asmlinkage long sys_statfs64(const char error =user_path_walk (path, &nd);if (!error) {struct statfs64 tmp; - error =vfs_statfs64 (nd.dentry->d_inode->i_sb, &tmp); + error =vfs_statfs64 (nd.dentry, &tmp);if (!error &©_to_user (buf, &tmp,sizeof (tmp))) error = -EFAULT ;path_release (&nd);
@@ -168,7 +168,7 @@ asmlinkage long sys_fstatfs(unsigned int file =fget (fd);if (!file) goto out; - error =vfs_statfs_native (file->f_dentry->d_inode->i_sb, &tmp); + error =vfs_statfs_native (file->f_dentry, &tmp);if (!error &©_to_user (buf, &tmp,sizeof (tmp))) error = -EFAULT ;fput (file);
@@ -189,7 +189,7 @@ asmlinkage long sys_fstatfs64(unsigned i file =fget (fd);if (!file) goto out; - error =vfs_statfs64 (file->f_dentry->d_inode->i_sb, &tmp); + error =vfs_statfs64 (file->f_dentry, &tmp);if (!error &©_to_user (buf, &tmp,sizeof (tmp))) error = -EFAULT ;fput (file);
fs/qnx4/inode.c +4 -2
@@ -128,7 +128,7 @@ static struct inode *qnx4_alloc_inode(ststatic void qnx4_destroy_inode (struct inode *inode);static void qnx4_read_inode (struct inode *);static int qnx4_remount (struct super_block *sb,int *flags,char *data); -static int qnx4_statfs (struct super_block *,struct kstatfs *); +static int qnx4_statfs (struct dentry *,struct kstatfs *);static struct super_operations qnx4_sops = {
@@ -282,8 +282,10 @@ unsigned long qnx4_block_map( struct inoreturn block; } -static int qnx4_statfs (struct super_block *sb,struct kstatfs *buf) +static int qnx4_statfs (struct dentry *dentry,struct kstatfs *buf) { +struct super_block *sb = dentry->d_sb; +lock_kernel (); buf->f_type = sb->s_magic;
fs/reiserfs/super.c +4 -4
@@ -60,7 +60,7 @@ static int is_any_reiserfs_magic_string( }static int reiserfs_remount (struct super_block *s,int *flags,char *data); -static int reiserfs_statfs (struct super_block *s,struct kstatfs *buf); +static int reiserfs_statfs (struct dentry *dentry,struct kstatfs *buf);static int reiserfs_sync_fs (struct super_block *s,int wait) {
@@ -1938,15 +1938,15 @@ #endifreturn errval; } -static int reiserfs_statfs (struct super_block *s,struct kstatfs *buf) +static int reiserfs_statfs (struct dentry *dentry,struct kstatfs *buf) { -struct reiserfs_super_block *rs =SB_DISK_SUPER_BLOCK (s); +struct reiserfs_super_block *rs =SB_DISK_SUPER_BLOCK (dentry->d_sb); buf->f_namelen = (REISERFS_MAX_NAME (s->s_blocksize)); buf->f_bfree =sb_free_blocks (rs); buf->f_bavail = buf->f_bfree; buf->f_blocks =sb_block_count (rs) -sb_bmap_nr (rs) -1 ; - buf->f_bsize = s->s_blocksize; + buf->f_bsize = dentry->d_sb->s_blocksize;/* changed to accommodate gcc folks. */ buf->f_type =REISERFS_SUPER_MAGIC ;return 0 ;
fs/romfs/inode.c +2 -2
@@ -179,12 +179,12 @@ outnobh:/* That's simple too. */ static int -romfs_statfs (struct super_block *sb,struct kstatfs *buf) +romfs_statfs (struct dentry *dentry,struct kstatfs *buf) { buf->f_type =ROMFS_MAGIC ; buf->f_bsize =ROMBSIZE ; buf->f_bfree = buf->f_bavail = buf->f_ffree; - buf->f_blocks = (romfs_maxsize (sb)+ROMBSIZE -1 )>>ROMBSBITS ; + buf->f_blocks = (romfs_maxsize (dentry->d_sb)+ROMBSIZE -1 )>>ROMBSBITS ; buf->f_namelen =ROMFS_MAXFN ;return 0 ; }
fs/smbfs/inode.c +3 -3
@@ -48,7 +48,7 @@ #define SMB_TTL_DEFAULT 1000static void smb_delete_inode (struct inode *);static void smb_put_super (struct super_block *); -static int smb_statfs (struct super_block *,struct kstatfs *); +static int smb_statfs (struct dentry *,struct kstatfs *);static int smb_show_options (struct seq_file *,struct vfsmount *);static kmem_cache_t *smb_inode_cachep;
@@ -641,13 +641,13 @@ out_no_server: }static int -smb_statfs (struct super_block *sb,struct kstatfs *buf) +smb_statfs (struct dentry *dentry,struct kstatfs *buf) {int result;lock_kernel (); - result =smb_proc_dskattr (sb, buf); + result =smb_proc_dskattr (dentry, buf);unlock_kernel ();
fs/smbfs/proc.c +2 -2
@@ -3226,9 +3226,9 @@ smb_proc_settime(struct dentry *dentry, }int -smb_proc_dskattr (struct super_block *sb,struct kstatfs *attr) +smb_proc_dskattr (struct dentry *dentry,struct kstatfs *attr) { -struct smb_sb_info *server =SMB_SB (sb); +struct smb_sb_info *server =SMB_SB (dentry->d_sb);int result;char *p;long unit;
fs/smbfs/proto.h +1 -1
@@ -29,7 +29,7 @@ extern int smb_proc_getattr(struct dentrextern int smb_proc_setattr (struct dentry *dir,struct smb_fattr *fattr);extern int smb_proc_setattr_unix (struct dentry *d,struct iattr *attr,unsigned int major,unsigned int minor);extern int smb_proc_settime (struct dentry *dentry,struct smb_fattr *fattr); -extern int smb_proc_dskattr (struct super_block *sb,struct kstatfs *attr); +extern int smb_proc_dskattr (struct dentry *dentry,struct kstatfs *attr);extern int smb_proc_read_link (struct smb_sb_info *server,struct dentry *d,char *buffer,int len);extern int smb_proc_symlink (struct smb_sb_info *server,struct dentry *d,const char *oldpath);extern int smb_proc_link (struct smb_sb_info *server,struct dentry *dentry,struct dentry *new_dentry);
fs/super.c +1 -1
@@ -486,7 +486,7 @@ asmlinkage long sys_ustat(unsigned dev, s =user_get_super (new_decode_dev (dev));if (s ==NULL ) goto out; - err =vfs_statfs (s, &sbuf); + err =vfs_statfs (s->s_root, &sbuf);drop_super (s);if (err) goto out;
fs/sysv/inode.c +2 -1
@@ -85,8 +85,9 @@ static void sysv_put_super(struct super_kfree (sbi); } -static int sysv_statfs (struct super_block *sb,struct kstatfs *buf) +static int sysv_statfs (struct dentry *dentry,struct kstatfs *buf) { +struct super_block *sb = dentry->d_sb;struct sysv_sb_info *sbi =SYSV_SB (sb); buf->f_type = sb->s_magic;
fs/udf/super.c +4 -2
@@ -91,7 +91,7 @@ static void udf_load_partdesc(struct supstatic void udf_open_lvid (struct super_block *);static void udf_close_lvid (struct super_block *);static unsigned int udf_count_free (struct super_block *); -static int udf_statfs (struct super_block *,struct kstatfs *); +static int udf_statfs (struct dentry *,struct kstatfs *);/* UDF filesystem type */ static int udf_get_sb(struct file_system_type *fs_type,
@@ -1779,8 +1779,10 @@ #endif* Written, tested, and released. */ static int -udf_statfs (struct super_block *sb,struct kstatfs *buf) +udf_statfs (struct dentry *dentry,struct kstatfs *buf) { +struct super_block *sb = dentry->d_sb; + buf->f_type =UDF_SUPER_MAGIC ; buf->f_bsize = sb->s_blocksize; buf->f_blocks =UDF_SB_PARTLEN (sb,UDF_SB_PARTITION (sb));
fs/ufs/super.c +2 -1
@@ -1113,8 +1113,9 @@ #endifreturn 0 ; } -static int ufs_statfs (struct super_block *sb,struct kstatfs *buf) +static int ufs_statfs (struct dentry *dentry,struct kstatfs *buf) { +struct super_block *sb = dentry->d_sb;struct ufs_sb_private_info * uspi;struct ufs_super_block_first * usb1;struct ufs_super_block * usb;
fs/xfs/linux-2.6/xfs_super.c +2 -2
@@ -703,10 +703,10 @@ xfs_fs_sync_super( STATIC intxfs_fs_statfs ( -struct super_block *sb, +struct dentry *dentry,struct kstatfs *statp) { -vfs_t *vfsp =vfs_from_sb (sb); +vfs_t *vfsp =vfs_from_sb (dentry->d_sb);int error;VFS_STATVFS (vfsp, statp,NULL , error);
include/linux/coda_psdev.h +1 -1
@@ -70,7 +70,7 @@ int venus_pioctl(struct super_block *sb, unsigned int cmd, struct PioctlData *data);int coda_downcall (int opcode,union outputArgs *out,struct super_block *sb);int venus_fsync (struct super_block *sb,struct CodaFid *fid); -int venus_statfs (struct super_block *sb,struct kstatfs *sfs); +int venus_statfs (struct dentry *dentry,struct kstatfs *sfs);/* messages between coda filesystem in kernel and Venus */
include/linux/fs.h +3 -3
@@ -1097,7 +1097,7 @@ struct super_operations {int (*sync_fs)(struct super_block *sb,int wait);void (*write_super_lockfs) (struct super_block *);void (*unlockfs) (struct super_block *); -int (*statfs) (struct super_block *,struct kstatfs *); +int (*statfs) (struct dentry *,struct kstatfs *);int (*remount_fs) (struct super_block *,int *,char *);void (*clear_inode) (struct inode *);void (*umount_begin) (struct super_block *);
@@ -1326,7 +1326,7 @@ extern struct vfsmount *copy_tree(structextern void mnt_set_mountpoint (struct vfsmount *,struct dentry *,struct vfsmount *); -extern int vfs_statfs (struct super_block *,struct kstatfs *); +extern int vfs_statfs (struct dentry *,struct kstatfs *);/* /sys/fs */ extern struct subsystem fs_subsys;
@@ -1747,7 +1747,7 @@ extern int dcache_dir_close(struct inodeextern loff_t dcache_dir_lseek (struct file *,loff_t ,int );extern int dcache_readdir (struct file *,void *,filldir_t );extern int simple_getattr (struct vfsmount *,struct dentry *,struct kstat *); -extern int simple_statfs (struct super_block *,struct kstatfs *); +extern int simple_statfs (struct dentry *,struct kstatfs *);extern int simple_link (struct dentry *,struct inode *,struct dentry *);extern int simple_unlink (struct inode *,struct dentry *);extern int simple_rmdir (struct inode *,struct dentry *);
include/linux/mount.h +5 -0
@@ -17,6 +17,11 @@ #include <linux/list.h>#include <linux/spinlock.h> #include <asm/atomic.h> +struct super_block ; +struct vfsmount ; +struct dentry ; +struct namespace ; +#define MNT_NOSUID 0x01#define MNT_NODEV 0x02#define MNT_NOEXEC 0x04
include/linux/security.h +7 -7
@@ -171,9 +171,9 @@ #ifdef CONFIG_SECURITY* Deallocate and clear the sb->s_security field. * @sb contains the super_block structure to be modified. * @sb_statfs: -* Check permission before obtaining filesystem statistics for the @sb -* filesystem. -* @sb contains the super_block structure for the filesystem. +* Check permission before obtaining filesystem statistics for the @mnt +* mountpoint. +* @dentry is a handle on the superblock for the filesystem. * Return 0 if permission is granted. * @sb_mount: * Check permission before an object specified by @dev_name is mounted on
@@ -1127,7 +1127,7 @@ struct security_operations {int (*sb_copy_data)(struct file_system_type *type,void *orig,void *copy);int (*sb_kern_mount) (struct super_block *sb,void *data); -int (*sb_statfs) (struct super_block * sb); +int (*sb_statfs) (struct dentry *dentry);int (*sb_mount) (char *dev_name,struct nameidata * nd,char *type,unsigned long flags,void *data);int (*sb_check_sb) (struct vfsmount * mnt,struct nameidata * nd);
@@ -1450,9 +1450,9 @@ static inline int security_sb_kern_mountreturn security_ops->sb_kern_mount (sb, data); } -static inline int security_sb_statfs (struct super_block *sb) +static inline int security_sb_statfs (struct dentry *dentry) { -return security_ops->sb_statfs (sb); +return security_ops->sb_statfs (dentry); } static inline int security_sb_mount (char *dev_name, struct nameidata *nd,
@@ -2162,7 +2162,7 @@ static inline int security_sb_kern_mountreturn 0 ; } -static inline int security_sb_statfs (struct super_block *sb) +static inline int security_sb_statfs (struct dentry *dentry) {return 0 ; }
kernel/acct.c +1 -1
@@ -118,7 +118,7 @@ static int check_free_space(struct filespin_unlock (&acct_globals.lock);/* May block */ -if (vfs_statfs (file->f_dentry->d_inode->i_sb, &sbuf)) +if (vfs_statfs (file->f_dentry, &sbuf))return res; suspend = sbuf.f_blocks *SUSPEND ; resume = sbuf.f_blocks *RESUME ;
mm/shmem.c +2 -2
@@ -1654,9 +1654,9 @@ static ssize_t shmem_file_sendfile(strucreturn desc.error; } -static int shmem_statfs (struct super_block *sb,struct kstatfs *buf) +static int shmem_statfs (struct dentry *dentry,struct kstatfs *buf) { -struct shmem_sb_info *sbinfo =SHMEM_SB (sb); +struct shmem_sb_info *sbinfo =SHMEM_SB (dentry->d_sb); buf->f_type =TMPFS_MAGIC ; buf->f_bsize =PAGE_CACHE_SIZE ;
security/dummy.c +1 -1
@@ -191,7 +191,7 @@ static int dummy_sb_kern_mount (struct sreturn 0 ; } -static int dummy_sb_statfs (struct super_block *sb) +static int dummy_sb_statfs (struct dentry *dentry) {return 0 ; }
security/selinux/hooks.c +3 -3
@@ -1903,13 +1903,13 @@ static int selinux_sb_kern_mount(structreturn superblock_has_perm (current, sb,FILESYSTEM__MOUNT , &ad); } -static int selinux_sb_statfs (struct super_block *sb) +static int selinux_sb_statfs (struct dentry *dentry) {struct avc_audit_data ad;AVC_AUDIT_DATA_INIT (&ad,FS ); - ad.u.fs.dentry = sb->s_root; -return superblock_has_perm (current, sb,FILESYSTEM__GETATTR , &ad); + ad.u.fs.dentry = dentry->d_sb->s_root; +return superblock_has_perm (current, dentry->d_sb,FILESYSTEM__GETATTR , &ad); } static int selinux_mount(char * dev_name,