xfs
[Top] [All Lists]

Re: [PATCH 13/17] xfs: get rid of indirections in the quotaops implement

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 13/17] xfs: get rid of indirections in the quotaops implementation
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Mon, 9 Feb 2009 13:41:15 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20090126073202.961302000@xxxxxxxxxxxxxxxxxxxxxx>
Mail-followup-to: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
References: <20090126073136.384490000@xxxxxxxxxxxxxxxxxxxxxx> <20090126073202.961302000@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
On Mon, Jan 26, 2009 at 02:31:49AM -0500, Christoph Hellwig wrote:
> Currently we call from the nicely abstracted linux quotaops into a ugly
> multiplexer just to split the calls out at the same boundary again.
> Rewrite the quota ops handling to remove that obfucation.
> 
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
.....
> +STATIC int
> +xfs_fs_get_xstate(
> +     struct super_block      *sb,
> +     struct fs_quota_stat    *fqs)
> +{
> +     struct xfs_mount        *mp = XFS_M(sb);
> +
> +     if (!XFS_IS_QUOTA_RUNNING(mp))
> +             return -ENOSYS;
> +     return xfs_qm_scall_getqstat(mp, fqs);

The return of xfs_qm_scall_getqstat() needs to be negated.

> +STATIC int
> +xfs_fs_set_xquota(
> +     struct super_block      *sb,
> +     int                     type,
> +     qid_t                   id,
> +     struct fs_disk_quota    *fdq)
> +{
> +     struct xfs_mount        *mp = XFS_M(sb);
> +
> +     if (sb->s_flags & MS_RDONLY)
> +             return -EROFS;
> +     if (!XFS_IS_QUOTA_RUNNING(mp))
> +             return -ENOSYS;
> +     if (!XFS_IS_QUOTA_ON(mp))
> +             return -ESRCH;
> +     if (!capable(CAP_SYS_ADMIN))
> +             return -EPERM;
> +
> +     return xfs_qm_scall_setqlim(mp, id, xfs_quota_type(type), fdq);

That should be negated as well.

Other than those two little things, looks good.

Reviewed-by: Dave Chinner <david@xxxxxxxxxxxxx>

-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>