aboutsummaryrefslogtreecommitdiffstats
path: root/fs/pipe.c
diff options
context:
space:
mode:
authorJosef "Jeff" Sipek <jsipek@cs.sunysb.edu>2006-12-08 05:36:35 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:28:41 -0500
commit0f7fc9e4d03987fe29f6dd4aa67e4c56eb7ecb05 (patch)
tree51763269e44eb9bf4d0f8c529577489902850cf9 /fs/pipe.c
parentb65d34fd465f19fbe2f32f2205a9a06ca7c2bdeb (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/pipe.c')
-rw-r--r--fs/pipe.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/pipe.c b/fs/pipe.c
index ae36b89b1a37..f8b6bdcb879a 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -222,7 +222,7 @@ pipe_read(struct kiocb *iocb, const struct iovec *_iov,
222 unsigned long nr_segs, loff_t pos) 222 unsigned long nr_segs, loff_t pos)
223{ 223{
224 struct file *filp = iocb->ki_filp; 224 struct file *filp = iocb->ki_filp;
225 struct inode *inode = filp->f_dentry->d_inode; 225 struct inode *inode = filp->f_path.dentry->d_inode;
226 struct pipe_inode_info *pipe; 226 struct pipe_inode_info *pipe;
227 int do_wakeup; 227 int do_wakeup;
228 ssize_t ret; 228 ssize_t ret;
@@ -335,7 +335,7 @@ pipe_write(struct kiocb *iocb, const struct iovec *_iov,
335 unsigned long nr_segs, loff_t ppos) 335 unsigned long nr_segs, loff_t ppos)
336{ 336{
337 struct file *filp = iocb->ki_filp; 337 struct file *filp = iocb->ki_filp;
338 struct inode *inode = filp->f_dentry->d_inode; 338 struct inode *inode = filp->f_path.dentry->d_inode;
339 struct pipe_inode_info *pipe; 339 struct pipe_inode_info *pipe;
340 ssize_t ret; 340 ssize_t ret;
341 int do_wakeup; 341 int do_wakeup;
@@ -520,7 +520,7 @@ static int
520pipe_ioctl(struct inode *pino, struct file *filp, 520pipe_ioctl(struct inode *pino, struct file *filp,
521 unsigned int cmd, unsigned long arg) 521 unsigned int cmd, unsigned long arg)
522{ 522{
523 struct inode *inode = filp->f_dentry->d_inode; 523 struct inode *inode = filp->f_path.dentry->d_inode;
524 struct pipe_inode_info *pipe; 524 struct pipe_inode_info *pipe;
525 int count, buf, nrbufs; 525 int count, buf, nrbufs;
526 526
@@ -548,7 +548,7 @@ static unsigned int
548pipe_poll(struct file *filp, poll_table *wait) 548pipe_poll(struct file *filp, poll_table *wait)
549{ 549{
550 unsigned int mask; 550 unsigned int mask;
551 struct inode *inode = filp->f_dentry->d_inode; 551 struct inode *inode = filp->f_path.dentry->d_inode;
552 struct pipe_inode_info *pipe = inode->i_pipe; 552 struct pipe_inode_info *pipe = inode->i_pipe;
553 int nrbufs; 553 int nrbufs;
554 554
@@ -601,7 +601,7 @@ pipe_release(struct inode *inode, int decr, int decw)
601static int 601static int
602pipe_read_fasync(int fd, struct file *filp, int on) 602pipe_read_fasync(int fd, struct file *filp, int on)
603{ 603{
604 struct inode *inode = filp->f_dentry->d_inode; 604 struct inode *inode = filp->f_path.dentry->d_inode;
605 int retval; 605 int retval;
606 606
607 mutex_lock(&inode->i_mutex); 607 mutex_lock(&inode->i_mutex);
@@ -618,7 +618,7 @@ pipe_read_fasync(int fd, struct file *filp, int on)
618static int 618static int
619pipe_write_fasync(int fd, struct file *filp, int on) 619pipe_write_fasync(int fd, struct file *filp, int on)
620{ 620{
621 struct inode *inode = filp->f_dentry->d_inode; 621 struct inode *inode = filp->f_path.dentry->d_inode;
622 int retval; 622 int retval;
623 623
624 mutex_lock(&inode->i_mutex); 624 mutex_lock(&inode->i_mutex);
@@ -635,7 +635,7 @@ pipe_write_fasync(int fd, struct file *filp, int on)
635static int 635static int
636pipe_rdwr_fasync(int fd, struct file *filp, int on) 636pipe_rdwr_fasync(int fd, struct file *filp, int on)
637{ 637{
638 struct inode *inode = filp->f_dentry->d_inode; 638 struct inode *inode = filp->f_path.dentry->d_inode;
639 struct pipe_inode_info *pipe = inode->i_pipe; 639 struct pipe_inode_info *pipe = inode->i_pipe;
640 int retval; 640 int retval;
641 641
@@ -914,8 +914,8 @@ struct file *create_write_pipe(void)
914 */ 914 */
915 dentry->d_flags &= ~DCACHE_UNHASHED; 915 dentry->d_flags &= ~DCACHE_UNHASHED;
916 d_instantiate(dentry, inode); 916 d_instantiate(dentry, inode);
917 f->f_vfsmnt = mntget(pipe_mnt); 917 f->f_path.mnt = mntget(pipe_mnt);
918 f->f_dentry = dentry; 918 f->f_path.dentry = dentry;
919 f->f_mapping = inode->i_mapping; 919 f->f_mapping = inode->i_mapping;
920 920
921 f->f_flags = O_WRONLY; 921 f->f_flags = O_WRONLY;
@@ -935,8 +935,8 @@ struct file *create_write_pipe(void)
935 935
936void free_write_pipe(struct file *f) 936void free_write_pipe(struct file *f)
937{ 937{
938 mntput(f->f_vfsmnt); 938 mntput(f->f_path.mnt);
939 dput(f->f_dentry); 939 dput(f->f_path.dentry);
940 put_filp(f); 940 put_filp(f);
941} 941}
942 942
@@ -947,9 +947,9 @@ struct file *create_read_pipe(struct file *wrf)
947 return ERR_PTR(-ENFILE); 947 return ERR_PTR(-ENFILE);
948 948
949 /* Grab pipe from the writer */ 949 /* Grab pipe from the writer */
950 f->f_vfsmnt = mntget(wrf->f_vfsmnt); 950 f->f_path.mnt = mntget(wrf->f_path.mnt);
951 f->f_dentry = dget(wrf->f_dentry); 951 f->f_path.dentry = dget(wrf->f_path.dentry);
952 f->f_mapping = wrf->f_dentry->d_inode->i_mapping; 952 f->f_mapping = wrf->f_path.dentry->d_inode->i_mapping;
953 953
954 f->f_pos = 0; 954 f->f_pos = 0;
955 f->f_flags = O_RDONLY; 955 f->f_flags = O_RDONLY;