diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-01-23 17:07:38 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-22 23:31:31 -0500 |
commit | 496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch) | |
tree | 8f4abde793cd7db5bb8fde6d27ebcacd0e54379a /fs/pipe.c | |
parent | 57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff) |
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/pipe.c')
-rw-r--r-- | fs/pipe.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -361,7 +361,7 @@ pipe_read(struct kiocb *iocb, const struct iovec *_iov, | |||
361 | unsigned long nr_segs, loff_t pos) | 361 | unsigned long nr_segs, loff_t pos) |
362 | { | 362 | { |
363 | struct file *filp = iocb->ki_filp; | 363 | struct file *filp = iocb->ki_filp; |
364 | struct inode *inode = filp->f_path.dentry->d_inode; | 364 | struct inode *inode = file_inode(filp); |
365 | struct pipe_inode_info *pipe; | 365 | struct pipe_inode_info *pipe; |
366 | int do_wakeup; | 366 | int do_wakeup; |
367 | ssize_t ret; | 367 | ssize_t ret; |
@@ -486,7 +486,7 @@ pipe_write(struct kiocb *iocb, const struct iovec *_iov, | |||
486 | unsigned long nr_segs, loff_t ppos) | 486 | unsigned long nr_segs, loff_t ppos) |
487 | { | 487 | { |
488 | struct file *filp = iocb->ki_filp; | 488 | struct file *filp = iocb->ki_filp; |
489 | struct inode *inode = filp->f_path.dentry->d_inode; | 489 | struct inode *inode = file_inode(filp); |
490 | struct pipe_inode_info *pipe; | 490 | struct pipe_inode_info *pipe; |
491 | ssize_t ret; | 491 | ssize_t ret; |
492 | int do_wakeup; | 492 | int do_wakeup; |
@@ -677,7 +677,7 @@ bad_pipe_w(struct file *filp, const char __user *buf, size_t count, | |||
677 | 677 | ||
678 | static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 678 | static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
679 | { | 679 | { |
680 | struct inode *inode = filp->f_path.dentry->d_inode; | 680 | struct inode *inode = file_inode(filp); |
681 | struct pipe_inode_info *pipe; | 681 | struct pipe_inode_info *pipe; |
682 | int count, buf, nrbufs; | 682 | int count, buf, nrbufs; |
683 | 683 | ||
@@ -705,7 +705,7 @@ static unsigned int | |||
705 | pipe_poll(struct file *filp, poll_table *wait) | 705 | pipe_poll(struct file *filp, poll_table *wait) |
706 | { | 706 | { |
707 | unsigned int mask; | 707 | unsigned int mask; |
708 | struct inode *inode = filp->f_path.dentry->d_inode; | 708 | struct inode *inode = file_inode(filp); |
709 | struct pipe_inode_info *pipe = inode->i_pipe; | 709 | struct pipe_inode_info *pipe = inode->i_pipe; |
710 | int nrbufs; | 710 | int nrbufs; |
711 | 711 | ||
@@ -758,7 +758,7 @@ pipe_release(struct inode *inode, int decr, int decw) | |||
758 | static int | 758 | static int |
759 | pipe_read_fasync(int fd, struct file *filp, int on) | 759 | pipe_read_fasync(int fd, struct file *filp, int on) |
760 | { | 760 | { |
761 | struct inode *inode = filp->f_path.dentry->d_inode; | 761 | struct inode *inode = file_inode(filp); |
762 | int retval; | 762 | int retval; |
763 | 763 | ||
764 | mutex_lock(&inode->i_mutex); | 764 | mutex_lock(&inode->i_mutex); |
@@ -772,7 +772,7 @@ pipe_read_fasync(int fd, struct file *filp, int on) | |||
772 | static int | 772 | static int |
773 | pipe_write_fasync(int fd, struct file *filp, int on) | 773 | pipe_write_fasync(int fd, struct file *filp, int on) |
774 | { | 774 | { |
775 | struct inode *inode = filp->f_path.dentry->d_inode; | 775 | struct inode *inode = file_inode(filp); |
776 | int retval; | 776 | int retval; |
777 | 777 | ||
778 | mutex_lock(&inode->i_mutex); | 778 | mutex_lock(&inode->i_mutex); |
@@ -786,7 +786,7 @@ pipe_write_fasync(int fd, struct file *filp, int on) | |||
786 | static int | 786 | static int |
787 | pipe_rdwr_fasync(int fd, struct file *filp, int on) | 787 | pipe_rdwr_fasync(int fd, struct file *filp, int on) |
788 | { | 788 | { |
789 | struct inode *inode = filp->f_path.dentry->d_inode; | 789 | struct inode *inode = file_inode(filp); |
790 | struct pipe_inode_info *pipe = inode->i_pipe; | 790 | struct pipe_inode_info *pipe = inode->i_pipe; |
791 | int retval; | 791 | int retval; |
792 | 792 | ||
@@ -1226,7 +1226,7 @@ int pipe_proc_fn(struct ctl_table *table, int write, void __user *buf, | |||
1226 | */ | 1226 | */ |
1227 | struct pipe_inode_info *get_pipe_info(struct file *file) | 1227 | struct pipe_inode_info *get_pipe_info(struct file *file) |
1228 | { | 1228 | { |
1229 | struct inode *i = file->f_path.dentry->d_inode; | 1229 | struct inode *i = file_inode(file); |
1230 | 1230 | ||
1231 | return S_ISFIFO(i->i_mode) ? i->i_pipe : NULL; | 1231 | return S_ISFIFO(i->i_mode) ? i->i_pipe : NULL; |
1232 | } | 1232 | } |