diff options
author | Tiger Yang <tiger.yang@oracle.com> | 2009-03-06 10:19:30 +0800 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2009-03-12 16:45:40 -0700 |
commit | 6c9fd1dc0a597e575617a7de7086c8a3efa8f524 (patch) | |
tree | bda5cb32ef359dc97aa71ea73072f534f5c6f99b /fs/ocfs2 | |
parent | ebdcc81c71937b30e09110c02a1e8a21fa770b6f (diff) | |
download | blackbird-op-linux-6c9fd1dc0a597e575617a7de7086c8a3efa8f524.tar.gz blackbird-op-linux-6c9fd1dc0a597e575617a7de7086c8a3efa8f524.zip |
ocfs2: reserve xattr block for new directory with inline data
If this is a new directory with inline data, we choose to
reserve the entire inline area for directory contents and
force an external xattr block.
Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Acked-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/xattr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 4ddd788add67..c63efb5ef136 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c @@ -547,8 +547,12 @@ int ocfs2_calc_xattr_init(struct inode *dir, * when blocksize = 512, may reserve one more cluser for * xattr bucket, otherwise reserve one metadata block * for them is ok. + * If this is a new directory with inline data, + * we choose to reserve the entire inline area for + * directory contents and force an external xattr block. */ if (dir->i_sb->s_blocksize == OCFS2_MIN_BLOCKSIZE || + (S_ISDIR(mode) && ocfs2_supports_inline_data(osb)) || (s_size + a_size) > OCFS2_XATTR_FREE_IN_IBODY) { ret = ocfs2_reserve_new_metadata_blocks(osb, 1, xattr_ac); if (ret) { |