[Ocfs2-tools-devel] [PATCH 1/2] merge ocfs2_fs.h from upstream, v2
Tao Ma
tao.ma at oracle.com
Mon Dec 7 22:29:16 PST 2009
Coly Li wrote:
> This patch merges upstream fs/ocfs2/ocfs2_fs.h header file into include/ocfs2-kernel/ocfs2_fs.h, while untouching the
> SUPP definition.
>
> The merged header is helpful to support new features like indexed-dir or reflink in user space tools.
actually I am working on implementing user space support for reflink and
disk layout for reflink is one patch in a large series, but I have no
objection to include it in your patch here. I can remove my patch from
the patch set.
>
> Signed-off-by: Coly Li <coly.li at suse.de>
> Cc: Joel Becker <joel.becker at oracle.com>
> ---
> include/ocfs2-kernel/ocfs2_fs.h | 241 +++++++++++++++++++++++++++++++++++++--
> 1 files changed, 229 insertions(+), 12 deletions(-)
>
<snip>
> @@ -1074,12 +1241,6 @@ static inline int ocfs2_fast_symlink_chars(struct super_block *sb)
> offsetof(struct ocfs2_dinode, id2.i_symlink);
> }
>
> -static inline int ocfs2_max_inline_data(struct super_block *sb)
> -{
> - return sb->s_blocksize -
> - offsetof(struct ocfs2_dinode, id2.i_data.id_data);
> -}
> -
> static inline int ocfs2_max_inline_data_with_xattr(struct super_block *sb,
> struct ocfs2_dinode *di)
> {
> @@ -1122,6 +1283,16 @@ static inline int ocfs2_extent_recs_per_inode_with_xattr(
> return size / sizeof(struct ocfs2_extent_rec);
> }
>
> +static inline int ocfs2_extent_recs_per_dx_root(struct super_block *sb)
> +{
> + int size;
> +
> + size = sb->s_blocksize -
> + offsetof(struct ocfs2_dx_root_block, dr_list.l_recs);
> +
> + return size / sizeof(struct ocfs2_extent_rec);
> +}
> +
> static inline int ocfs2_chain_recs_per_inode(struct super_block *sb)
> {
> int size;
> @@ -1142,6 +1313,26 @@ static inline u16 ocfs2_extent_recs_per_eb(struct super_block *sb)
> return size / sizeof(struct ocfs2_extent_rec);
> }
>
> +static inline int ocfs2_dx_entries_per_leaf(struct super_block *sb)
> +{
> + int size;
> +
> + size = sb->s_blocksize -
> + offsetof(struct ocfs2_dx_leaf, dl_list.de_entries);
> +
> + return size / sizeof(struct ocfs2_dx_entry);
> +}
> +
> +static inline int ocfs2_dx_entries_per_root(struct super_block *sb)
> +{
> + int size;
> +
> + size = sb->s_blocksize -
> + offsetof(struct ocfs2_dx_root_block, dr_entries.de_entries);
> +
> + return size / sizeof(struct ocfs2_dx_entry);
> +}
> +
Since you added the kernel part, could you please also add the functions
for the userspace part?
I mean function
ocfs2_dx_entries_per_root(int blocksize).
Or you have a plan to add it together with your implementation of dx_dir
for userspace? I want to make sure because you also add the function for
refcount block below, if you don't want to add them(functions with
blocksize as the parameter), I need to preserve it in my patch.
Regards,
Tao
> static inline u16 ocfs2_local_alloc_size(struct super_block *sb)
> {
> u16 size;
> @@ -1196,6 +1387,32 @@ static inline u16 ocfs2_xattr_recs_per_xb(struct super_block *sb)
>
> return size / sizeof(struct ocfs2_extent_rec);
> }
> +
> +static inline u16 ocfs2_extent_recs_per_rb(struct super_block *sb)
> +{
> + int size;
> +
> + size = sb->s_blocksize -
> + offsetof(struct ocfs2_refcount_block, rf_list.l_recs);
> +
> + return size / sizeof(struct ocfs2_extent_rec);
> +}
> +
> +static inline u16 ocfs2_refcount_recs_per_rb(struct super_block *sb)
> +{
> + int size;
> +
> + size = sb->s_blocksize -
> + offsetof(struct ocfs2_refcount_block, rf_records.rl_recs);
> +
> + return size / sizeof(struct ocfs2_refcount_rec);
> +}
> +
> +static inline u32
> +ocfs2_get_ref_rec_low_cpos(const struct ocfs2_refcount_rec *rec)
> +{
> + return le64_to_cpu(rec->r_cpos) & OCFS2_32BIT_POS_MASK;
> +}
> #else
> static inline int ocfs2_fast_symlink_chars(int blocksize)
> {
More information about the Ocfs2-tools-devel
mailing list