Re: [PATCH v4 2/3] nfsd: Add ALLOCATE support

Anna Schumaker
2014-11-07T21:02:16Z

On 11/07/2014 04:01 PM, J. Bruce Fields wrote:
> On Fri, Nov 07, 2014 at 02:44:26PM -0500, Anna.Schumaker@netapp.com wrote:
>> @@ -533,6 +534,28 @@ __be32 nfsd4_set_nfs4_label(struct svc_rqst *rqstp, struct svc_fh *fhp,
>> }
>> #endif
>>
>> +__be32 nfsd4_vfs_fallocate(struct svc_rqst *rqstp, struct svc_fh *fhp,
>> + struct file *file, loff_t offset, loff_t len,
>> + int flags)
>> +{
>> + __be32 err;
>> + int error;
>> +
>> + if (!S_ISREG(file_inode(file)->i_mode))
>> + return nfserr_inval;
>> +
>> + err = nfsd_permission(rqstp, fhp->fh_export, fhp->fh_dentry, NFSD_MAY_WRITE);
>> + if (err)
>> + return err;
>> +
>> + error = vfs_fallocate(file, flags, offset, len);
>> + if (!error)
>> + error = commit_metadata(fhp);
>> +
>> + if (error == -ENODEV)
>> + return nfserr_inval;
>
>
> I don't think we need this check any more.
>
> I'll just remove it myself as I apply if there's no objection.

Right! Thanks for the reminder, I have no objections if you remove it :)

Anna
>
> --b.
>