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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 07, 2014 at 02:44:26PM -0500, Anna.Schumaker@xxxxxxxxxx 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux