aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-23 17:07:38 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-22 23:31:31 -0500
commit496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch)
tree8f4abde793cd7db5bb8fde6d27ebcacd0e54379a /fs/ocfs2
parent57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff)
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/aops.c4
-rw-r--r--fs/ocfs2/dir.c2
-rw-r--r--fs/ocfs2/dlmfs/dlmfs.c6
-rw-r--r--fs/ocfs2/file.c10
-rw-r--r--fs/ocfs2/ioctl.c4
-rw-r--r--fs/ocfs2/mmap.c8
-rw-r--r--fs/ocfs2/move_extents.c2
-rw-r--r--fs/ocfs2/refcounttree.c4
8 files changed, 20 insertions, 20 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 657743254eb9..db1ad26e02a7 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -569,7 +569,7 @@ static void ocfs2_dio_end_io(struct kiocb *iocb,
569 int ret, 569 int ret,
570 bool is_async) 570 bool is_async)
571{ 571{
572 struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; 572 struct inode *inode = file_inode(iocb->ki_filp);
573 int level; 573 int level;
574 wait_queue_head_t *wq = ocfs2_ioend_wq(inode); 574 wait_queue_head_t *wq = ocfs2_ioend_wq(inode);
575 575
@@ -626,7 +626,7 @@ static ssize_t ocfs2_direct_IO(int rw,
626 unsigned long nr_segs) 626 unsigned long nr_segs)
627{ 627{
628 struct file *file = iocb->ki_filp; 628 struct file *file = iocb->ki_filp;
629 struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host; 629 struct inode *inode = file_inode(file)->i_mapping->host;
630 630
631 /* 631 /*
632 * Fallback to buffered I/O if we see an inode without 632 * Fallback to buffered I/O if we see an inode without
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
index 8fe4e2892ab9..ac0d4a0e8a41 100644
--- a/fs/ocfs2/dir.c
+++ b/fs/ocfs2/dir.c
@@ -2015,7 +2015,7 @@ int ocfs2_dir_foreach(struct inode *inode, loff_t *f_pos, void *priv,
2015int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir) 2015int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir)
2016{ 2016{
2017 int error = 0; 2017 int error = 0;
2018 struct inode *inode = filp->f_path.dentry->d_inode; 2018 struct inode *inode = file_inode(filp);
2019 int lock_level = 0; 2019 int lock_level = 0;
2020 2020
2021 trace_ocfs2_readdir((unsigned long long)OCFS2_I(inode)->ip_blkno); 2021 trace_ocfs2_readdir((unsigned long long)OCFS2_I(inode)->ip_blkno);
diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
index 16b712d260d4..4c5fc8d77dc2 100644
--- a/fs/ocfs2/dlmfs/dlmfs.c
+++ b/fs/ocfs2/dlmfs/dlmfs.c
@@ -224,7 +224,7 @@ static int dlmfs_file_setattr(struct dentry *dentry, struct iattr *attr)
224static unsigned int dlmfs_file_poll(struct file *file, poll_table *wait) 224static unsigned int dlmfs_file_poll(struct file *file, poll_table *wait)
225{ 225{
226 int event = 0; 226 int event = 0;
227 struct inode *inode = file->f_path.dentry->d_inode; 227 struct inode *inode = file_inode(file);
228 struct dlmfs_inode_private *ip = DLMFS_I(inode); 228 struct dlmfs_inode_private *ip = DLMFS_I(inode);
229 229
230 poll_wait(file, &ip->ip_lockres.l_event, wait); 230 poll_wait(file, &ip->ip_lockres.l_event, wait);
@@ -245,7 +245,7 @@ static ssize_t dlmfs_file_read(struct file *filp,
245 int bytes_left; 245 int bytes_left;
246 ssize_t readlen, got; 246 ssize_t readlen, got;
247 char *lvb_buf; 247 char *lvb_buf;
248 struct inode *inode = filp->f_path.dentry->d_inode; 248 struct inode *inode = file_inode(filp);
249 249
250 mlog(0, "inode %lu, count = %zu, *ppos = %llu\n", 250 mlog(0, "inode %lu, count = %zu, *ppos = %llu\n",
251 inode->i_ino, count, *ppos); 251 inode->i_ino, count, *ppos);
@@ -293,7 +293,7 @@ static ssize_t dlmfs_file_write(struct file *filp,
293 int bytes_left; 293 int bytes_left;
294 ssize_t writelen; 294 ssize_t writelen;
295 char *lvb_buf; 295 char *lvb_buf;
296 struct inode *inode = filp->f_path.dentry->d_inode; 296 struct inode *inode = file_inode(filp);
297 297
298 mlog(0, "inode %lu, count = %zu, *ppos = %llu\n", 298 mlog(0, "inode %lu, count = %zu, *ppos = %llu\n",
299 inode->i_ino, count, *ppos); 299 inode->i_ino, count, *ppos);
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 37d313ede159..04098af9dbc8 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1949,7 +1949,7 @@ out:
1949int ocfs2_change_file_space(struct file *file, unsigned int cmd, 1949int ocfs2_change_file_space(struct file *file, unsigned int cmd,
1950 struct ocfs2_space_resv *sr) 1950 struct ocfs2_space_resv *sr)
1951{ 1951{
1952 struct inode *inode = file->f_path.dentry->d_inode; 1952 struct inode *inode = file_inode(file);
1953 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 1953 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
1954 int ret; 1954 int ret;
1955 1955
@@ -1977,7 +1977,7 @@ int ocfs2_change_file_space(struct file *file, unsigned int cmd,
1977static long ocfs2_fallocate(struct file *file, int mode, loff_t offset, 1977static long ocfs2_fallocate(struct file *file, int mode, loff_t offset,
1978 loff_t len) 1978 loff_t len)
1979{ 1979{
1980 struct inode *inode = file->f_path.dentry->d_inode; 1980 struct inode *inode = file_inode(file);
1981 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 1981 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
1982 struct ocfs2_space_resv sr; 1982 struct ocfs2_space_resv sr;
1983 int change_size = 1; 1983 int change_size = 1;
@@ -2232,7 +2232,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
2232 loff_t old_size, *ppos = &iocb->ki_pos; 2232 loff_t old_size, *ppos = &iocb->ki_pos;
2233 u32 old_clusters; 2233 u32 old_clusters;
2234 struct file *file = iocb->ki_filp; 2234 struct file *file = iocb->ki_filp;
2235 struct inode *inode = file->f_path.dentry->d_inode; 2235 struct inode *inode = file_inode(file);
2236 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 2236 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
2237 int full_coherency = !(osb->s_mount_opt & 2237 int full_coherency = !(osb->s_mount_opt &
2238 OCFS2_MOUNT_COHERENCY_BUFFERED); 2238 OCFS2_MOUNT_COHERENCY_BUFFERED);
@@ -2516,7 +2516,7 @@ static ssize_t ocfs2_file_splice_read(struct file *in,
2516 unsigned int flags) 2516 unsigned int flags)
2517{ 2517{
2518 int ret = 0, lock_level = 0; 2518 int ret = 0, lock_level = 0;
2519 struct inode *inode = in->f_path.dentry->d_inode; 2519 struct inode *inode = file_inode(in);
2520 2520
2521 trace_ocfs2_file_splice_read(inode, in, in->f_path.dentry, 2521 trace_ocfs2_file_splice_read(inode, in, in->f_path.dentry,
2522 (unsigned long long)OCFS2_I(inode)->ip_blkno, 2522 (unsigned long long)OCFS2_I(inode)->ip_blkno,
@@ -2546,7 +2546,7 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
2546{ 2546{
2547 int ret = 0, rw_level = -1, have_alloc_sem = 0, lock_level = 0; 2547 int ret = 0, rw_level = -1, have_alloc_sem = 0, lock_level = 0;
2548 struct file *filp = iocb->ki_filp; 2548 struct file *filp = iocb->ki_filp;
2549 struct inode *inode = filp->f_path.dentry->d_inode; 2549 struct inode *inode = file_inode(filp);
2550 2550
2551 trace_ocfs2_file_aio_read(inode, filp, filp->f_path.dentry, 2551 trace_ocfs2_file_aio_read(inode, filp, filp->f_path.dentry,
2552 (unsigned long long)OCFS2_I(inode)->ip_blkno, 2552 (unsigned long long)OCFS2_I(inode)->ip_blkno,
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
index f20edcbfe700..752f0b26221d 100644
--- a/fs/ocfs2/ioctl.c
+++ b/fs/ocfs2/ioctl.c
@@ -881,7 +881,7 @@ bail:
881 881
882long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 882long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
883{ 883{
884 struct inode *inode = filp->f_path.dentry->d_inode; 884 struct inode *inode = file_inode(filp);
885 unsigned int flags; 885 unsigned int flags;
886 int new_clusters; 886 int new_clusters;
887 int status; 887 int status;
@@ -994,7 +994,7 @@ long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg)
994{ 994{
995 bool preserve; 995 bool preserve;
996 struct reflink_arguments args; 996 struct reflink_arguments args;
997 struct inode *inode = file->f_path.dentry->d_inode; 997 struct inode *inode = file_inode(file);
998 struct ocfs2_info info; 998 struct ocfs2_info info;
999 void __user *argp = (void __user *)arg; 999 void __user *argp = (void __user *)arg;
1000 1000
diff --git a/fs/ocfs2/mmap.c b/fs/ocfs2/mmap.c
index 47a87dda54ce..07c585b85000 100644
--- a/fs/ocfs2/mmap.c
+++ b/fs/ocfs2/mmap.c
@@ -62,7 +62,7 @@ static int __ocfs2_page_mkwrite(struct file *file, struct buffer_head *di_bh,
62 struct page *page) 62 struct page *page)
63{ 63{
64 int ret = VM_FAULT_NOPAGE; 64 int ret = VM_FAULT_NOPAGE;
65 struct inode *inode = file->f_path.dentry->d_inode; 65 struct inode *inode = file_inode(file);
66 struct address_space *mapping = inode->i_mapping; 66 struct address_space *mapping = inode->i_mapping;
67 loff_t pos = page_offset(page); 67 loff_t pos = page_offset(page);
68 unsigned int len = PAGE_CACHE_SIZE; 68 unsigned int len = PAGE_CACHE_SIZE;
@@ -131,7 +131,7 @@ out:
131static int ocfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) 131static int ocfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
132{ 132{
133 struct page *page = vmf->page; 133 struct page *page = vmf->page;
134 struct inode *inode = vma->vm_file->f_path.dentry->d_inode; 134 struct inode *inode = file_inode(vma->vm_file);
135 struct buffer_head *di_bh = NULL; 135 struct buffer_head *di_bh = NULL;
136 sigset_t oldset; 136 sigset_t oldset;
137 int ret; 137 int ret;
@@ -180,13 +180,13 @@ int ocfs2_mmap(struct file *file, struct vm_area_struct *vma)
180{ 180{
181 int ret = 0, lock_level = 0; 181 int ret = 0, lock_level = 0;
182 182
183 ret = ocfs2_inode_lock_atime(file->f_dentry->d_inode, 183 ret = ocfs2_inode_lock_atime(file_inode(file),
184 file->f_vfsmnt, &lock_level); 184 file->f_vfsmnt, &lock_level);
185 if (ret < 0) { 185 if (ret < 0) {
186 mlog_errno(ret); 186 mlog_errno(ret);
187 goto out; 187 goto out;
188 } 188 }
189 ocfs2_inode_unlock(file->f_dentry->d_inode, lock_level); 189 ocfs2_inode_unlock(file_inode(file), lock_level);
190out: 190out:
191 vma->vm_ops = &ocfs2_file_vm_ops; 191 vma->vm_ops = &ocfs2_file_vm_ops;
192 return 0; 192 return 0;
diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c
index 6083432f667e..9f8dcadd9a50 100644
--- a/fs/ocfs2/move_extents.c
+++ b/fs/ocfs2/move_extents.c
@@ -1055,7 +1055,7 @@ int ocfs2_ioctl_move_extents(struct file *filp, void __user *argp)
1055{ 1055{
1056 int status; 1056 int status;
1057 1057
1058 struct inode *inode = filp->f_path.dentry->d_inode; 1058 struct inode *inode = file_inode(filp);
1059 struct ocfs2_move_extents range; 1059 struct ocfs2_move_extents range;
1060 struct ocfs2_move_extents_context *context = NULL; 1060 struct ocfs2_move_extents_context *context = NULL;
1061 1061
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index 30a055049e16..1baffaadda41 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -2927,7 +2927,7 @@ int ocfs2_duplicate_clusters_by_page(handle_t *handle,
2927 u32 new_cluster, u32 new_len) 2927 u32 new_cluster, u32 new_len)
2928{ 2928{
2929 int ret = 0, partial; 2929 int ret = 0, partial;
2930 struct inode *inode = file->f_path.dentry->d_inode; 2930 struct inode *inode = file_inode(file);
2931 struct ocfs2_caching_info *ci = INODE_CACHE(inode); 2931 struct ocfs2_caching_info *ci = INODE_CACHE(inode);
2932 struct super_block *sb = ocfs2_metadata_cache_get_super(ci); 2932 struct super_block *sb = ocfs2_metadata_cache_get_super(ci);
2933 u64 new_block = ocfs2_clusters_to_blocks(sb, new_cluster); 2933 u64 new_block = ocfs2_clusters_to_blocks(sb, new_cluster);
@@ -3020,7 +3020,7 @@ int ocfs2_duplicate_clusters_by_jbd(handle_t *handle,
3020 u32 new_cluster, u32 new_len) 3020 u32 new_cluster, u32 new_len)
3021{ 3021{
3022 int ret = 0; 3022 int ret = 0;
3023 struct inode *inode = file->f_path.dentry->d_inode; 3023 struct inode *inode = file_inode(file);
3024 struct super_block *sb = inode->i_sb; 3024 struct super_block *sb = inode->i_sb;
3025 struct ocfs2_caching_info *ci = INODE_CACHE(inode); 3025 struct ocfs2_caching_info *ci = INODE_CACHE(inode);
3026 int i, blocks = ocfs2_clusters_to_blocks(sb, new_len); 3026 int i, blocks = ocfs2_clusters_to_blocks(sb, new_len);