From: TaoMa <tao.ma@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 07/10] ocfs2: Determine an extent tree's max_leaf_clusters in an et_op.
Date: Thu, 21 Aug 2008 12:13:15 +0800 [thread overview]
Message-ID: <48ACEB5B.5030903@oracle.com> (raw)
In-Reply-To: <1219286905-28104-8-git-send-email-joel.becker@oracle.com>
Joel Becker wrote:
> Provide an optional extent_tree_operation to specify the
> max_leaf_clusters of an ocfs2_extent_tree. If not provided, the value
> is 0 (unlimited).
>
> Signed-off-by: Joel Becker <joel.becker@oracle.com>
> ---
> fs/ocfs2/alloc.c | 18 +++++++++++++++---
> 1 files changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
> index 0b900f6..7c0721d 100644
> --- a/fs/ocfs2/alloc.c
> +++ b/fs/ocfs2/alloc.c
> @@ -76,6 +76,8 @@ struct ocfs2_extent_tree_operations {
> /* These are internal to ocfs2_extent_tree and don't have
> * accessor functions */
> void (*eo_fill_root_el)(struct ocfs2_extent_tree *et);
> + void (*eo_fill_max_leaf_clusters)(struct inode *inode,
> + struct ocfs2_extent_tree *et);
> };
>
> struct ocfs2_extent_tree {
> @@ -205,6 +207,14 @@ static void ocfs2_xattr_tree_fill_root_el(struct ocfs2_extent_tree *et)
> et->et_root_el = &xb->xb_attrs.xb_root.xt_list;
> }
>
> +static void ocfs2_xattr_tree_fill_max_leaf_clusters(struct inode *inode,
> + struct ocfs2_extent_tree *et)
> +{
> + et->et_max_leaf_clusters =
> + ocfs2_clusters_for_bytes(inode->i_sb,
> + OCFS2_MAX_XATTR_TREE_LEAF_SIZE);
> +}
> +
> static void ocfs2_xattr_tree_set_last_eb_blk(struct ocfs2_extent_tree *et,
> u64 blkno)
> {
> @@ -243,6 +253,7 @@ static struct ocfs2_extent_tree_operations ocfs2_xattr_tree_et_ops = {
> .eo_update_clusters = ocfs2_xattr_tree_update_clusters,
> .eo_sanity_check = ocfs2_xattr_tree_sanity_check,
> .eo_fill_root_el = ocfs2_xattr_tree_fill_root_el,
> + .eo_fill_max_leaf_clusters = ocfs2_xattr_tree_fill_max_leaf_clusters,
> };
>
> static void ocfs2_get_extent_tree(struct ocfs2_extent_tree *et,
> @@ -254,7 +265,6 @@ static void ocfs2_get_extent_tree(struct ocfs2_extent_tree *et,
> et->et_type = et_type;
> get_bh(bh);
> et->et_root_bh = bh;
> - et->et_max_leaf_clusters = 0;
> if (!obj)
> obj = (void *)bh->b_data;
> et->et_object = obj;
> @@ -265,11 +275,13 @@ static void ocfs2_get_extent_tree(struct ocfs2_extent_tree *et,
> et->et_ops = &ocfs2_xattr_et_ops;
> } else if (et_type == OCFS2_XATTR_TREE_EXTENT) {
> et->et_ops = &ocfs2_xattr_tree_et_ops;
> - et->et_max_leaf_clusters = ocfs2_clusters_for_bytes(inode->i_sb,
> - OCFS2_MAX_XATTR_TREE_LEAF_SIZE);
> }
>
> et->et_ops->eo_fill_root_el(et);
> + if (!et->et_ops->eo_fill_max_leaf_clusters)
> + et->et_max_leaf_clusters = 0;
> + else
> + et->et_ops->eo_fill_max_leaf_clusters(inode, et);
> }
>
Like what you have done in patch 1/10, maybe we can add a small wrapper
named ocfs2_et_fill_max_leaf_clusters for this?
Regards,
Tao
next prev parent reply other threads:[~2008-08-21 4:13 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-21 2:48 [Ocfs2-devel] [PATCH 0/10] Make ocfs2_extent_tree a first-class object Joel Becker
2008-08-21 2:48 ` [Ocfs2-devel] [PATCH 01/10] ocfs2: Prefix the extent tree operations structure Joel Becker
2008-08-21 3:47 ` TaoMa
2008-08-21 2:48 ` [Ocfs2-devel] [PATCH 02/10] ocfs2: Prefix the ocfs2_extent_tree structure Joel Becker
2008-08-21 3:46 ` TaoMa
2008-08-21 2:48 ` [Ocfs2-devel] [PATCH 03/10] ocfs2: Make ocfs2_extent_tree get/put instead of alloc Joel Becker
2008-08-21 3:55 ` TaoMa
2008-08-21 6:19 ` Joel Becker
2008-08-21 22:10 ` Mark Fasheh
2008-08-21 23:05 ` Joel Becker
2008-08-21 23:11 ` Mark Fasheh
2008-08-21 23:27 ` Joel Becker
2008-08-21 2:48 ` [Ocfs2-devel] [PATCH 04/10] ocfs2: Make 'private' into 'object' on ocfs2_extent_tree Joel Becker
2008-08-21 4:00 ` TaoMa
2008-08-21 2:48 ` [Ocfs2-devel] [PATCH 05/10] ocfs2: Provide the get_root_el() method to ocfs2_extent_tree_operations Joel Becker
2008-08-21 4:07 ` TaoMa
2008-08-21 6:20 ` Joel Becker
2008-08-21 2:48 ` [Ocfs2-devel] [PATCH 06/10] ocfs2: Use struct ocfs2_extent_tree in ocfs2_num_free_extents() Joel Becker
2008-08-21 4:10 ` TaoMa
2008-08-21 6:21 ` Joel Becker
2008-08-21 8:08 ` TaoMa
2008-08-21 2:48 ` [Ocfs2-devel] [PATCH 07/10] ocfs2: Determine an extent tree's max_leaf_clusters in an et_op Joel Becker
2008-08-21 4:13 ` TaoMa [this message]
2008-08-21 6:23 ` Joel Becker
2008-08-21 22:25 ` Mark Fasheh
2008-08-21 23:29 ` Joel Becker
2008-08-22 0:12 ` Joel Becker
2008-08-21 2:48 ` [Ocfs2-devel] [PATCH 08/10] ocfs2: Create specific get_extent_tree functions Joel Becker
2008-08-21 8:03 ` TaoMa
2008-08-21 2:48 ` [Ocfs2-devel] [PATCH 09/10] ocfs2: Add an insertion check to ocfs2_extent_tree_operations Joel Becker
2008-08-21 4:29 ` TaoMa
2008-08-21 6:26 ` Joel Becker
2008-08-21 22:52 ` Mark Fasheh
2008-08-21 23:25 ` Joel Becker
2008-08-21 23:52 ` Mark Fasheh
2008-08-21 2:48 ` [Ocfs2-devel] [PATCH 10/10] ocfs2: Make ocfs2_extent_tree the first-class representation of a tree Joel Becker
2008-08-21 7:46 ` TaoMa
2008-08-21 17:46 ` Joel Becker
2008-08-21 3:45 ` [Ocfs2-devel] [PATCH 0/10] Make ocfs2_extent_tree a first-class object TaoMa
2008-08-21 4:28 ` Joel Becker
2008-08-21 4:45 ` Mark Fasheh
2008-08-21 6:26 ` Joel Becker
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=48ACEB5B.5030903@oracle.com \
--to=tao.ma@oracle.com \
--cc=ocfs2-devel@oss.oracle.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.