diff options
author | Joel Becker <joel.becker@oracle.com> | 2010-09-10 11:41:04 -0400 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-09-10 11:41:04 -0400 |
commit | 729963a1ff8d069d05dab6a024bfd59805ac622c (patch) | |
tree | 5489aae570960d1908d738913ea581cc1689fbbb /fs/ocfs2/file.c | |
parent | 17ae521158d6fe89cfdd00a9990aa40d02e81391 (diff) | |
parent | 6ea4843f53282465f2bdbe5eedde7d8c3081dfdf (diff) |
Merge branch 'cow_readahead' of git://oss.oracle.com/git/tma/linux-2.6 into merge-2
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r-- | fs/ocfs2/file.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index b03f6601fd71..9a74542e1a05 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -360,7 +360,7 @@ static int ocfs2_cow_file_pos(struct inode *inode, | |||
360 | if (!(ext_flags & OCFS2_EXT_REFCOUNTED)) | 360 | if (!(ext_flags & OCFS2_EXT_REFCOUNTED)) |
361 | goto out; | 361 | goto out; |
362 | 362 | ||
363 | return ocfs2_refcount_cow(inode, fe_bh, cpos, 1, cpos+1); | 363 | return ocfs2_refcount_cow(inode, NULL, fe_bh, cpos, 1, cpos+1); |
364 | 364 | ||
365 | out: | 365 | out: |
366 | return status; | 366 | return status; |
@@ -903,8 +903,8 @@ static int ocfs2_zero_extend_get_range(struct inode *inode, | |||
903 | zero_clusters = last_cpos - zero_cpos; | 903 | zero_clusters = last_cpos - zero_cpos; |
904 | 904 | ||
905 | if (needs_cow) { | 905 | if (needs_cow) { |
906 | rc = ocfs2_refcount_cow(inode, di_bh, zero_cpos, zero_clusters, | 906 | rc = ocfs2_refcount_cow(inode, NULL, di_bh, zero_cpos, |
907 | UINT_MAX); | 907 | zero_clusters, UINT_MAX); |
908 | if (rc) { | 908 | if (rc) { |
909 | mlog_errno(rc); | 909 | mlog_errno(rc); |
910 | goto out; | 910 | goto out; |
@@ -2052,6 +2052,7 @@ out: | |||
2052 | } | 2052 | } |
2053 | 2053 | ||
2054 | static int ocfs2_prepare_inode_for_refcount(struct inode *inode, | 2054 | static int ocfs2_prepare_inode_for_refcount(struct inode *inode, |
2055 | struct file *file, | ||
2055 | loff_t pos, size_t count, | 2056 | loff_t pos, size_t count, |
2056 | int *meta_level) | 2057 | int *meta_level) |
2057 | { | 2058 | { |
@@ -2069,7 +2070,7 @@ static int ocfs2_prepare_inode_for_refcount(struct inode *inode, | |||
2069 | 2070 | ||
2070 | *meta_level = 1; | 2071 | *meta_level = 1; |
2071 | 2072 | ||
2072 | ret = ocfs2_refcount_cow(inode, di_bh, cpos, clusters, UINT_MAX); | 2073 | ret = ocfs2_refcount_cow(inode, file, di_bh, cpos, clusters, UINT_MAX); |
2073 | if (ret) | 2074 | if (ret) |
2074 | mlog_errno(ret); | 2075 | mlog_errno(ret); |
2075 | out: | 2076 | out: |
@@ -2077,7 +2078,7 @@ out: | |||
2077 | return ret; | 2078 | return ret; |
2078 | } | 2079 | } |
2079 | 2080 | ||
2080 | static int ocfs2_prepare_inode_for_write(struct dentry *dentry, | 2081 | static int ocfs2_prepare_inode_for_write(struct file *file, |
2081 | loff_t *ppos, | 2082 | loff_t *ppos, |
2082 | size_t count, | 2083 | size_t count, |
2083 | int appending, | 2084 | int appending, |
@@ -2085,6 +2086,7 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry, | |||
2085 | int *has_refcount) | 2086 | int *has_refcount) |
2086 | { | 2087 | { |
2087 | int ret = 0, meta_level = 0; | 2088 | int ret = 0, meta_level = 0; |
2089 | struct dentry *dentry = file->f_path.dentry; | ||
2088 | struct inode *inode = dentry->d_inode; | 2090 | struct inode *inode = dentry->d_inode; |
2089 | loff_t saved_pos, end; | 2091 | loff_t saved_pos, end; |
2090 | 2092 | ||
@@ -2140,6 +2142,7 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry, | |||
2140 | meta_level = -1; | 2142 | meta_level = -1; |
2141 | 2143 | ||
2142 | ret = ocfs2_prepare_inode_for_refcount(inode, | 2144 | ret = ocfs2_prepare_inode_for_refcount(inode, |
2145 | file, | ||
2143 | saved_pos, | 2146 | saved_pos, |
2144 | count, | 2147 | count, |
2145 | &meta_level); | 2148 | &meta_level); |
@@ -2254,7 +2257,7 @@ relock: | |||
2254 | } | 2257 | } |
2255 | 2258 | ||
2256 | can_do_direct = direct_io; | 2259 | can_do_direct = direct_io; |
2257 | ret = ocfs2_prepare_inode_for_write(file->f_path.dentry, ppos, | 2260 | ret = ocfs2_prepare_inode_for_write(file, ppos, |
2258 | iocb->ki_left, appending, | 2261 | iocb->ki_left, appending, |
2259 | &can_do_direct, &has_refcount); | 2262 | &can_do_direct, &has_refcount); |
2260 | if (ret < 0) { | 2263 | if (ret < 0) { |
@@ -2373,7 +2376,7 @@ static int ocfs2_splice_to_file(struct pipe_inode_info *pipe, | |||
2373 | { | 2376 | { |
2374 | int ret; | 2377 | int ret; |
2375 | 2378 | ||
2376 | ret = ocfs2_prepare_inode_for_write(out->f_path.dentry, &sd->pos, | 2379 | ret = ocfs2_prepare_inode_for_write(out, &sd->pos, |
2377 | sd->total_len, 0, NULL, NULL); | 2380 | sd->total_len, 0, NULL, NULL); |
2378 | if (ret < 0) { | 2381 | if (ret < 0) { |
2379 | mlog_errno(ret); | 2382 | mlog_errno(ret); |