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

J. Bruce Fields
2014-11-07T21:01:17Z

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.

--b.