aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-06-23 05:02:58 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-23 10:42:45 -0400
commit726c334223180e3c0197cc980a432681370d4baf (patch)
tree8327b354bb3dc959a6606051ae6f8d4d035e38a2 /include
parent454e2398be9b9fa30433fccc548db34d19aa9958 (diff)
[PATCH] VFS: Permit filesystem to perform statfs with a known root dentry
Give 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. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Al Viro <viro@zeniv.linux.org.uk> Cc: Nathan Scott <nathans@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/coda_psdev.h2
-rw-r--r--include/linux/fs.h6
-rw-r--r--include/linux/mount.h5
-rw-r--r--include/linux/security.h14
4 files changed, 16 insertions, 11 deletions
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index d539262a8f89..98f6c52c152b 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -70,7 +70,7 @@ int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
70 unsigned int cmd, struct PioctlData *data); 70 unsigned int cmd, struct PioctlData *data);
71int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb); 71int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb);
72int venus_fsync(struct super_block *sb, struct CodaFid *fid); 72int venus_fsync(struct super_block *sb, struct CodaFid *fid);
73int venus_statfs(struct super_block *sb, struct kstatfs *sfs); 73int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
74 74
75 75
76/* messages between coda filesystem in kernel and Venus */ 76/* messages between coda filesystem in kernel and Venus */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 3e50dd24af87..c823a3815e24 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1096,7 +1096,7 @@ struct super_operations {
1096 int (*sync_fs)(struct super_block *sb, int wait); 1096 int (*sync_fs)(struct super_block *sb, int wait);
1097 void (*write_super_lockfs) (struct super_block *); 1097 void (*write_super_lockfs) (struct super_block *);
1098 void (*unlockfs) (struct super_block *); 1098 void (*unlockfs) (struct super_block *);
1099 int (*statfs) (struct super_block *, struct kstatfs *); 1099 int (*statfs) (struct dentry *, struct kstatfs *);
1100 int (*remount_fs) (struct super_block *, int *, char *); 1100 int (*remount_fs) (struct super_block *, int *, char *);
1101 void (*clear_inode) (struct inode *); 1101 void (*clear_inode) (struct inode *);
1102 void (*umount_begin) (struct super_block *); 1102 void (*umount_begin) (struct super_block *);
@@ -1325,7 +1325,7 @@ extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int);
1325extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, 1325extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
1326 struct vfsmount *); 1326 struct vfsmount *);
1327 1327
1328extern int vfs_statfs(struct super_block *, struct kstatfs *); 1328extern int vfs_statfs(struct dentry *, struct kstatfs *);
1329 1329
1330/* /sys/fs */ 1330/* /sys/fs */
1331extern struct subsystem fs_subsys; 1331extern struct subsystem fs_subsys;
@@ -1746,7 +1746,7 @@ extern int dcache_dir_close(struct inode *, struct file *);
1746extern loff_t dcache_dir_lseek(struct file *, loff_t, int); 1746extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
1747extern int dcache_readdir(struct file *, void *, filldir_t); 1747extern int dcache_readdir(struct file *, void *, filldir_t);
1748extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); 1748extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *);
1749extern int simple_statfs(struct super_block *, struct kstatfs *); 1749extern int simple_statfs(struct dentry *, struct kstatfs *);
1750extern int simple_link(struct dentry *, struct inode *, struct dentry *); 1750extern int simple_link(struct dentry *, struct inode *, struct dentry *);
1751extern int simple_unlink(struct inode *, struct dentry *); 1751extern int simple_unlink(struct inode *, struct dentry *);
1752extern int simple_rmdir(struct inode *, struct dentry *); 1752extern int simple_rmdir(struct inode *, struct dentry *);
diff --git a/include/linux/mount.h b/include/linux/mount.h
index b7472ae91fa4..60718f12caa9 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -17,6 +17,11 @@
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <asm/atomic.h> 18#include <asm/atomic.h>
19 19
20struct super_block;
21struct vfsmount;
22struct dentry;
23struct namespace;
24
20#define MNT_NOSUID 0x01 25#define MNT_NOSUID 0x01
21#define MNT_NODEV 0x02 26#define MNT_NODEV 0x02
22#define MNT_NOEXEC 0x04 27#define MNT_NOEXEC 0x04
diff --git a/include/linux/security.h b/include/linux/security.h
index 47722d355532..383c320fc834 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -171,9 +171,9 @@ struct swap_info_struct;
171 * Deallocate and clear the sb->s_security field. 171 * Deallocate and clear the sb->s_security field.
172 * @sb contains the super_block structure to be modified. 172 * @sb contains the super_block structure to be modified.
173 * @sb_statfs: 173 * @sb_statfs:
174 * Check permission before obtaining filesystem statistics for the @sb 174 * Check permission before obtaining filesystem statistics for the @mnt
175 * filesystem. 175 * mountpoint.
176 * @sb contains the super_block structure for the filesystem. 176 * @dentry is a handle on the superblock for the filesystem.
177 * Return 0 if permission is granted. 177 * Return 0 if permission is granted.
178 * @sb_mount: 178 * @sb_mount:
179 * Check permission before an object specified by @dev_name is mounted on 179 * Check permission before an object specified by @dev_name is mounted on
@@ -1127,7 +1127,7 @@ struct security_operations {
1127 int (*sb_copy_data)(struct file_system_type *type, 1127 int (*sb_copy_data)(struct file_system_type *type,
1128 void *orig, void *copy); 1128 void *orig, void *copy);
1129 int (*sb_kern_mount) (struct super_block *sb, void *data); 1129 int (*sb_kern_mount) (struct super_block *sb, void *data);
1130 int (*sb_statfs) (struct super_block * sb); 1130 int (*sb_statfs) (struct dentry *dentry);
1131 int (*sb_mount) (char *dev_name, struct nameidata * nd, 1131 int (*sb_mount) (char *dev_name, struct nameidata * nd,
1132 char *type, unsigned long flags, void *data); 1132 char *type, unsigned long flags, void *data);
1133 int (*sb_check_sb) (struct vfsmount * mnt, struct nameidata * nd); 1133 int (*sb_check_sb) (struct vfsmount * mnt, struct nameidata * nd);
@@ -1450,9 +1450,9 @@ static inline int security_sb_kern_mount (struct super_block *sb, void *data)
1450 return security_ops->sb_kern_mount (sb, data); 1450 return security_ops->sb_kern_mount (sb, data);
1451} 1451}
1452 1452
1453static inline int security_sb_statfs (struct super_block *sb) 1453static inline int security_sb_statfs (struct dentry *dentry)
1454{ 1454{
1455 return security_ops->sb_statfs (sb); 1455 return security_ops->sb_statfs (dentry);
1456} 1456}
1457 1457
1458static inline int security_sb_mount (char *dev_name, struct nameidata *nd, 1458static inline int security_sb_mount (char *dev_name, struct nameidata *nd,
@@ -2162,7 +2162,7 @@ static inline int security_sb_kern_mount (struct super_block *sb, void *data)
2162 return 0; 2162 return 0;
2163} 2163}
2164 2164
2165static inline int security_sb_statfs (struct super_block *sb) 2165static inline int security_sb_statfs (struct dentry *dentry)
2166{ 2166{
2167 return 0; 2167 return 0;
2168} 2168}