public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Anna.Schumaker@netapp.com
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH v4 2/3] nfsd: Add ALLOCATE support
Date: Fri, 7 Nov 2014 16:01:15 -0500	[thread overview]
Message-ID: <20141107210115.GA5723@fieldses.org> (raw)
In-Reply-To: <1415389467-16547-3-git-send-email-Anna.Schumaker@Netapp.com>

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.

  reply	other threads:[~2014-11-07 21:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 19:44 [PATCH v4 0/3] NFS: Add ALLOCATE and DEALLOCATE support Anna.Schumaker
2014-11-07 19:44 ` [PATCH v4 1/3] VFS: Rename do_fallocate() to vfs_fallocate() Anna.Schumaker
2014-11-07 19:44 ` [PATCH v4 2/3] nfsd: Add ALLOCATE support Anna.Schumaker
2014-11-07 21:01   ` J. Bruce Fields [this message]
2014-11-07 21:02     ` Anna Schumaker
2014-11-07 19:44 ` [PATCH v4 3/3] nfsd: Add DEALLOCATE support Anna.Schumaker
2014-11-07 21:22 ` [PATCH v4 0/3] NFS: Add ALLOCATE and " J. Bruce Fields

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=20141107210115.GA5723@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=Anna.Schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    /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