diff options
Diffstat (limited to 'fs/statfs.c')
-rw-r--r-- | fs/statfs.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/fs/statfs.c b/fs/statfs.c index 9cf04a118965..2aa6a22e0be2 100644 --- a/fs/statfs.c +++ b/fs/statfs.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/statfs.h> | 7 | #include <linux/statfs.h> |
8 | #include <linux/security.h> | 8 | #include <linux/security.h> |
9 | #include <linux/uaccess.h> | 9 | #include <linux/uaccess.h> |
10 | #include "internal.h" | ||
10 | 11 | ||
11 | static int flags_by_mnt(int mnt_flags) | 12 | static int flags_by_mnt(int mnt_flags) |
12 | { | 13 | { |
@@ -45,7 +46,7 @@ static int calculate_f_flags(struct vfsmount *mnt) | |||
45 | flags_by_sb(mnt->mnt_sb->s_flags); | 46 | flags_by_sb(mnt->mnt_sb->s_flags); |
46 | } | 47 | } |
47 | 48 | ||
48 | int statfs_by_dentry(struct dentry *dentry, struct kstatfs *buf) | 49 | static int statfs_by_dentry(struct dentry *dentry, struct kstatfs *buf) |
49 | { | 50 | { |
50 | int retval; | 51 | int retval; |
51 | 52 | ||
@@ -205,19 +206,23 @@ SYSCALL_DEFINE3(fstatfs64, unsigned int, fd, size_t, sz, struct statfs64 __user | |||
205 | return error; | 206 | return error; |
206 | } | 207 | } |
207 | 208 | ||
208 | SYSCALL_DEFINE2(ustat, unsigned, dev, struct ustat __user *, ubuf) | 209 | int vfs_ustat(dev_t dev, struct kstatfs *sbuf) |
209 | { | 210 | { |
210 | struct super_block *s; | 211 | struct super_block *s = user_get_super(dev); |
211 | struct ustat tmp; | ||
212 | struct kstatfs sbuf; | ||
213 | int err; | 212 | int err; |
214 | |||
215 | s = user_get_super(new_decode_dev(dev)); | ||
216 | if (!s) | 213 | if (!s) |
217 | return -EINVAL; | 214 | return -EINVAL; |
218 | 215 | ||
219 | err = statfs_by_dentry(s->s_root, &sbuf); | 216 | err = statfs_by_dentry(s->s_root, sbuf); |
220 | drop_super(s); | 217 | drop_super(s); |
218 | return err; | ||
219 | } | ||
220 | |||
221 | SYSCALL_DEFINE2(ustat, unsigned, dev, struct ustat __user *, ubuf) | ||
222 | { | ||
223 | struct ustat tmp; | ||
224 | struct kstatfs sbuf; | ||
225 | int err = vfs_ustat(new_decode_dev(dev), &sbuf); | ||
221 | if (err) | 226 | if (err) |
222 | return err; | 227 | return err; |
223 | 228 | ||