linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Christoph Hellwig <hch@infradead.org>
Cc: jack@suse.cz, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 2/3] quota: unify ->get_dqblk
Date: Wed, 5 May 2010 18:00:53 +0200	[thread overview]
Message-ID: <20100505160052.GE3938@quack.suse.cz> (raw)
In-Reply-To: <20100505104021.693053400@bombadil.infradead.org>

On Wed 05-05-10 06:39:39, Christoph Hellwig wrote:
> Pass the larger struct fs_disk_quota to the ->get_dqblk operation so
> that the Q_GETQUOTA and Q_XGETQUOTA operations can be implemented
> with a single filesystem operation and we can retire the ->get_xquota
> operation.  The additional information (RT-subvolume accounting and
> warn counts) are left zero for the VFS quota implementation.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> Index: linux-2.6/fs/quota/quota.c
> ===================================================================
> --- linux-2.6.orig/fs/quota/quota.c	2010-05-05 11:57:38.000000000 +0200
> +++ linux-2.6/fs/quota/quota.c	2010-05-05 11:58:46.681263382 +0200
> @@ -136,19 +136,32 @@ static int quota_setinfo(struct super_bl
>  	return sb->s_qcop->set_info(sb, type, &info);
>  }
>
> +static void copy_to_if_dqblk(struct if_dqblk *dst, struct fs_disk_quota *src)
  Could you move fs_disk_quota declaration from an XFS-specific header to
a generic one?

> Index: linux-2.6/fs/quota/dquot.c
> ===================================================================
> --- linux-2.6.orig/fs/quota/dquot.c	2010-05-05 11:57:47.000000000 +0200
> +++ linux-2.6/fs/quota/dquot.c	2010-05-05 11:59:07.614022286 +0200
> @@ -2286,28 +2286,36 @@ static inline qsize_t stoqb(qsize_t spac
>  }
>  
>  /* Generic routine for getting common part of quota structure */
> -static void do_get_dqblk(struct dquot *dquot, struct if_dqblk *di)
> +static void do_get_dqblk(struct dquot *dquot, struct fs_disk_quota *di)
>  {
>  	struct mem_dqblk *dm = &dquot->dq_dqb;
>  
> +	memset(di, 0, sizeof(*di));
> +	di->d_version = FS_DQUOT_VERSION;
> +	di->d_flags = dquot->dq_type == USRQUOTA ?
> +			XFS_USER_QUOTA : XFS_GROUP_QUOTA;
> +	di->d_id = dquot->dq_id;
  XFS_USER_QUOTA and XFS_GROUP_QUOTA looks awkward in the generic code...

...
>  int vfs_get_dqblk(struct super_block *sb, int type, qid_t id,
> -		  struct if_dqblk *di)
> +		  struct fs_disk_quota *di)
>  {
>  	struct dquot *dquot;
>  
> +	if (!sb_has_quota_active(sb, type))
> +		return -ESRCH;
> +
  dqget() already does this check so you can just remove it....

>  	dquot = dqget(sb, id, type);
>  	if (!dquot)
>  		return -ESRCH;
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  parent reply	other threads:[~2010-05-05 16:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05 10:39 [PATCH 0/3] start the quota unification Christoph Hellwig
2010-05-05 10:39 ` [PATCH 1/3] cifs: drop quota operation stubs Christoph Hellwig
2010-05-05 15:34   ` Jan Kara
2010-05-05 18:57     ` Steve French
2010-05-06 11:47   ` Jeff Layton
2010-05-05 10:39 ` [PATCH 2/3] quota: unify ->get_dqblk Christoph Hellwig
2010-05-05 13:52   ` Steven Whitehouse
2010-05-05 16:18     ` Christoph Hellwig
2010-05-05 16:00   ` Jan Kara [this message]
2010-05-05 16:20     ` Christoph Hellwig
2010-05-06 21:04   ` [PATCH 2/3 v2] " Christoph Hellwig
2010-05-05 10:39 ` [PATCH 3/3] quota: unify ->set_dqblk Christoph Hellwig
2010-05-05 16:09   ` Jan Kara
2010-05-05 16:21     ` Christoph Hellwig
2010-05-06 21:05   ` [PATCH 3/3 v2] " Christoph Hellwig
2010-05-07 16:35 ` [PATCH 4/3] quota: remove sb_has_quota_active in get/set_info Christoph Hellwig
2010-05-11  8:33   ` Jan Kara

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=20100505160052.GE3938@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@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;
as well as URLs for NNTP newsgroup(s).