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 /include/linux | |
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 'include/linux')
-rw-r--r-- | include/linux/fs.h | 10 | ||||
-rw-r--r-- | include/linux/fsnotify.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 45f2cabb8c75..adce6e1d70c2 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -269,6 +269,7 @@ extern int dir_notify_enable; | |||
269 | #include <linux/types.h> | 269 | #include <linux/types.h> |
270 | #include <linux/kdev_t.h> | 270 | #include <linux/kdev_t.h> |
271 | #include <linux/dcache.h> | 271 | #include <linux/dcache.h> |
272 | #include <linux/namei.h> | ||
272 | #include <linux/stat.h> | 273 | #include <linux/stat.h> |
273 | #include <linux/cache.h> | 274 | #include <linux/cache.h> |
274 | #include <linux/kobject.h> | 275 | #include <linux/kobject.h> |
@@ -711,8 +712,9 @@ struct file { | |||
711 | struct list_head fu_list; | 712 | struct list_head fu_list; |
712 | struct rcu_head fu_rcuhead; | 713 | struct rcu_head fu_rcuhead; |
713 | } f_u; | 714 | } f_u; |
714 | struct dentry *f_dentry; | 715 | struct path f_path; |
715 | struct vfsmount *f_vfsmnt; | 716 | #define f_dentry f_path.dentry |
717 | #define f_vfsmnt f_path.mnt | ||
716 | const struct file_operations *f_op; | 718 | const struct file_operations *f_op; |
717 | atomic_t f_count; | 719 | atomic_t f_count; |
718 | unsigned int f_flags; | 720 | unsigned int f_flags; |
@@ -1224,7 +1226,7 @@ extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry); | |||
1224 | static inline void file_accessed(struct file *file) | 1226 | static inline void file_accessed(struct file *file) |
1225 | { | 1227 | { |
1226 | if (!(file->f_flags & O_NOATIME)) | 1228 | if (!(file->f_flags & O_NOATIME)) |
1227 | touch_atime(file->f_vfsmnt, file->f_dentry); | 1229 | touch_atime(file->f_path.mnt, file->f_path.dentry); |
1228 | } | 1230 | } |
1229 | 1231 | ||
1230 | int sync_inode(struct inode *inode, struct writeback_control *wbc); | 1232 | int sync_inode(struct inode *inode, struct writeback_control *wbc); |
@@ -1615,7 +1617,7 @@ static inline void put_write_access(struct inode * inode) | |||
1615 | static inline void allow_write_access(struct file *file) | 1617 | static inline void allow_write_access(struct file *file) |
1616 | { | 1618 | { |
1617 | if (file) | 1619 | if (file) |
1618 | atomic_inc(&file->f_dentry->d_inode->i_writecount); | 1620 | atomic_inc(&file->f_path.dentry->d_inode->i_writecount); |
1619 | } | 1621 | } |
1620 | extern int do_pipe(int *); | 1622 | extern int do_pipe(int *); |
1621 | extern struct file *create_read_pipe(struct file *f); | 1623 | extern struct file *create_read_pipe(struct file *f); |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index d4f219ffaa5d..dfc4e4f68da4 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -164,7 +164,7 @@ static inline void fsnotify_open(struct dentry *dentry) | |||
164 | */ | 164 | */ |
165 | static inline void fsnotify_close(struct file *file) | 165 | static inline void fsnotify_close(struct file *file) |
166 | { | 166 | { |
167 | struct dentry *dentry = file->f_dentry; | 167 | struct dentry *dentry = file->f_path.dentry; |
168 | struct inode *inode = dentry->d_inode; | 168 | struct inode *inode = dentry->d_inode; |
169 | const char *name = dentry->d_name.name; | 169 | const char *name = dentry->d_name.name; |
170 | mode_t mode = file->f_mode; | 170 | mode_t mode = file->f_mode; |