From: Boaz Harrosh <bharrosh@panasas.com>
To: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
Cc: Peng Tao <bergwolf@gmail.com>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
Peng Tao <tao.peng@emc.com>
Subject: Re: [PATCH-v2 2/3] NFS41: send real write size in layoutget
Date: Tue, 14 Aug 2012 13:57:10 +0300 [thread overview]
Message-ID: <502A2F06.7070409@panasas.com> (raw)
In-Reply-To: <4FA345DA4F4AE44899BD2B03EEEC2FA93A0828@SACEXCMBX04-PRD.hq.netapp.com>
On 08/14/2012 03:42 AM, Myklebust, Trond wrote:
<>
>> void
>> pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio, struct nfs_page *req)
>> {
>> + u64 wb_size;
>> + unsigned policy = NFS_SERVER(pgio->pg_inode)->pnfs_curr_ld->flags &
>> + PNFS_LAYOUTGET_POLICY_MASK;
>> +
>> BUG_ON(pgio->pg_lseg != NULL);
>>
>> if (req->wb_offset != req->wb_pgbase) {
>> nfs_pageio_reset_write_mds(pgio);
>> return;
>> }
>> +
>> + if (pgio->pg_dreq == NULL) {
>> + switch(policy) {
>> + case PNFS_LAYOUTGET_ISIZE:
>> + wb_size = i_size_read(pgio->pg_inode) - req_offset(req);
>> + break;
>> + case PNFS_LAYOUTGET_SEARCH_HOLE:
>> + wb_size = pnfs_num_cont_bytes(pgio->pg_inode, req->wb_index);
>> + break;
>> + case PNFS_LAYOUTGET_ALL_FILE:
>> + wb_size = NFS4_MAX_UINT64;
>> + break;
>> + default:
>> + WARN_ONCE(1, "invalid layoutget policy %u", policy);
>> + wb_size = PAGE_CACHE_SIZE;
>> + break;
>> + }
>> + } else {
>> + wb_size = nfs_dreq_bytes_left(pgio->pg_dreq);
>> + }
>> +
>
> Please just calculate the correct value for wb_size inside
> bl_pg_init_write(), and pass it as an extra parameter to
> pnfs_generic_pg_init_write().
>
> Then add pnfs_pg_init_object_write for objects, that calls the modified
> pnfs_generic_pg_init_write() with the PNFS_LAYOUTGET_ISIZE value.
>
Lets please completely kill pnfs_generic_pg_init_write() just like
files did. It gives us nothing and specialty now it is more compact
code to just inline it, like nfs4filelayout.c did.
But please do this on top of my pending patches for 3.6-rcX. They touch
exactly this code in objects.
> Files don't call this function, so adding the PNFS_LAYOUTGET_ALL_FILE
> isn't needed.
BTW:
filelayout_pg_init_read()
and
pnfs_generic_pg_init_read()
Is char-by-char Identical, except the very good added comment in
filelayout_pg_init_read(). Can be merged.
Thanks
Boaz
next prev parent reply other threads:[~2012-08-14 10:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-13 14:39 [PATCH-v2 1/3] NFS: track direct IO left bytes Peng Tao
2012-08-13 14:39 ` [PATCH-v2 2/3] NFS41: send real write size in layoutget Peng Tao
2012-08-13 23:53 ` Boaz Harrosh
2012-08-14 10:05 ` Peng, Tao
2012-08-14 0:42 ` Myklebust, Trond
2012-08-14 10:08 ` Peng, Tao
2012-08-14 10:57 ` Boaz Harrosh [this message]
2012-08-14 11:21 ` Peng, Tao
2012-08-13 14:39 ` [PATCH-v2 3/3] NFS41: send real read " Peng Tao
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=502A2F06.7070409@panasas.com \
--to=bharrosh@panasas.com \
--cc=Trond.Myklebust@netapp.com \
--cc=bergwolf@gmail.com \
--cc=linux-nfs@vger.kernel.org \
--cc=tao.peng@emc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).