linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Zhu Yanhai" <piggestpig@gmail.com>
To: btrfs-devel@oss.oracle.com, linux-btrfs@vger.kernel.org
Subject: [PATCH] Fix btrfs-convert's large file support.
Date: Mon, 28 Apr 2008 14:03:57 +0800	[thread overview]
Message-ID: <13c114d20804272303mf33127bs233b68c8c2244c9f@mail.gmail.com> (raw)

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]) {

             reply	other threads:[~2008-04-28  6:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-28  6:03 Zhu Yanhai [this message]
2008-04-28 15:04 ` [PATCH] Fix btrfs-convert's large file support Yan Zheng
2008-04-28 15:09 ` Chris Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13c114d20804272303mf33127bs233b68c8c2244c9f@mail.gmail.com \
    --to=piggestpig@gmail.com \
    --cc=btrfs-devel@oss.oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).