aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fuse/file.c')
-rw-r--r--fs/fuse/file.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index c8071768b950..34b80ba95bad 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -355,7 +355,7 @@ static int fuse_wait_on_page_writeback(struct inode *inode, pgoff_t index)
355 355
356static int fuse_flush(struct file *file, fl_owner_t id) 356static int fuse_flush(struct file *file, fl_owner_t id)
357{ 357{
358 struct inode *inode = file->f_path.dentry->d_inode; 358 struct inode *inode = file_inode(file);
359 struct fuse_conn *fc = get_fuse_conn(inode); 359 struct fuse_conn *fc = get_fuse_conn(inode);
360 struct fuse_file *ff = file->private_data; 360 struct fuse_file *ff = file->private_data;
361 struct fuse_req *req; 361 struct fuse_req *req;
@@ -1215,7 +1215,7 @@ static ssize_t __fuse_direct_read(struct file *file, const struct iovec *iov,
1215 unsigned long nr_segs, loff_t *ppos) 1215 unsigned long nr_segs, loff_t *ppos)
1216{ 1216{
1217 ssize_t res; 1217 ssize_t res;
1218 struct inode *inode = file->f_path.dentry->d_inode; 1218 struct inode *inode = file_inode(file);
1219 1219
1220 if (is_bad_inode(inode)) 1220 if (is_bad_inode(inode))
1221 return -EIO; 1221 return -EIO;
@@ -1238,7 +1238,7 @@ static ssize_t fuse_direct_read(struct file *file, char __user *buf,
1238static ssize_t __fuse_direct_write(struct file *file, const struct iovec *iov, 1238static ssize_t __fuse_direct_write(struct file *file, const struct iovec *iov,
1239 unsigned long nr_segs, loff_t *ppos) 1239 unsigned long nr_segs, loff_t *ppos)
1240{ 1240{
1241 struct inode *inode = file->f_path.dentry->d_inode; 1241 struct inode *inode = file_inode(file);
1242 size_t count = iov_length(iov, nr_segs); 1242 size_t count = iov_length(iov, nr_segs);
1243 ssize_t res; 1243 ssize_t res;
1244 1244
@@ -1258,7 +1258,7 @@ static ssize_t fuse_direct_write(struct file *file, const char __user *buf,
1258 size_t count, loff_t *ppos) 1258 size_t count, loff_t *ppos)
1259{ 1259{
1260 struct iovec iov = { .iov_base = (void __user *)buf, .iov_len = count }; 1260 struct iovec iov = { .iov_base = (void __user *)buf, .iov_len = count };
1261 struct inode *inode = file->f_path.dentry->d_inode; 1261 struct inode *inode = file_inode(file);
1262 ssize_t res; 1262 ssize_t res;
1263 1263
1264 if (is_bad_inode(inode)) 1264 if (is_bad_inode(inode))
@@ -1485,7 +1485,7 @@ static const struct vm_operations_struct fuse_file_vm_ops = {
1485static int fuse_file_mmap(struct file *file, struct vm_area_struct *vma) 1485static int fuse_file_mmap(struct file *file, struct vm_area_struct *vma)
1486{ 1486{
1487 if ((vma->vm_flags & VM_SHARED) && (vma->vm_flags & VM_MAYWRITE)) { 1487 if ((vma->vm_flags & VM_SHARED) && (vma->vm_flags & VM_MAYWRITE)) {
1488 struct inode *inode = file->f_dentry->d_inode; 1488 struct inode *inode = file_inode(file);
1489 struct fuse_conn *fc = get_fuse_conn(inode); 1489 struct fuse_conn *fc = get_fuse_conn(inode);
1490 struct fuse_inode *fi = get_fuse_inode(inode); 1490 struct fuse_inode *fi = get_fuse_inode(inode);
1491 struct fuse_file *ff = file->private_data; 1491 struct fuse_file *ff = file->private_data;
@@ -1543,7 +1543,7 @@ static void fuse_lk_fill(struct fuse_req *req, struct file *file,
1543 const struct file_lock *fl, int opcode, pid_t pid, 1543 const struct file_lock *fl, int opcode, pid_t pid,
1544 int flock) 1544 int flock)
1545{ 1545{
1546 struct inode *inode = file->f_path.dentry->d_inode; 1546 struct inode *inode = file_inode(file);
1547 struct fuse_conn *fc = get_fuse_conn(inode); 1547 struct fuse_conn *fc = get_fuse_conn(inode);
1548 struct fuse_file *ff = file->private_data; 1548 struct fuse_file *ff = file->private_data;
1549 struct fuse_lk_in *arg = &req->misc.lk_in; 1549 struct fuse_lk_in *arg = &req->misc.lk_in;
@@ -1565,7 +1565,7 @@ static void fuse_lk_fill(struct fuse_req *req, struct file *file,
1565 1565
1566static int fuse_getlk(struct file *file, struct file_lock *fl) 1566static int fuse_getlk(struct file *file, struct file_lock *fl)
1567{ 1567{
1568 struct inode *inode = file->f_path.dentry->d_inode; 1568 struct inode *inode = file_inode(file);
1569 struct fuse_conn *fc = get_fuse_conn(inode); 1569 struct fuse_conn *fc = get_fuse_conn(inode);
1570 struct fuse_req *req; 1570 struct fuse_req *req;
1571 struct fuse_lk_out outarg; 1571 struct fuse_lk_out outarg;
@@ -1590,7 +1590,7 @@ static int fuse_getlk(struct file *file, struct file_lock *fl)
1590 1590
1591static int fuse_setlk(struct file *file, struct file_lock *fl, int flock) 1591static int fuse_setlk(struct file *file, struct file_lock *fl, int flock)
1592{ 1592{
1593 struct inode *inode = file->f_path.dentry->d_inode; 1593 struct inode *inode = file_inode(file);
1594 struct fuse_conn *fc = get_fuse_conn(inode); 1594 struct fuse_conn *fc = get_fuse_conn(inode);
1595 struct fuse_req *req; 1595 struct fuse_req *req;
1596 int opcode = (fl->fl_flags & FL_SLEEP) ? FUSE_SETLKW : FUSE_SETLK; 1596 int opcode = (fl->fl_flags & FL_SLEEP) ? FUSE_SETLKW : FUSE_SETLK;
@@ -1622,7 +1622,7 @@ static int fuse_setlk(struct file *file, struct file_lock *fl, int flock)
1622 1622
1623static int fuse_file_lock(struct file *file, int cmd, struct file_lock *fl) 1623static int fuse_file_lock(struct file *file, int cmd, struct file_lock *fl)
1624{ 1624{
1625 struct inode *inode = file->f_path.dentry->d_inode; 1625 struct inode *inode = file_inode(file);
1626 struct fuse_conn *fc = get_fuse_conn(inode); 1626 struct fuse_conn *fc = get_fuse_conn(inode);
1627 int err; 1627 int err;
1628 1628
@@ -1645,7 +1645,7 @@ static int fuse_file_lock(struct file *file, int cmd, struct file_lock *fl)
1645 1645
1646static int fuse_file_flock(struct file *file, int cmd, struct file_lock *fl) 1646static int fuse_file_flock(struct file *file, int cmd, struct file_lock *fl)
1647{ 1647{
1648 struct inode *inode = file->f_path.dentry->d_inode; 1648 struct inode *inode = file_inode(file);
1649 struct fuse_conn *fc = get_fuse_conn(inode); 1649 struct fuse_conn *fc = get_fuse_conn(inode);
1650 int err; 1650 int err;
1651 1651
@@ -1702,7 +1702,7 @@ static sector_t fuse_bmap(struct address_space *mapping, sector_t block)
1702static loff_t fuse_file_llseek(struct file *file, loff_t offset, int whence) 1702static loff_t fuse_file_llseek(struct file *file, loff_t offset, int whence)
1703{ 1703{
1704 loff_t retval; 1704 loff_t retval;
1705 struct inode *inode = file->f_path.dentry->d_inode; 1705 struct inode *inode = file_inode(file);
1706 1706
1707 /* No i_mutex protection necessary for SEEK_CUR and SEEK_SET */ 1707 /* No i_mutex protection necessary for SEEK_CUR and SEEK_SET */
1708 if (whence == SEEK_CUR || whence == SEEK_SET) 1708 if (whence == SEEK_CUR || whence == SEEK_SET)
@@ -2079,7 +2079,7 @@ EXPORT_SYMBOL_GPL(fuse_do_ioctl);
2079long fuse_ioctl_common(struct file *file, unsigned int cmd, 2079long fuse_ioctl_common(struct file *file, unsigned int cmd,
2080 unsigned long arg, unsigned int flags) 2080 unsigned long arg, unsigned int flags)
2081{ 2081{
2082 struct inode *inode = file->f_dentry->d_inode; 2082 struct inode *inode = file_inode(file);
2083 struct fuse_conn *fc = get_fuse_conn(inode); 2083 struct fuse_conn *fc = get_fuse_conn(inode);
2084 2084
2085 if (!fuse_allow_current_process(fc)) 2085 if (!fuse_allow_current_process(fc))