From: Theodore Ts'o <tytso@mit.edu>
To: linux-ext4@vger.kernel.org
Cc: Theodore Ts'o <tytso@mit.edu>
Subject: [PATCH,RFC 2/4] Don't byte swap extents information in the inode
Date: Sun, 16 Sep 2007 22:57:39 -0400 [thread overview]
Message-ID: <11899978612166-git-send-email-tytso@mit.edu> (raw)
Message-ID: <2602a6e4ece40218c0344062932f1fd6d9ee7ed8.1189997130.git.tytso@mit.edu> (raw)
In-Reply-To: <11899978613069-git-send-email-tytso@mit.edu>
In-Reply-To: <5db31092e4fe5c89eb093da1aff6fda8c100647d.1189997130.git.tytso@mit.edu>
Responsibility for byte swapping the extents information rests with
the low-level extent code, which translates the on-disk extents
information to the abstract extent format. The on-disk format will
eventually get more complicated, in order to add support for 64-bit
block numbers, bit-compressed extents, etc. So to avoid needing to
expose all of that complexity in swapfs.c, the in-memory contents of
i_blocks will not be byte-swapped and will be identical to the on-disk
format.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
lib/ext2fs/swapfs.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/lib/ext2fs/swapfs.c b/lib/ext2fs/swapfs.c
index bd0844d..52ca6a0 100644
--- a/lib/ext2fs/swapfs.c
+++ b/lib/ext2fs/swapfs.c
@@ -158,7 +158,11 @@ void ext2fs_swap_inode_full(ext2_filsys fs, struct ext2_inode_large *t,
if (!hostorder)
has_data_blocks = ext2fs_inode_data_blocks(fs,
(struct ext2_inode *) t);
+ if (hostorder && (f->i_flags & EXT4_EXTENTS_FL))
+ has_data_blocks = 0;
t->i_flags = ext2fs_swab32(f->i_flags);
+ if (hostorder && (t->i_flags & EXT4_EXTENTS_FL))
+ has_data_blocks = 0;
t->i_dir_acl = ext2fs_swab32(f->i_dir_acl);
if (!islnk || has_data_blocks ) {
for (i = 0; i < EXT2_N_BLOCKS; i++)
--
1.5.3.1.19.gb5ef6
next prev parent reply other threads:[~2007-09-17 2:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-17 2:57 Initial extents support for e2fsprogs Theodore Ts'o
[not found] ` <5db31092e4fe5c89eb093da1aff6fda8c100647d.1189997130.git.tytso@mit.edu>
2007-09-17 2:57 ` [PATCH,RFC 1/4] Allow debugfs to be extended for use by test programs Theodore Ts'o
[not found] ` <2602a6e4ece40218c0344062932f1fd6d9ee7ed8.1189997130.git.tytso@mit.edu>
2007-09-17 2:57 ` Theodore Ts'o [this message]
[not found] ` <a9a80d79bfa5e48273459a8a6a4d42d23aa791ad.1189997130.git.tytso@mit.edu>
2007-09-17 2:57 ` [PATCH,RFC 3/4] e2fsck: factor out code to clear an inode into e2fsck_clear_inode() Theodore Ts'o
[not found] ` <ef3b0e3bf2b4bf168b39995aa3ad0e0c51d28caf.1189997130.git.tytso@mit.edu>
2007-09-17 2:57 ` [PATCH,RFC 4/4] Initial checkin for new extents API Theodore Ts'o
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=11899978612166-git-send-email-tytso@mit.edu \
--to=tytso@mit.edu \
--cc=linux-ext4@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).