From: Tao Ma <tao.ma@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 09/13] ocfs2: Take ocfs2_xattr_bucket structures off of the stack.
Date: Tue, 28 Oct 2008 10:24:38 +0800 [thread overview]
Message-ID: <490677E6.7050004@oracle.com> (raw)
In-Reply-To: <1225156828-32189-10-git-send-email-joel.becker@oracle.com>
Joel Becker wrote:
> The ocfs2_xattr_bucket structure is a nice abstraction, but it is a bit
> large to have on the stack. Just like ocfs2_path, let's allocate it
> with a ocfs2_xattr_bucket_new() function.
>
> We can now store the inode on the bucket, cleaning up all the other
> bucket functions. While we're here, we catch another place or two that
> wasn't using ocfs2_read_xattr_bucket().
>
> Signed-off-by: Joel Becker <joel.becker@oracle.com>
> @@ -2042,6 +2074,18 @@ int ocfs2_xattr_set(struct inode *inode,
> if (!ocfs2_supports_xattr(OCFS2_SB(inode->i_sb)))
> return -EOPNOTSUPP;
>
> + xis.bucket = ocfs2_xattr_bucket_new(inode);
> + if (!xis.bucket) {
> + mlog_errno(-ENOMEM);
> + return -ENOMEM;
> + }
xis is used for xattr search in inode, so we don't need to allocate bucket.
> + xbs.bucket = ocfs2_xattr_bucket_new(inode);
> + if (!xbs.bucket) {
> + ocfs2_xattr_bucket_free(xbs.bucket);
> + mlog_errno(-ENOMEM);
> + return -ENOMEM;
> + }
can we allocate this only when we really need this? that means we may
allocate it in ocfs2_create_index_block(when we create a new one) and
ocfs2_xattr_index_block_find if there is some buckets exist?
Regards,
Tao
next prev parent reply other threads:[~2008-10-28 2:24 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-28 1:20 [Ocfs2-devel] [PATCH 0/13] ocfs2: xattr bucket API Joel Becker
2008-10-28 1:20 ` [Ocfs2-devel] [PATCH 01/13] ocfs2: Field prefixes for the xattr_bucket structure Joel Becker
2008-10-28 1:20 ` [Ocfs2-devel] [PATCH 02/13] ocfs2: Convenient access to an xattr bucket's block number Joel Becker
2008-10-28 1:20 ` [Ocfs2-devel] [PATCH 03/13] ocfs2: Convenient access to xattr bucket data blocks Joel Becker
2008-10-28 1:20 ` [Ocfs2-devel] [PATCH 04/13] ocfs2: Convenient access to an xattr bucket's header Joel Becker
2008-10-28 1:20 ` [Ocfs2-devel] [PATCH 05/13] ocfs2: Provide a wrapper to brelse() xattr bucket buffers Joel Becker
2008-10-28 1:20 ` [Ocfs2-devel] [PATCH 06/13] ocfs2: Improve ocfs2_read_xattr_bucket() Joel Becker
2008-10-28 2:44 ` Tao Ma
2008-10-28 6:14 ` Joel Becker
2008-10-28 6:25 ` Tao Ma
2008-10-28 1:20 ` [Ocfs2-devel] [PATCH 07/13] ocfs2: Wrap journal_access/journal_dirty for xattr buckets Joel Becker
2008-10-28 1:20 ` [Ocfs2-devel] [PATCH 08/13] ocfs2: Copy xattr buckets with a dedicated function Joel Becker
2008-10-28 1:20 ` [Ocfs2-devel] [PATCH 09/13] ocfs2: Take ocfs2_xattr_bucket structures off of the stack Joel Becker
2008-10-28 1:50 ` Tao Ma
2008-10-28 1:53 ` Joel Becker
2008-10-28 2:24 ` Tao Ma [this message]
2008-10-28 6:16 ` Joel Becker
2008-10-28 1:20 ` [Ocfs2-devel] [PATCH 10/13] ocfs2: Use buckets in ocfs2_xattr_bucket_find() Joel Becker
2008-10-28 1:20 ` [Ocfs2-devel] [PATCH 11/13] ocfs2: Use buckets in ocfs2_xattr_create_index_block() Joel Becker
2008-10-28 1:20 ` [Ocfs2-devel] [PATCH 12/13] ocfs2: Use buckets in ocfs2_defrag_xattr_bucket() Joel Becker
2008-10-28 1:20 ` [Ocfs2-devel] [PATCH 13/13] ocfs2: Use buckets in ocfs2_xattr_set_entry_in_bucket() Joel Becker
2008-11-07 21:21 ` [Ocfs2-devel] [PATCH 0/13] ocfs2: xattr bucket API Mark Fasheh
2008-11-07 21:36 ` 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=490677E6.7050004@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.