aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/file.c
diff options
context:
space:
mode:
authorTao Ma <tao.ma@oracle.com>2010-08-11 22:27:14 -0400
committerTao Ma <tao.ma@oracle.com>2010-08-11 22:39:52 -0400
commitb890823635e022467b924e3d9da8c5166a4e349c (patch)
tree0fbd6c0051c51b0d03df82b8c7203dfc868b383a /fs/ocfs2/file.c
parent0378da0fda6edf5aaffda6f1248a78986bd955b5 (diff)
ocfs2: pass struct file* to ocfs2_prepare_inode_for_write.
struct file * has file_ra_state to store the readahead state and data. So pass this to ocfs2_prepare_inode_for_write. so that it can be used in ocfs2_refcount_cow. Signed-off-by: Tao Ma <tao.ma@oracle.com>
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r--fs/ocfs2/file.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 81296b4e3646..5920159a421f 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -2053,6 +2053,7 @@ out:
2053} 2053}
2054 2054
2055static int ocfs2_prepare_inode_for_refcount(struct inode *inode, 2055static int ocfs2_prepare_inode_for_refcount(struct inode *inode,
2056 struct file *file,
2056 loff_t pos, size_t count, 2057 loff_t pos, size_t count,
2057 int *meta_level) 2058 int *meta_level)
2058{ 2059{
@@ -2078,7 +2079,7 @@ out:
2078 return ret; 2079 return ret;
2079} 2080}
2080 2081
2081static int ocfs2_prepare_inode_for_write(struct dentry *dentry, 2082static int ocfs2_prepare_inode_for_write(struct file *file,
2082 loff_t *ppos, 2083 loff_t *ppos,
2083 size_t count, 2084 size_t count,
2084 int appending, 2085 int appending,
@@ -2086,6 +2087,7 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry,
2086 int *has_refcount) 2087 int *has_refcount)
2087{ 2088{
2088 int ret = 0, meta_level = 0; 2089 int ret = 0, meta_level = 0;
2090 struct dentry *dentry = file->f_path.dentry;
2089 struct inode *inode = dentry->d_inode; 2091 struct inode *inode = dentry->d_inode;
2090 loff_t saved_pos, end; 2092 loff_t saved_pos, end;
2091 2093
@@ -2141,6 +2143,7 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry,
2141 meta_level = -1; 2143 meta_level = -1;
2142 2144
2143 ret = ocfs2_prepare_inode_for_refcount(inode, 2145 ret = ocfs2_prepare_inode_for_refcount(inode,
2146 file,
2144 saved_pos, 2147 saved_pos,
2145 count, 2148 count,
2146 &meta_level); 2149 &meta_level);
@@ -2255,7 +2258,7 @@ relock:
2255 } 2258 }
2256 2259
2257 can_do_direct = direct_io; 2260 can_do_direct = direct_io;
2258 ret = ocfs2_prepare_inode_for_write(file->f_path.dentry, ppos, 2261 ret = ocfs2_prepare_inode_for_write(file, ppos,
2259 iocb->ki_left, appending, 2262 iocb->ki_left, appending,
2260 &can_do_direct, &has_refcount); 2263 &can_do_direct, &has_refcount);
2261 if (ret < 0) { 2264 if (ret < 0) {
@@ -2385,7 +2388,7 @@ static int ocfs2_splice_to_file(struct pipe_inode_info *pipe,
2385{ 2388{
2386 int ret; 2389 int ret;
2387 2390
2388 ret = ocfs2_prepare_inode_for_write(out->f_path.dentry, &sd->pos, 2391 ret = ocfs2_prepare_inode_for_write(out, &sd->pos,
2389 sd->total_len, 0, NULL, NULL); 2392 sd->total_len, 0, NULL, NULL);
2390 if (ret < 0) { 2393 if (ret < 0) {
2391 mlog_errno(ret); 2394 mlog_errno(ret);