Re: [PATCH 14/24] pnfs_submit: use fsdata to pass lseg

Fred Isaman
2010-06-09T12:08:42Z

On Wed, Jun 9, 2010 at 6:38 AM, Benny Halevy <bhalevy@panasas.com> wrot=
e:
> Fred, how does that patch interact with
> 285052f pnfs_post_submit: Restore "pnfs: pnfs_do_flush"
> and the latter patches that depend on it?
>
> Benny
>

They will have to be modified. I'll look at that today.

=46red

> On Jun. 08, 2010, 7:19 +0300, Fred Isaman <iisaman@netapp.com> wrote:
>> Preparing for LAYUTGET invocation in nfs_write_begin to be the
>> only invocation in the write path.
>>
>> It isn't used at all yet, but it should be properly referenced/deref=
erenced
>>
>> Signed-off-by: Fred Isaman <iisaman@netapp.com>
>> ---
>> =A0fs/nfs/file.c | =A0 16 +++++++++++++---
>> =A01 files changed, 13 insertions(+), 3 deletions(-)
>>
>> diff --git a/fs/nfs/file.c b/fs/nfs/file.c
>> index 03601d2..fde6cb5 100644
>> --- a/fs/nfs/file.c
>> +++ b/fs/nfs/file.c
>> @@ -420,6 +420,8 @@ static int nfs_write_begin(struct file *file, st=
ruct address_space *mapping,
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 file->f_path.dentry->d_name.name,
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 mapping->host->i_ino, len, (long long) p=
os);
>>
>> + =A0 =A0 pnfs_update_layout(mapping->host, NULL, NFS4_MAX_UINT64, 0=
, IOMODE_RW,
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(struct pnfs_layout=
_segment **) fsdata);
>> =A0start:
>> =A0 =A0 =A0 /*
>> =A0 =A0 =A0 =A0* Prevent starvation issues if someone is doing a con=
sistency
>> @@ -428,11 +430,13 @@ start:
>> =A0 =A0 =A0 ret =3D wait_on_bit(&NFS_I(mapping->host)->flags, NFS_IN=
O_FLUSHING,
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 nfs_wait_bit_killable, T=
ASK_KILLABLE);
>> =A0 =A0 =A0 if (ret)
>> - =A0 =A0 =A0 =A0 =A0 =A0 return ret;
>> + =A0 =A0 =A0 =A0 =A0 =A0 goto out;
>>
>> =A0 =A0 =A0 page =3D grab_cache_page_write_begin(mapping, index, fla=
gs);
>> - =A0 =A0 if (!page)
>> - =A0 =A0 =A0 =A0 =A0 =A0 return -ENOMEM;
>> + =A0 =A0 if (!page) {
>> + =A0 =A0 =A0 =A0 =A0 =A0 ret =3D -ENOMEM;
>> + =A0 =A0 =A0 =A0 =A0 =A0 goto out;
>> + =A0 =A0 }
>> =A0 =A0 =A0 *pagep =3D page;
>>
>> =A0 =A0 =A0 ret =3D nfs_flush_incompatible(file, page);
>> @@ -447,6 +451,11 @@ start:
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!ret)
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto start;
>> =A0 =A0 =A0 }
>> + out:
>> + =A0 =A0 if (ret) {
>> + =A0 =A0 =A0 =A0 =A0 =A0 put_lseg(*fsdata);
>> + =A0 =A0 =A0 =A0 =A0 =A0 *fsdata =3D NULL;
>> + =A0 =A0 }
>> =A0 =A0 =A0 return ret;
>> =A0}
>>
>> @@ -486,6 +495,7 @@ static int nfs_write_end(struct file *file, stru=
ct address_space *mapping,
>>
>> =A0 =A0 =A0 unlock_page(page);
>> =A0 =A0 =A0 page_cache_release(page);
>> + =A0 =A0 put_lseg(fsdata);
>>
>> =A0 =A0 =A0 if (status < 0)
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 return status;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" =
in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
>