public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Myers <bpm@sgi.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 4/8 v2] xfs: use common code for quota statistics
Date: Mon, 12 Mar 2012 12:55:19 -0500	[thread overview]
Message-ID: <20120312175519.GE7762@sgi.com> (raw)
In-Reply-To: <20120221014809.GA18227@infradead.org>

On Mon, Feb 20, 2012 at 08:48:09PM -0500, Christoph Hellwig wrote:
> Switch the quota code over to use the generic XFS statistics infrastructure.
> While the legacy /proc/fs/xfs/xqm and /proc/fs/xfs/xqmstats interfaces are
> preserved for now the statistics that still have a meaning with the current
> code are now also available from /proc/fs/xfs/stats.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

...

> +/* legacy quota interfaces */
> +#ifdef CONFIG_XFS_QUOTA
> +static int xqm_proc_show(struct seq_file *m, void *v)
> +{
> +	/* maximum; incore; ratio free to inuse; freelist */
> +	seq_printf(m, "%d\t%d\t%d\t%u\n",
> +			0,
> +			counter_val(XFSSTAT_END_XQMSTAT),

That's xfs_qm_dquot

> +			0,
> +			counter_val(XFSSTAT_END_XQMSTAT + 1));

and xfs_qm_dquot_unused?  A comment would make your intent clear.

> +	return 0;
> +}
> +
> +static int xqm_proc_open(struct inode *inode, struct file *file)
> +{
> +	return single_open(file, xqm_proc_show, NULL);
> +}
> +
> +static const struct file_operations xqm_proc_fops = {
> +	.owner		= THIS_MODULE,
> +	.open		= xqm_proc_open,
> +	.read		= seq_read,
> +	.llseek		= seq_lseek,
> +	.release	= single_release,
> +};
> +
> +/* legacy quota stats interface no 2 */
> +static int xqmstat_proc_show(struct seq_file *m, void *v)
> +{
> +	int j;
> +
> +	seq_printf(m, "qm");
> +	for (j = XFSSTAT_END_IBT_V2; j < XFSSTAT_END_XQMSTAT; j++)
> +		seq_printf(m, " %u", counter_val(j));

And a comment here with all of the stuff you're printing out would be
total overkill.  Nevermind.  ;) 

...

>  int
>  xfs_init_procfs(void)
>  {
> @@ -105,10 +162,24 @@ xfs_init_procfs(void)
>  
>  	if (!proc_create("fs/xfs/stat", 0, NULL,
>  			 &xfs_stat_proc_fops))
> -		goto out_remove_entry;
> +		goto out_remove_xfs_dir;
> +#ifdef CONFIG_XFS_QUOTA
> +	if (!proc_create("fs/xfs/xqmstat", 0, NULL,
> +			 &xqmstat_proc_fops))
> +		goto out_remove_stat_file;
> +	if (!proc_create("fs/xfs/xqm", 0, NULL,
> +			 &xqm_proc_fops))
> +		goto out_remove_xqmstat_file;
> +#endif
>  	return 0;
>  
> - out_remove_entry:
> +#ifdef CONFIG_XFS_QUOTA
> + out_remove_xqmstat_file:
> +	remove_proc_entry("fs/xfs/xqmstat", NULL);
> + out_remove_stat_file:
> +	remove_proc_entry("fs/xfs/stat", NULL);
> +#endif
> + out_remove_xfs_dir:

I'm glad to see that you added error handling here.  There wasn't any in
the xfs_qm_init_procfs before.  

This patch looks great.  It might break some PCP scripts, I'm not sure.

Reviewed-by: Ben Myers <bpm@sgi.com>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2012-03-12 17:55 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-20  2:28 [PATCH 0/8] quota updates, V3 Christoph Hellwig
2012-02-20  2:28 ` [PATCH 1/8] xfs: merge xfs_qm_export_dquot into xfs_qm_scall_getquota Christoph Hellwig
2012-02-27  1:59   ` Ben Myers
2012-02-27 17:17     ` Christoph Hellwig
2012-02-27 17:23       ` Ben Myers
2012-02-28  3:27         ` Christoph Hellwig
2012-02-29 17:40           ` Ben Myers
2012-02-20  2:28 ` [PATCH 2/8] xfs: include reservations in quota reporting Christoph Hellwig
2012-02-29 19:37   ` Ben Myers
2012-02-20  2:28 ` [PATCH 3/8] quota: make Q_XQUOTASYNC a noop Christoph Hellwig
2012-02-29 20:00   ` Ben Myers
2012-02-20  2:28 ` [PATCH 4/8] xfs: use common code for quota statistics Christoph Hellwig
2012-02-20 21:33   ` Dave Chinner
2012-02-20 21:50     ` Christoph Hellwig
2012-02-21  1:48   ` [PATCH 4/8 v2] " Christoph Hellwig
2012-02-21  4:41     ` Dave Chinner
2012-03-12 17:55     ` Ben Myers [this message]
2012-03-13  8:42       ` Christoph Hellwig
2012-03-13 15:27         ` Ben Myers
2012-03-13 21:40           ` Dave Chinner
2012-03-14  2:34             ` Nathan Scott
2012-03-14  5:03               ` Dave Chinner
2012-02-20  2:28 ` [PATCH 5/8] xfs: per-filesystem dquot LRU lists Christoph Hellwig
2012-02-20 22:08   ` Dave Chinner
2012-03-12 20:37   ` Ben Myers
2012-02-20  2:28 ` [PATCH 6/8] xfs: use per-filesystem radix trees for dquot lookup Christoph Hellwig
2012-02-20  2:28 ` [PATCH 7/8] xfs: remove the per-filesystem list of dquots Christoph Hellwig
2012-02-20 22:15   ` Dave Chinner
2012-02-20 22:19     ` Christoph Hellwig
2012-02-28  3:31   ` [PATCH 7/8 v2] " Christoph Hellwig
2012-02-20  2:28 ` [PATCH 8/8] xfs: remove the global xfs_Gqm structure Christoph Hellwig

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=20120312175519.GE7762@sgi.com \
    --to=bpm@sgi.com \
    --cc=hch@infradead.org \
    --cc=xfs@oss.sgi.com \
    /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