From: Tao Ma <tao.ma@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 3/3] Add inode stealing for ocfs2_reserve_new_inode.V3
Date: Mon Mar 3 18:47:14 2008 [thread overview]
Message-ID: <47CCB7E0.6000402@oracle.com> (raw)
In-Reply-To: <47CCB2F8.3040702@oracle.com>
Sunil Mushran wrote:
> Change comment to:
> /* Start to steal inodes from the first slot after ours. */
>
>> + if (slot == OCFS2_INVALID_SLOT)
>> + slot = osb->slot_num + 1;
>> +
>> + for (i = 0; i < osb->max_slots; i++, slot++) {
>> + if (slot == osb->max_slots)
>> + slot = 0;
>> +
>> + if (slot == osb->slot_num)
>> + continue;
>> +
>> + status = ocfs2_reserve_suballoc_bits(osb, ac,
>> + INODE_ALLOC_SYSTEM_INODE,
>> + slot, NOT_ALLOC_NEW_GROUP);
>> + if (status >= 0) {
>> + ocfs2_set_inode_steal_slot(osb, slot);
>> + break;
>> + }
>> +
>> + ocfs2_free_ac_resource(ac);
>> + }
>> +
>> + return status;
>> +}
>> +
> if (slot == OCFS2_INVALID_SLOT)
> slot = (osb->slot_num + 1 == osb->max_slots) ? 0 : osb->slot_num + 1;
>
> while (slot != osb->slot_num) {
> status = ocfs2_reserve_suballoc_bits(osb, ....);
> ...
> ocfs2_free_ac_resource(ac);
> slot = (slot + 1 == osb->max_slots) ? 0 : slot + 1;
> }
>
> Not that your code is incorrect. Other option is to not use "i"
> and replace continue with a break.
I use "i" because I am always worried about if I can't handle the
condition carefully. :( So you think using "i" is not gracefully, or not
easy to understand, or any other reason?
>
>> int ocfs2_reserve_new_inode(struct ocfs2_super *osb,
>> struct ocfs2_alloc_context **ac)
>> {
>> int status;
>> + s16 slot = ocfs2_get_inode_steal_slot(osb);
>> +#define OCFS2_INODE_STEAL_TIMES 10
>> + static atomic_t inode_steal_times = ATOMIC_INIT(0);
>
> Can you rename inode_steal_times to num_inodes_stolen. BTW, this
> will be for all mounts which is not what we want. Why don't you
> add this to ocfs2_super? s_num_inodes_stolen. In that case, protect
> it using osb_lock.
I forget about this issue and used to think of it is only used in this
function. :( I Will modify it. Thanks.
next prev parent reply other threads:[~2008-03-03 18:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-03 1:00 [Ocfs2-devel] [PATCH 0/3] Add inode stealing in ocfs2.V3 Tao Ma
2008-03-03 1:13 ` [Ocfs2-devel] [PATCH 1/3] Add a new parameter for ocfs2_reserve_suballoc_bits.V3 Tao Ma
2008-03-03 18:32 ` Sunil Mushran
2008-03-03 1:13 ` [Ocfs2-devel] [PATCH 2/3] Add ac_alloc_slot in ocfs2_alloc_context.V3 Tao Ma
2008-03-03 18:25 ` Sunil Mushran
2008-03-03 1:13 ` [Ocfs2-devel] [PATCH 3/3] Add inode stealing for ocfs2_reserve_new_inode.V3 Tao Ma
2008-03-03 18:25 ` Sunil Mushran
2008-03-03 18:47 ` Tao Ma [this message]
2008-03-03 18:57 ` Sunil Mushran
2008-03-03 19:21 ` Tao Ma
2008-03-04 0:55 ` [Ocfs2-devel] [PATCH 3/3] Add inode stealing for ocfs2_reserve_new_inode.V4 Tao Ma
2008-03-04 16:48 ` Mark Fasheh
2008-03-05 0:13 ` [Ocfs2-devel] [PATCH 3/3] Add inode stealing for ocfs2_reserve_new_inode.V5 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=47CCB7E0.6000402@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.