aboutsummaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/open.c b/fs/open.c
index 4f178acd4c09..5fb16e5267dc 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -31,18 +31,18 @@
31 31
32#include <asm/unistd.h> 32#include <asm/unistd.h>
33 33
34int vfs_statfs(struct super_block *sb, struct kstatfs *buf) 34int vfs_statfs(struct dentry *dentry, struct kstatfs *buf)
35{ 35{
36 int retval = -ENODEV; 36 int retval = -ENODEV;
37 37
38 if (sb) { 38 if (dentry) {
39 retval = -ENOSYS; 39 retval = -ENOSYS;
40 if (sb->s_op->statfs) { 40 if (dentry->d_sb->s_op->statfs) {
41 memset(buf, 0, sizeof(*buf)); 41 memset(buf, 0, sizeof(*buf));
42 retval = security_sb_statfs(sb); 42 retval = security_sb_statfs(dentry);
43 if (retval) 43 if (retval)
44 return retval; 44 return retval;
45 retval = sb->s_op->statfs(sb, buf); 45 retval = dentry->d_sb->s_op->statfs(dentry, buf);
46 if (retval == 0 && buf->f_frsize == 0) 46 if (retval == 0 && buf->f_frsize == 0)
47 buf->f_frsize = buf->f_bsize; 47 buf->f_frsize = buf->f_bsize;
48 } 48 }
@@ -52,12 +52,12 @@ int vfs_statfs(struct super_block *sb, struct kstatfs *buf)
52 52
53EXPORT_SYMBOL(vfs_statfs); 53EXPORT_SYMBOL(vfs_statfs);
54 54
55static int vfs_statfs_native(struct super_block *sb, struct statfs *buf) 55static int vfs_statfs_native(struct dentry *dentry, struct statfs *buf)
56{ 56{
57 struct kstatfs st; 57 struct kstatfs st;
58 int retval; 58 int retval;
59 59
60 retval = vfs_statfs(sb, &st); 60 retval = vfs_statfs(dentry, &st);
61 if (retval) 61 if (retval)
62 return retval; 62 return retval;
63 63
@@ -95,12 +95,12 @@ static int vfs_statfs_native(struct super_block *sb, struct statfs *buf)
95 return 0; 95 return 0;
96} 96}
97 97
98static int vfs_statfs64(struct super_block *sb, struct statfs64 *buf) 98static int vfs_statfs64(struct dentry *dentry, struct statfs64 *buf)
99{ 99{
100 struct kstatfs st; 100 struct kstatfs st;
101 int retval; 101 int retval;
102 102
103 retval = vfs_statfs(sb, &st); 103 retval = vfs_statfs(dentry, &st);
104 if (retval) 104 if (retval)
105 return retval; 105 return retval;
106 106
@@ -130,7 +130,7 @@ asmlinkage long sys_statfs(const char __user * path, struct statfs __user * buf)
130 error = user_path_walk(path, &nd); 130 error = user_path_walk(path, &nd);
131 if (!error) { 131 if (!error) {
132 struct statfs tmp; 132 struct statfs tmp;
133 error = vfs_statfs_native(nd.dentry->d_inode->i_sb, &tmp); 133 error = vfs_statfs_native(nd.dentry, &tmp);
134 if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) 134 if (!error && copy_to_user(buf, &tmp, sizeof(tmp)))
135 error = -EFAULT; 135 error = -EFAULT;
136 path_release(&nd); 136 path_release(&nd);
@@ -149,7 +149,7 @@ asmlinkage long sys_statfs64(const char __user *path, size_t sz, struct statfs64
149 error = user_path_walk(path, &nd); 149 error = user_path_walk(path, &nd);
150 if (!error) { 150 if (!error) {
151 struct statfs64 tmp; 151 struct statfs64 tmp;
152 error = vfs_statfs64(nd.dentry->d_inode->i_sb, &tmp); 152 error = vfs_statfs64(nd.dentry, &tmp);
153 if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) 153 if (!error && copy_to_user(buf, &tmp, sizeof(tmp)))
154 error = -EFAULT; 154 error = -EFAULT;
155 path_release(&nd); 155 path_release(&nd);
@@ -168,7 +168,7 @@ asmlinkage long sys_fstatfs(unsigned int fd, struct statfs __user * buf)
168 file = fget(fd); 168 file = fget(fd);
169 if (!file) 169 if (!file)
170 goto out; 170 goto out;
171 error = vfs_statfs_native(file->f_dentry->d_inode->i_sb, &tmp); 171 error = vfs_statfs_native(file->f_dentry, &tmp);
172 if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) 172 if (!error && copy_to_user(buf, &tmp, sizeof(tmp)))
173 error = -EFAULT; 173 error = -EFAULT;
174 fput(file); 174 fput(file);
@@ -189,7 +189,7 @@ asmlinkage long sys_fstatfs64(unsigned int fd, size_t sz, struct statfs64 __user
189 file = fget(fd); 189 file = fget(fd);
190 if (!file) 190 if (!file)
191 goto out; 191 goto out;
192 error = vfs_statfs64(file->f_dentry->d_inode->i_sb, &tmp); 192 error = vfs_statfs64(file->f_dentry, &tmp);
193 if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) 193 if (!error && copy_to_user(buf, &tmp, sizeof(tmp)))
194 error = -EFAULT; 194 error = -EFAULT;
195 fput(file); 195 fput(file);
@@ -1152,7 +1152,7 @@ int filp_close(struct file *filp, fl_owner_t id)
1152 } 1152 }
1153 1153
1154 if (filp->f_op && filp->f_op->flush) 1154 if (filp->f_op && filp->f_op->flush)
1155 retval = filp->f_op->flush(filp); 1155 retval = filp->f_op->flush(filp, id);
1156 1156
1157 dnotify_flush(filp, id); 1157 dnotify_flush(filp, id);
1158 locks_remove_posix(filp, id); 1158 locks_remove_posix(filp, id);