linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liu Bo <bo.li.liu@oracle.com>
To: linux-ext4@vger.kernel.org
Cc: linux-btrfs@vger.kernel.org, dsterba@suse.cz, jeff.liu@oracle.com
Subject: [PATCH] E2fsprogs: introduce FIEMAP_EXTENT_SHARED support
Date: Mon, 16 Sep 2013 15:41:24 +0800	[thread overview]
Message-ID: <1379317284-20311-1-git-send-email-bo.li.liu@oracle.com> (raw)

Filesystems, such as ocfs2 and btrfs, support shared space that is
shared among different files, so the upstream introduces flag
FIEMAP_EXTENT_SHARED for that.

With this, e2fsprogs's filefrag also support the flag.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
 lib/ext2fs/fiemap.h |    2 ++
 misc/filefrag.c     |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lib/ext2fs/fiemap.h b/lib/ext2fs/fiemap.h
index 30bf555..895cd0b 100644
--- a/lib/ext2fs/fiemap.h
+++ b/lib/ext2fs/fiemap.h
@@ -64,5 +64,7 @@ struct fiemap {
 #define FIEMAP_EXTENT_MERGED		0x00001000 /* File does not natively
 						    * support extents. Result
 						    * merged for efficiency. */
+#define FIEMAP_EXTENT_SHARED		0x00002000 /* Space shared with other
+						    * files. */
 
 #endif /* _LINUX_FIEMAP_H */
diff --git a/misc/filefrag.c b/misc/filefrag.c
index 35b3544..31dfb64 100644
--- a/misc/filefrag.c
+++ b/misc/filefrag.c
@@ -165,6 +165,8 @@ static void print_extent_info(struct fiemap_extent *fm_extent, int cur_ex,
 		strcat(flags, "unwritten,");
 	if (fm_extent->fe_flags & FIEMAP_EXTENT_MERGED)
 		strcat(flags, "merged,");
+	if (fm_extent->fe_flags & FIEMAP_EXTENT_SHARED)
+		strcat(flags, "shared,");
 
 	if (fm_extent->fe_logical + fm_extent->fe_length >= (__u64) st->st_size)
 		strcat(flags, "eof,");
-- 
1.7.7


                 reply	other threads:[~2013-09-16  7:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1379317284-20311-1-git-send-email-bo.li.liu@oracle.com \
    --to=bo.li.liu@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=jeff.liu@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --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).