From: Joel Becker <Joel.Becker@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 06/13] ocfs2: Improve ocfs2_read_xattr_bucket().
Date: Mon, 27 Oct 2008 23:14:53 -0700 [thread overview]
Message-ID: <20081028061453.GA7778@ca-server1.us.oracle.com> (raw)
In-Reply-To: <49067C93.3050307@oracle.com>
On Tue, Oct 28, 2008 at 10:44:35AM +0800, Tao Ma wrote:
> Joel Becker wrote:
>> @@ -3128,7 +3145,7 @@ static int ocfs2_half_xattr_bucket(struct inode
>> *inode,
>> int ret, i;
>> u16 count, start, len, name_value_len, xe_len, name_offset;
>> u16 blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb);
>> - struct buffer_head **s_bhs, **t_bhs = NULL;
>> + struct ocfs2_xattr_bucket s_bucket, t_bucket;
>> struct ocfs2_xattr_header *xh;
>> struct ocfs2_xattr_entry *xe;
>> int blocksize = inode->i_sb->s_blocksize;
> snip
>> - t_bhs = kcalloc(blk_per_bucket, sizeof(struct buffer_head *), GFP_NOFS);
>> - if (!t_bhs) {
>> - ret = -ENOMEM;
>> - goto out;
>> - }
>> -
>> - ret = ocfs2_read_xattr_bucket(inode, new_blk, t_bhs, new_bucket_head);
>> + /*
>> + * Even if !new_bucket_head, we're overwriting t_bucket. Thus,
>> + * there's no need to read it.
>> + */
>> + ret = ocfs2_init_xattr_bucket(inode, &t_bucket, new_blk);
>> if (ret) {
>> mlog_errno(ret);
>> goto out;
>> }
>> for (i = 0; i < blk_per_bucket; i++) {
>> - ret = ocfs2_journal_access(handle, inode, t_bhs[i],
>> + ret = ocfs2_journal_access(handle, inode, t_bucket.bu_bhs[i],
>> new_bucket_head ?
>> OCFS2_JOURNAL_ACCESS_CREATE :
>> OCFS2_JOURNAL_ACCESS_WRITE);
> I have read the caller of ocfs2_half_xattr_bucket again. In
> ocfs2_extend_xattr_bucket when we want to half the bucket to a never-used
> new bucket within the same cluster(while we always pass new_bucket_head=0),
> do we need to use OCFS2_JOURNAL_ACCESS_CREATE? If yes, maybe we have to
> modify the caller to be more precisely(I can handle this based on your
> patch set). The same goes for ocfs2_cp_xattr_bucket.
Mark and I were discussing this on #ocfs2 just today. We were
having a hard time understanding the condition of the bucket - what
new_bucket_head really means. This comes from my patch to set the
JOURNAL_ACCESS based on the new_bucket_head value (same in
cp_xattr_bucket).
Is the target bucket (t_bucket) always in the same cluster for
all callers regardless of new_bucket_head? Has it ever been written
before? May it have been allocated a long time ago?
Joel
--
Life's Little Instruction Book #497
"Go down swinging."
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
next prev parent reply other threads:[~2008-10-28 6:14 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 [this message]
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
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=20081028061453.GA7778@ca-server1.us.oracle.com \
--to=joel.becker@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.