From: Radek Pazdera <rpazdera@redhat.com>
To: linux-ext4@vger.kernel.org
Cc: lczerner@redhat.com, kasparek@fit.vutbr.cz,
Radek Pazdera <rpazdera@redhat.com>
Subject: [RFC v2 1/9] ext4: Adding itree feature and inode flags
Date: Mon, 13 May 2013 17:42:02 +0200 [thread overview]
Message-ID: <1368459730-3405-2-git-send-email-rpazdera@redhat.com> (raw)
In-Reply-To: <1368459730-3405-1-git-send-email-rpazdera@redhat.com>
This commit adds two new flags for the itree. A new read-only file
system feature flag:
EXT4_FEATURE_RO_COMPAT_ITREE 0x1000
And an inode flag to indicate that a directory has itree:
EXT4_ITREE_FL = 0x10000000
EXT4_INODE_ITREE = 29
Also a macro for checking these flags on a directory was added.
Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
---
fs/ext4/ext4.h | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 5aae3d1..9512702 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -388,6 +388,7 @@ struct flex_groups {
#define EXT4_EA_INODE_FL 0x00200000 /* Inode used for large EA */
#define EXT4_EOFBLOCKS_FL 0x00400000 /* Blocks allocated beyond EOF */
#define EXT4_INLINE_DATA_FL 0x10000000 /* Inode has inline data. */
+#define EXT4_ITREE_FL 0x20000000 /* Directory has itree */
#define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */
#define EXT4_FL_USER_VISIBLE 0x004BDFFF /* User visible flags */
@@ -445,6 +446,7 @@ enum {
EXT4_INODE_EA_INODE = 21, /* Inode used for large EA */
EXT4_INODE_EOFBLOCKS = 22, /* Blocks allocated beyond EOF */
EXT4_INODE_INLINE_DATA = 28, /* Data in inode. */
+ EXT4_INODE_ITREE = 29, /* Directory has itree */
EXT4_INODE_RESERVED = 31, /* reserved for ext4 lib */
};
@@ -489,6 +491,7 @@ static inline void ext4_check_flag_values(void)
CHECK_FLAG_VALUE(EA_INODE);
CHECK_FLAG_VALUE(EOFBLOCKS);
CHECK_FLAG_VALUE(INLINE_DATA);
+ CHECK_FLAG_VALUE(ITREE);
CHECK_FLAG_VALUE(RESERVED);
}
@@ -1481,6 +1484,7 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei)
* GDT_CSUM bits are mutually exclusive.
*/
#define EXT4_FEATURE_RO_COMPAT_METADATA_CSUM 0x0400
+#define EXT4_FEATURE_RO_COMPAT_ITREE 0x1000
#define EXT4_FEATURE_INCOMPAT_COMPRESSION 0x0001
#define EXT4_FEATURE_INCOMPAT_FILETYPE 0x0002
@@ -1530,7 +1534,8 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei)
EXT4_FEATURE_RO_COMPAT_HUGE_FILE |\
EXT4_FEATURE_RO_COMPAT_BIGALLOC |\
EXT4_FEATURE_RO_COMPAT_METADATA_CSUM|\
- EXT4_FEATURE_RO_COMPAT_QUOTA)
+ EXT4_FEATURE_RO_COMPAT_QUOTA|\
+ EXT4_FEATURE_RO_COMPAT_ITREE)
/*
* Default values for user and/or group using reserved blocks
@@ -1688,6 +1693,11 @@ static inline __le16 ext4_rec_len_to_disk(unsigned len, unsigned blocksize)
#define EXT4_DIR_LINK_MAX(dir) (!is_dx(dir) && (dir)->i_nlink >= EXT4_LINK_MAX)
#define EXT4_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2 || (dir)->i_nlink == 1)
+#define dx_itree(dir) (is_dx(dir) && \
+ EXT4_HAS_RO_COMPAT_FEATURE(dir->i_sb, \
+ EXT4_FEATURE_RO_COMPAT_ITREE) && \
+ ext4_test_inode_flag((dir), EXT4_INODE_ITREE))
+
/* Legal values for the dx_root hash_version field: */
#define DX_HASH_LEGACY 0
--
1.7.11.7
next prev parent reply other threads:[~2013-05-13 16:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-13 15:42 [RFC v2 0/9] ext4: An Auxiliary Tree for the Directory Index Radek Pazdera
2013-05-13 15:42 ` Radek Pazdera [this message]
2013-05-13 15:42 ` [RFC v2 2/9] ext4: Allow sorting dx_map by inode as well Radek Pazdera
2013-05-13 15:42 ` [RFC v2 3/9] ext4: Adding a link to itree to the dx_root struct Radek Pazdera
2013-05-13 15:42 ` [RFC v2 4/9] ext4: Adding itree structures Radek Pazdera
2013-05-13 15:42 ` [RFC v2 5/9] ext4: Adding itree implementation I - Core Radek Pazdera
2013-05-13 15:42 ` [RFC v2 6/9] ext4: Adding itree implementation II - Inserting Radek Pazdera
2013-05-13 15:42 ` [RFC v2 7/9] ext4: Adding itree implementation III - Deleting Radek Pazdera
2013-05-13 15:42 ` [RFC v2 8/9] ext4: Make directory operations use itree Radek Pazdera
2013-05-13 15:42 ` [RFC v2 9/9] ext4: Make ext4_readdir() use itree if available Radek Pazdera
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=1368459730-3405-2-git-send-email-rpazdera@redhat.com \
--to=rpazdera@redhat.com \
--cc=kasparek@fit.vutbr.cz \
--cc=lczerner@redhat.com \
--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).