From: Tao Ma <tao.ma@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/4] ocfs2: Add struct file to ocfs2_refcount_cow.
Date: Wed, 30 Jun 2010 11:11:47 +0800 [thread overview]
Message-ID: <4C2AB5F3.10000@oracle.com> (raw)
In-Reply-To: <20100629231453.GH4150@mail.oracle.com>
Hi Joel,
On 06/30/2010 07:14 AM, Joel Becker wrote:
> On Tue, Jun 29, 2010 at 04:35:38PM +0800, Tao Ma wrote:
>> Add a new parameter 'struct file *' to ocfs2_refcount_cow
>> so that we can add readahead support later.
>>
>> Signed-off-by: Tao Ma<tao.ma@oracle.com>
>> ---
>> fs/ocfs2/aops.c | 2 +-
>> fs/ocfs2/file.c | 13 ++++++++-----
>> fs/ocfs2/refcounttree.c | 4 +++-
>> fs/ocfs2/refcounttree.h | 3 ++-
>> 4 files changed, 14 insertions(+), 8 deletions(-)
>>
>> diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
>> index 4dfaa6e..5f94923 100644
>> --- a/fs/ocfs2/aops.c
>> +++ b/fs/ocfs2/aops.c
>> @@ -1691,7 +1691,7 @@ int ocfs2_write_begin_nolock(struct address_space *mapping,
>> mlog_errno(ret);
>> goto out;
>> } else if (ret == 1) {
>> - ret = ocfs2_refcount_cow(inode, di_bh,
>> + ret = ocfs2_refcount_cow(inode, NULL, di_bh,
>> wc->w_cpos, wc->w_clen, UINT_MAX);
>
> You should be replacing the inode parameter with the file
> parameter. You can always get back to the inode from the filp. When I
> first saw this, I had to read through your entire series to figure out
> if a NULL filp was valid. It's not. In the end, you change
> write_begin_nolock() to take (inode, filp), which is pointless, because
> write_begin() always gets a valid filp. So does page_mkwrite().
> So in your first patch of the series, change
> ocfs2_write_begin_nolock() and __ocfs2_page_mkwrite() to take the filp
> instead of the inode. Then in your later patches you can always expect
> the filp to be valid.
oh, sorry joel. There does exist one place that we don't have filp. It
is in ocfs2_orphan_for_truncate, we have to CoW the cluster containing
i_size and pass NULL as filp.
Regards,
Tao
next prev parent reply other threads:[~2010-06-30 3:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-29 8:27 [Ocfs2-devel] [PATCH 0/4] Add readahead support in CoW for reflinked files Tao Ma
2010-06-29 8:35 ` [Ocfs2-devel] [PATCH 1/4] ocfs2: Add struct file to ocfs2_refcount_cow Tao Ma
2010-06-29 23:14 ` Joel Becker
2010-06-30 1:34 ` Tao Ma
2010-06-30 3:11 ` Tao Ma [this message]
2010-06-30 12:00 ` Joel Becker
2010-07-01 0:17 ` Tao Ma
2010-07-01 9:12 ` Joel Becker
2010-07-01 9:20 ` Tao Ma
2010-06-29 8:35 ` [Ocfs2-devel] [PATCH 2/4] ocfs2: Add readahead support for CoW Tao Ma
2010-06-29 8:35 ` [Ocfs2-devel] [PATCH 3/4] ocfs2: Add readhead during CoW Tao Ma
2010-06-29 23:23 ` Joel Becker
2010-06-30 1:46 ` Tao Ma
2010-06-29 8:35 ` [Ocfs2-devel] [PATCH 4/4] ocfs2: make mmap CoW work with readahead Tao Ma
2010-06-29 23:24 ` 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=4C2AB5F3.10000@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.