All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tao Ma <tao.ma@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 08/18] ocfs2: Use metadata-specific ocfs2_journal_access_*() functions.
Date: Thu, 11 Dec 2008 08:31:09 +0800	[thread overview]
Message-ID: <49405F4D.60302@oracle.com> (raw)
In-Reply-To: <20081210111540.GB16888@ca-server1.us.oracle.com>



Joel Becker wrote:
> 
>>> @@ -1918,25 +1966,23 @@ static int ocfs2_rotate_subtree_right(struct inode 
>>> *inode,
>>>  	root_bh = left_path->p_node[subtree_index].bh;
>>>  	BUG_ON(root_bh != right_path->p_node[subtree_index].bh);
>>>  -	ret = ocfs2_journal_access(handle, inode, root_bh,
>>> -				   OCFS2_JOURNAL_ACCESS_WRITE);
>>> +	ret = ocfs2_path_bh_journal_access(handle, inode, right_path,
>>> +					   subtree_index);
>>>  	if (ret) {
>>>  		mlog_errno(ret);
>>>  		goto out;
>>>  	}
>>>   	for(i = subtree_index + 1; i < path_num_items(right_path); i++) {
>>> -		ret = ocfs2_journal_access(handle, inode,
>>> -					   right_path->p_node[i].bh,
>>> -					   OCFS2_JOURNAL_ACCESS_WRITE);
>>> +		ret = ocfs2_path_bh_journal_access(handle, inode,
>>> +						   right_path, i);
>>>  		if (ret) {
>>>  			mlog_errno(ret);
>>>  			goto out;
>>>  		}
>>>  -		ret = ocfs2_journal_access(handle, inode,
>>> -					   left_path->p_node[i].bh,
>>> -					   OCFS2_JOURNAL_ACCESS_WRITE);
>>> +		ret = ocfs2_path_bh_journal_access(handle, inode,
>>> +						   left_path, i);
>> I guess when can use ocfs2_journal_access_eb directly since it is 
>> "subtree_index+1" now. No chance of be the root. The same goes for 
>> ocfs2_rotate_subtree_left, ocfs2_merge_rec_right, ocfs2_merge_rec_left.
> 
> 	But then you start dereferencing the path bh list.  That's
> breaks the abstraction of the path structure.  It also drops the
> consistency of always using ocfs2_path_bh_journal_access() for paths.
> Conversely, there is no real loss to calling
> ocfs2_path_bh_journal_access(); the extra function call is
> insignificant.
fail enough. actually this piece of code make me think of the use of 
ocfs2_journal_access_eb.
in ocfs2_rotate_subtree_left:
	if (le16_to_cpu(right_leaf_el->l_next_free_rec) > 1) {
		ret = ocfs2_journal_access_eb(handle, inode,
					path_leaf_bh(right_path),
					OCFS2_JOURNAL_ACCESS_WRITE);
So according to your policy, we should change it to 
ocfs2_path_bh_journal_access also? ;)

> 
>>> @@ -4594,8 +4633,8 @@ int ocfs2_add_clusters_in_btree(struct ocfs2_super 
>>> *osb,
>>>  	BUG_ON(num_bits > clusters_to_add);
>>>   	/* reserve our write early -- insert_extent may update the inode */
>>> -	status = ocfs2_journal_access(handle, inode, et->et_root_bh,
>>> -				      OCFS2_JOURNAL_ACCESS_WRITE);
>>> +	status = ocfs2_et_root_journal_access(handle, inode, et,
>>> +					      OCFS2_JOURNAL_ACCESS_WRITE);
>> This is really a good chance for us to modify the comments also. ;)
> 
> 	You mean something like 'may update the tree root'?
yeah.

Regards,
Tao

  reply	other threads:[~2008-12-11  0:31 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-10  1:09 [Ocfs2-devel] [PATCH 0/18] ocfs2: Add metadata ECC - almost there Joel Becker
2008-12-10  1:09 ` [PATCH 01/18] jbd2: Add buffer triggers Joel Becker
2008-12-10  1:09   ` [Ocfs2-devel] " Joel Becker
2008-12-11 19:57   ` Andreas Dilger
2008-12-13  0:45   ` Joel Becker
2008-12-13  0:45     ` [Ocfs2-devel] " Joel Becker
2008-12-18 18:08     ` Jan Kara
2008-12-18 18:08       ` Jan Kara
2008-12-19  0:32       ` Joel Becker
2008-12-19  0:32         ` [Ocfs2-devel] " Joel Becker
2008-12-19  0:40         ` Jan Kara
2008-12-19  0:40           ` Jan Kara
2008-12-19  1:43           ` Joel Becker
2008-12-19  1:43             ` [Ocfs2-devel] " Joel Becker
2008-12-10  1:09 ` [Ocfs2-devel] [PATCH 02/18] ocfs2: Add the on-disk structures for metadata checksums Joel Becker
2008-12-10  1:32   ` Tao Ma
2008-12-10  1:40     ` Joel Becker
2008-12-10  1:09 ` [Ocfs2-devel] [PATCH 03/18] ocfs2: Add the underlying blockcheck code Joel Becker
2008-12-10  1:09 ` [Ocfs2-devel] [PATCH 04/18] ocfs2: Add a validation hook for quota block reads Joel Becker
2008-12-10  1:09 ` [Ocfs2-devel] [PATCH 05/18] ocfs2: block read meta ecc Joel Becker
2008-12-10  1:09 ` [Ocfs2-devel] [PATCH 06/18] ocfs2: Add journal_access functions with jbd2 triggers Joel Becker
2008-12-10  1:09 ` [Ocfs2-devel] [PATCH 07/18] ocfs2: Wrap up the common use cases of ocfs2_new_path() Joel Becker
2008-12-10  1:09 ` [Ocfs2-devel] [PATCH 08/18] ocfs2: Use metadata-specific ocfs2_journal_access_*() functions Joel Becker
2008-12-10  2:31   ` Tao Ma
2008-12-10 11:15     ` Joel Becker
2008-12-11  0:31       ` Tao Ma [this message]
2008-12-11  0:46         ` Joel Becker
2008-12-11  1:10           ` Tao Ma
2008-12-10  1:09 ` [Ocfs2-devel] [PATCH 09/18] ocfs2: Add ecc and checksums to ocfs2 xattr buckets Joel Becker
2008-12-10  1:09 ` [Ocfs2-devel] [PATCH 10/18] ocfs2: Create ocfs2_xattr_value_buf Joel Becker
2008-12-10  1:09 ` [Ocfs2-devel] [PATCH 11/18] ocfs2: Pull ocfs2_xattr_value_buf up from __ocfs2_remove_xattr_range() Joel Becker
2008-12-10  1:09 ` [Ocfs2-devel] [PATCH 12/18] ocfs2: Pull ocfs2_xattr_value_buf up into ocfs2_xattr_value_truncate() Joel Becker
2008-12-10  1:09 ` [Ocfs2-devel] [PATCH 13/18] ocfs2: Pass ocfs2_xattr_value_buf " Joel Becker
2008-12-10  1:09 ` [Ocfs2-devel] [PATCH 14/18] ocfs2: Pass value buf to ocfs2_xattr_update_entry() Joel Becker
2008-12-10  1:09 ` [Ocfs2-devel] [PATCH 15/18] ocfs2: Use ocfs2_xattr_value_buf in ocfs2_xattr_set_entry() Joel Becker
2008-12-10  1:09 ` [Ocfs2-devel] [PATCH 16/18] ocfs2: Pass value buf to ocfs2_remove_value_outside() Joel Becker
2008-12-10  1:09 ` [Ocfs2-devel] [PATCH 17/18] ocfs2: Use proper journal_access function in xattr.c Joel Becker
2008-12-10  1:09 ` [Ocfs2-devel] [PATCH 18/18] ocfs2: Enable metadata checksums Joel Becker
2008-12-10  1:52 ` [Ocfs2-devel] [PATCH 0/18] ocfs2: Add metadata ECC - almost there Joel Becker
2008-12-10 12:54 ` Andi Kleen
2008-12-10 18:15   ` Joel Becker
2008-12-10 19:27     ` Andi Kleen
2008-12-11  2:16 ` Joel Becker
2008-12-11  2:25   ` [Ocfs2-devel] [PATCH] ocfs2: Add directory block trailers Joel Becker
2008-12-11  2:25   ` [Ocfs2-devel] [PATCH] ocfs2: Checksum and ECC for directory blocks Joel Becker
2008-12-11  2:46 ` [Ocfs2-devel] [PATCH 0/18] ocfs2: Add metadata ECC - almost there Tao Ma

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=49405F4D.60302@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.