diff options
author | Josef "Jeff" Sipek <jsipek@cs.sunysb.edu> | 2006-12-08 05:36:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 11:28:41 -0500 |
commit | 0f7fc9e4d03987fe29f6dd4aa67e4c56eb7ecb05 (patch) | |
tree | 51763269e44eb9bf4d0f8c529577489902850cf9 /fs/read_write.c | |
parent | b65d34fd465f19fbe2f32f2205a9a06ca7c2bdeb (diff) |
[PATCH] VFS: change struct file to use struct path
This patch changes struct file to use struct path instead of having
independent pointers to struct dentry and struct vfsmount, and converts all
users of f_{dentry,vfsmnt} in fs/ to use f_path.{dentry,mnt}.
Additionally, it adds two #define's to make the transition easier for users of
the f_dentry and f_vfsmnt.
Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/read_write.c')
-rw-r--r-- | fs/read_write.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/read_write.c b/fs/read_write.c index f792000a28e6..1d3dda4fa70c 100644 --- a/fs/read_write.c +++ b/fs/read_write.c | |||
@@ -64,13 +64,13 @@ loff_t remote_llseek(struct file *file, loff_t offset, int origin) | |||
64 | lock_kernel(); | 64 | lock_kernel(); |
65 | switch (origin) { | 65 | switch (origin) { |
66 | case 2: | 66 | case 2: |
67 | offset += i_size_read(file->f_dentry->d_inode); | 67 | offset += i_size_read(file->f_path.dentry->d_inode); |
68 | break; | 68 | break; |
69 | case 1: | 69 | case 1: |
70 | offset += file->f_pos; | 70 | offset += file->f_pos; |
71 | } | 71 | } |
72 | retval = -EINVAL; | 72 | retval = -EINVAL; |
73 | if (offset>=0 && offset<=file->f_dentry->d_inode->i_sb->s_maxbytes) { | 73 | if (offset>=0 && offset<=file->f_path.dentry->d_inode->i_sb->s_maxbytes) { |
74 | if (offset != file->f_pos) { | 74 | if (offset != file->f_pos) { |
75 | file->f_pos = offset; | 75 | file->f_pos = offset; |
76 | file->f_version = 0; | 76 | file->f_version = 0; |
@@ -95,7 +95,7 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin) | |||
95 | lock_kernel(); | 95 | lock_kernel(); |
96 | switch (origin) { | 96 | switch (origin) { |
97 | case 2: | 97 | case 2: |
98 | offset += i_size_read(file->f_dentry->d_inode); | 98 | offset += i_size_read(file->f_path.dentry->d_inode); |
99 | break; | 99 | break; |
100 | case 1: | 100 | case 1: |
101 | offset += file->f_pos; | 101 | offset += file->f_pos; |
@@ -203,7 +203,7 @@ int rw_verify_area(int read_write, struct file *file, loff_t *ppos, size_t count | |||
203 | if (unlikely((pos < 0) || (loff_t) (pos + count) < 0)) | 203 | if (unlikely((pos < 0) || (loff_t) (pos + count) < 0)) |
204 | goto Einval; | 204 | goto Einval; |
205 | 205 | ||
206 | inode = file->f_dentry->d_inode; | 206 | inode = file->f_path.dentry->d_inode; |
207 | if (unlikely(inode->i_flock && MANDATORY_LOCK(inode))) { | 207 | if (unlikely(inode->i_flock && MANDATORY_LOCK(inode))) { |
208 | int retval = locks_mandatory_area( | 208 | int retval = locks_mandatory_area( |
209 | read_write == READ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE, | 209 | read_write == READ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE, |
@@ -273,7 +273,7 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) | |||
273 | else | 273 | else |
274 | ret = do_sync_read(file, buf, count, pos); | 274 | ret = do_sync_read(file, buf, count, pos); |
275 | if (ret > 0) { | 275 | if (ret > 0) { |
276 | fsnotify_access(file->f_dentry); | 276 | fsnotify_access(file->f_path.dentry); |
277 | current->rchar += ret; | 277 | current->rchar += ret; |
278 | } | 278 | } |
279 | current->syscr++; | 279 | current->syscr++; |
@@ -331,7 +331,7 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_ | |||
331 | else | 331 | else |
332 | ret = do_sync_write(file, buf, count, pos); | 332 | ret = do_sync_write(file, buf, count, pos); |
333 | if (ret > 0) { | 333 | if (ret > 0) { |
334 | fsnotify_modify(file->f_dentry); | 334 | fsnotify_modify(file->f_path.dentry); |
335 | current->wchar += ret; | 335 | current->wchar += ret; |
336 | } | 336 | } |
337 | current->syscw++; | 337 | current->syscw++; |
@@ -628,9 +628,9 @@ out: | |||
628 | kfree(iov); | 628 | kfree(iov); |
629 | if ((ret + (type == READ)) > 0) { | 629 | if ((ret + (type == READ)) > 0) { |
630 | if (type == READ) | 630 | if (type == READ) |
631 | fsnotify_access(file->f_dentry); | 631 | fsnotify_access(file->f_path.dentry); |
632 | else | 632 | else |
633 | fsnotify_modify(file->f_dentry); | 633 | fsnotify_modify(file->f_path.dentry); |
634 | } | 634 | } |
635 | return ret; | 635 | return ret; |
636 | } | 636 | } |
@@ -722,7 +722,7 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, | |||
722 | if (!(in_file->f_mode & FMODE_READ)) | 722 | if (!(in_file->f_mode & FMODE_READ)) |
723 | goto fput_in; | 723 | goto fput_in; |
724 | retval = -EINVAL; | 724 | retval = -EINVAL; |
725 | in_inode = in_file->f_dentry->d_inode; | 725 | in_inode = in_file->f_path.dentry->d_inode; |
726 | if (!in_inode) | 726 | if (!in_inode) |
727 | goto fput_in; | 727 | goto fput_in; |
728 | if (!in_file->f_op || !in_file->f_op->sendfile) | 728 | if (!in_file->f_op || !in_file->f_op->sendfile) |
@@ -754,7 +754,7 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, | |||
754 | retval = -EINVAL; | 754 | retval = -EINVAL; |
755 | if (!out_file->f_op || !out_file->f_op->sendpage) | 755 | if (!out_file->f_op || !out_file->f_op->sendpage) |
756 | goto fput_out; | 756 | goto fput_out; |
757 | out_inode = out_file->f_dentry->d_inode; | 757 | out_inode = out_file->f_path.dentry->d_inode; |
758 | retval = rw_verify_area(WRITE, out_file, &out_file->f_pos, count); | 758 | retval = rw_verify_area(WRITE, out_file, &out_file->f_pos, count); |
759 | if (retval < 0) | 759 | if (retval < 0) |
760 | goto fput_out; | 760 | goto fput_out; |