[PATCH] Fix btrfs-convert's large file support.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
  This patch add ext2_inode.i_size_high into account when calculating
regular file's size in btrfs-convert,  which makes it deal with large files
 bigger than 4GB properly.

Regards,
Zhu Yanhai

----
diff -r 1c218a5b9784 convert.c
--- a/convert.c	Fri Apr 25 16:55:21 2008 -0400
+++ b/convert.c	Mon Apr 28 13:01:58 2008 +0800
@@ -928,6 +928,10 @@ static int copy_inode_item(struct btrfs_
 		btrfs_set_stack_inode_size(dst, 0);
 		btrfs_set_stack_inode_nlink(dst, 1);
 	}
+    if (S_ISREG(src->i_mode)) {
+        btrfs_set_stack_inode_size(dst, (u64)src->i_size_high << 32 |
+                                      (u64)src->i_size);
+    }
 	if (!S_ISREG(src->i_mode) && !S_ISDIR(src->i_mode) &&
 	    !S_ISLNK(src->i_mode)) {
 		if (src->i_block[0]) {
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux