From: tao.ma <tao.ma@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 3/3] Implement "GROUP_ADD" for online resize, take 2
Date: Wed Dec 12 23:06:54 2007 [thread overview]
Message-ID: <4760D978.8080404@oracle.com> (raw)
In-Reply-To: <20071130232004.GF28607@ca-server1.us.oracle.com>
Mark Fasheh wrote:
>
>> + le32_add_cpu(&cr->c_total, input->clusters * cl_bpc);
>> + le32_add_cpu(&cr->c_free, input->frees * cl_bpc);
>> +
>> + le32_add_cpu(&fe->id1.bitmap1.i_total, input->clusters *cl_bpc);
>> + le32_add_cpu(&fe->id1.bitmap1.i_used,
>> + (input->clusters - input->frees) * cl_bpc);
>> + le32_add_cpu(&fe->i_clusters, input->clusters);
>> + le64_add_cpu(&fe->i_size, input->clusters << osb->s_clustersize_bits);
>> +
>> + ret = ocfs2_journal_dirty(handle, main_bm_bh);
>> + if (ret < 0) {
>> + mlog_errno(ret);
>> + goto out_unlock;
>> + }
>> +
>> + ret = ocfs2_commit_trans(osb, handle);
>> + if (ret < 0) {
>> + mlog_errno(ret);
>> + goto out_unlock;
>> + }
>> +
>> + spin_lock(&OCFS2_I(main_bm_inode)->ip_lock);
>> + OCFS2_I(main_bm_inode)->ip_clusters = le32_to_cpu(fe->i_clusters);
>> + spin_unlock(&OCFS2_I(main_bm_inode)->ip_lock);
>>
>
> Need to also update i_size. I think the other patch was missing
> that too...
> --Mark
>
Sorry for the late response. I have been in leave for some days.
Do you mean "fe->i_size" which I have updated above?
If it is, do I need to spin_lock and update "fe->i_size" and
"ip_clusters" in the same time before commit_trans?
I saw some similar codes in suballoc.c.
next prev parent reply other threads:[~2007-12-12 23:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-27 0:12 [Ocfs2-devel] [PATCH 1/3] Add online resize support for ocfs2, take 2 Tao Ma
2007-11-27 0:20 ` [Ocfs2-devel] [PATCH 1/3] Initalize bitmap_cpg of ocfs2_super to be the maximum Tao Ma
2007-11-30 11:47 ` Mark Fasheh
2007-11-27 0:22 ` [Ocfs2-devel] [PATCH 3/3] Implement "GROUP_ADD" for online resize, take 2 Tao Ma
2007-11-30 15:21 ` Mark Fasheh
2007-12-02 18:08 ` tao.ma
2007-12-03 19:24 ` Mark Fasheh
2007-12-12 23:06 ` tao.ma [this message]
2007-11-27 0:23 ` [Ocfs2-devel] [PATCH 2/3] Add group extend " Tao Ma
2007-11-27 17:34 ` tao.ma
2007-11-30 11:42 ` Mark Fasheh
2007-11-30 15:43 ` [Ocfs2-devel] [PATCH 1/3] Add online resize support for ocfs2, " Mark Fasheh
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=4760D978.8080404@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.