aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2013-01-29 04:48:30 -0500
committerJiri Kosina <jkosina@suse.cz>2013-01-29 04:48:30 -0500
commit617677295b53a40d0e54aac4cbbc216ffbc755dd (patch)
tree51b9e87213243ed5efff252c8e8d8fec4eebc588 /fs/ocfs2
parent5c8d1b68e01a144813e38795fe6dbe7ebb506131 (diff)
parent6abb7c25775b7fb2225ad0508236d63ca710e65f (diff)
Merge branch 'master' into for-next
Conflicts: drivers/devfreq/exynos4_bus.c Sync with Linus' tree to be able to apply patches that are against newer code (mvneta).
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/extent_map.c12
-rw-r--r--fs/ocfs2/file.c29
2 files changed, 10 insertions, 31 deletions
diff --git a/fs/ocfs2/extent_map.c b/fs/ocfs2/extent_map.c
index 70b5863a2d64..f487aa343442 100644
--- a/fs/ocfs2/extent_map.c
+++ b/fs/ocfs2/extent_map.c
@@ -832,7 +832,7 @@ out:
832 return ret; 832 return ret;
833} 833}
834 834
835int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int origin) 835int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int whence)
836{ 836{
837 struct inode *inode = file->f_mapping->host; 837 struct inode *inode = file->f_mapping->host;
838 int ret; 838 int ret;
@@ -843,7 +843,7 @@ int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int origin)
843 struct buffer_head *di_bh = NULL; 843 struct buffer_head *di_bh = NULL;
844 struct ocfs2_extent_rec rec; 844 struct ocfs2_extent_rec rec;
845 845
846 BUG_ON(origin != SEEK_DATA && origin != SEEK_HOLE); 846 BUG_ON(whence != SEEK_DATA && whence != SEEK_HOLE);
847 847
848 ret = ocfs2_inode_lock(inode, &di_bh, 0); 848 ret = ocfs2_inode_lock(inode, &di_bh, 0);
849 if (ret) { 849 if (ret) {
@@ -859,7 +859,7 @@ int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int origin)
859 } 859 }
860 860
861 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { 861 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
862 if (origin == SEEK_HOLE) 862 if (whence == SEEK_HOLE)
863 *offset = inode->i_size; 863 *offset = inode->i_size;
864 goto out_unlock; 864 goto out_unlock;
865 } 865 }
@@ -888,8 +888,8 @@ int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int origin)
888 is_data = (rec.e_flags & OCFS2_EXT_UNWRITTEN) ? 0 : 1; 888 is_data = (rec.e_flags & OCFS2_EXT_UNWRITTEN) ? 0 : 1;
889 } 889 }
890 890
891 if ((!is_data && origin == SEEK_HOLE) || 891 if ((!is_data && whence == SEEK_HOLE) ||
892 (is_data && origin == SEEK_DATA)) { 892 (is_data && whence == SEEK_DATA)) {
893 if (extoff > *offset) 893 if (extoff > *offset)
894 *offset = extoff; 894 *offset = extoff;
895 goto out_unlock; 895 goto out_unlock;
@@ -899,7 +899,7 @@ int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int origin)
899 cpos += clen; 899 cpos += clen;
900 } 900 }
901 901
902 if (origin == SEEK_HOLE) { 902 if (whence == SEEK_HOLE) {
903 extoff = cpos; 903 extoff = cpos;
904 extoff <<= cs_bits; 904 extoff <<= cs_bits;
905 extlen = clen; 905 extlen = clen;
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 5a4ee77cec51..37d313ede159 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1218,24 +1218,6 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
1218 } 1218 }
1219 } 1219 }
1220 1220
1221 /*
1222 * This will intentionally not wind up calling truncate_setsize(),
1223 * since all the work for a size change has been done above.
1224 * Otherwise, we could get into problems with truncate as
1225 * ip_alloc_sem is used there to protect against i_size
1226 * changes.
1227 *
1228 * XXX: this means the conditional below can probably be removed.
1229 */
1230 if ((attr->ia_valid & ATTR_SIZE) &&
1231 attr->ia_size != i_size_read(inode)) {
1232 status = vmtruncate(inode, attr->ia_size);
1233 if (status) {
1234 mlog_errno(status);
1235 goto bail_commit;
1236 }
1237 }
1238
1239 setattr_copy(inode, attr); 1221 setattr_copy(inode, attr);
1240 mark_inode_dirty(inode); 1222 mark_inode_dirty(inode);
1241 1223
@@ -2513,18 +2495,15 @@ static ssize_t ocfs2_file_splice_write(struct pipe_inode_info *pipe,
2513 ret = sd.num_spliced; 2495 ret = sd.num_spliced;
2514 2496
2515 if (ret > 0) { 2497 if (ret > 0) {
2516 unsigned long nr_pages;
2517 int err; 2498 int err;
2518 2499
2519 nr_pages = (ret + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
2520
2521 err = generic_write_sync(out, *ppos, ret); 2500 err = generic_write_sync(out, *ppos, ret);
2522 if (err) 2501 if (err)
2523 ret = err; 2502 ret = err;
2524 else 2503 else
2525 *ppos += ret; 2504 *ppos += ret;
2526 2505
2527 balance_dirty_pages_ratelimited_nr(mapping, nr_pages); 2506 balance_dirty_pages_ratelimited(mapping);
2528 } 2507 }
2529 2508
2530 return ret; 2509 return ret;
@@ -2640,14 +2619,14 @@ bail:
2640} 2619}
2641 2620
2642/* Refer generic_file_llseek_unlocked() */ 2621/* Refer generic_file_llseek_unlocked() */
2643static loff_t ocfs2_file_llseek(struct file *file, loff_t offset, int origin) 2622static loff_t ocfs2_file_llseek(struct file *file, loff_t offset, int whence)
2644{ 2623{
2645 struct inode *inode = file->f_mapping->host; 2624 struct inode *inode = file->f_mapping->host;
2646 int ret = 0; 2625 int ret = 0;
2647 2626
2648 mutex_lock(&inode->i_mutex); 2627 mutex_lock(&inode->i_mutex);
2649 2628
2650 switch (origin) { 2629 switch (whence) {
2651 case SEEK_SET: 2630 case SEEK_SET:
2652 break; 2631 break;
2653 case SEEK_END: 2632 case SEEK_END:
@@ -2662,7 +2641,7 @@ static loff_t ocfs2_file_llseek(struct file *file, loff_t offset, int origin)
2662 break; 2641 break;
2663 case SEEK_DATA: 2642 case SEEK_DATA:
2664 case SEEK_HOLE: 2643 case SEEK_HOLE:
2665 ret = ocfs2_seek_data_hole_offset(file, &offset, origin); 2644 ret = ocfs2_seek_data_hole_offset(file, &offset, whence);
2666 if (ret) 2645 if (ret)
2667 goto out; 2646 goto out;
2668 break; 2647 break;