aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-04-22 09:24:20 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:02 -0400
commit409c6118d39cb2d8666bee3d61a1a9ae5bbd4f5d (patch)
tree08ed979e2a7163b795659f366de00f6fee84ed28 /fs/btrfs/file.c
parent38b669880df44cba24ab1b01715b87318d469217 (diff)
Btrfs: Set nodatasum on the inode when written by a nodatasum mount
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 3f5525f0834c..5d537f26dc83 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -864,6 +864,14 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf,
864 last_index = (pos + count) >> PAGE_CACHE_SHIFT; 864 last_index = (pos + count) >> PAGE_CACHE_SHIFT;
865 865
866 /* 866 /*
867 * if this is a nodatasum mount, force summing off for the inode
868 * all the time. That way a later mount with summing on won't
869 * get confused
870 */
871 if (btrfs_test_opt(root, NODATASUM))
872 btrfs_set_flag(inode, NODATASUM);
873
874 /*
867 * there are lots of better ways to do this, but this code 875 * there are lots of better ways to do this, but this code
868 * makes sure the first and last page in the file range are 876 * makes sure the first and last page in the file range are
869 * up to date and ready for cow 877 * up to date and ready for cow