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 5/6] quota: explicitly set ->dq_op and ->s_qcop
Date: Tue, 18 May 2010 01:06:05 +0200	[thread overview]
Message-ID: <20100517230604.GK3364@quack.suse.cz> (raw)
In-Reply-To: <20100512194454.207523223@bombadil.infradead.org>

On Wed 12-05-10 15:44:13, Christoph Hellwig wrote:
> Only set the quota operation vectors if the filesystem actually supports
> quota instead of doing it for all filesystems in alloc_super().
  Hmm, what about ext2? Otherwise the patch looks fine.

								Honza

> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> Index: linux-2.6/fs/super.c
> ===================================================================
> --- linux-2.6.orig/fs/super.c	2010-05-10 23:24:19.215025989 +0200
> +++ linux-2.6/fs/super.c	2010-05-10 23:24:54.148210860 +0200
> @@ -26,7 +26,6 @@
>  #include <linux/smp_lock.h>
>  #include <linux/acct.h>
>  #include <linux/blkdev.h>
> -#include <linux/quotaops.h>
>  #include <linux/namei.h>
>  #include <linux/mount.h>
>  #include <linux/security.h>
> @@ -101,8 +100,6 @@ static struct super_block *alloc_super(s
>  		init_rwsem(&s->s_dquot.dqptr_sem);
>  		init_waitqueue_head(&s->s_wait_unfrozen);
>  		s->s_maxbytes = MAX_NON_LFS;
> -		s->dq_op = sb_dquot_ops;
> -		s->s_qcop = sb_quotactl_ops;
>  		s->s_op = &default_op;
>  		s->s_time_gran = 1000000000;
>  	}
> Index: linux-2.6/include/linux/quotaops.h
> ===================================================================
> --- linux-2.6.orig/include/linux/quotaops.h	2010-05-10 23:24:30.453195565 +0200
> +++ linux-2.6/include/linux/quotaops.h	2010-05-10 23:37:46.910024731 +0200
> @@ -140,9 +140,6 @@ static inline unsigned sb_any_quota_acti
>  extern const struct dquot_operations dquot_operations;
>  extern const struct quotactl_ops vfs_quotactl_ops;
>  
> -#define sb_dquot_ops (&dquot_operations)
> -#define sb_quotactl_ops (&vfs_quotactl_ops)
> -
>  #else
>  
>  static inline int sb_has_quota_usage_enabled(struct super_block *sb, int type)
> @@ -186,12 +183,6 @@ static inline int sb_any_quota_active(st
>  	return 0;
>  }
>  
> -/*
> - * NO-OP when quota not configured.
> - */
> -#define sb_dquot_ops				(NULL)
> -#define sb_quotactl_ops				(NULL)
> -
>  static inline void dquot_initialize(struct inode *inode)
>  {
>  }
> Index: linux-2.6/fs/jfs/super.c
> ===================================================================
> --- linux-2.6.orig/fs/jfs/super.c	2010-05-10 23:24:19.201253535 +0200
> +++ linux-2.6/fs/jfs/super.c	2010-05-10 23:37:46.837004197 +0200
> @@ -479,6 +479,10 @@ static int jfs_fill_super(struct super_b
>  	 */
>  	sb->s_op = &jfs_super_operations;
>  	sb->s_export_op = &jfs_export_operations;
> +#ifdef CONFIG_QUOTA
> +	sb->dq_op = &dquot_operations;
> +	sb->s_qcop = &vfs_quotactl_ops;
> +#endif
>  
>  	/*
>  	 * Initialize direct-mapping inode/address-space
> Index: linux-2.6/fs/udf/super.c
> ===================================================================
> --- linux-2.6.orig/fs/udf/super.c	2010-05-10 23:22:58.822262265 +0200
> +++ linux-2.6/fs/udf/super.c	2010-05-10 23:40:26.739255629 +0200
> @@ -56,6 +56,7 @@
>  #include <linux/mount.h>
>  #include <linux/seq_file.h>
>  #include <linux/bitmap.h>
> +#include <linux/quotaops.h>
>  #include <linux/crc-itu-t.h>
>  #include <asm/byteorder.h>
>  
> @@ -1939,7 +1940,11 @@ static int udf_fill_super(struct super_b
>  	/* Fill in the rest of the superblock */
>  	sb->s_op = &udf_sb_ops;
>  	sb->s_export_op = &udf_export_ops;
> -	sb->dq_op = NULL;
> +#ifdef CONFIG_QUOTA
> +	sb->s_qcop = &vfs_quotactl_ops;
> +	sb->dq_op = NULL; /* &dquot_operations */
> +#endif
> +
>  	sb->s_dirt = 0;
>  	sb->s_magic = UDF_SUPER_MAGIC;
>  	sb->s_time_gran = 1000;
> Index: linux-2.6/fs/ufs/super.c
> ===================================================================
> --- linux-2.6.orig/fs/ufs/super.c	2010-05-10 23:24:19.220276582 +0200
> +++ linux-2.6/fs/ufs/super.c	2010-05-10 23:37:46.895004477 +0200
> @@ -1045,7 +1045,11 @@ magic_found:
>  	 */
>  	sb->s_op = &ufs_super_ops;
>  	sb->s_export_op = &ufs_export_ops;
> -	sb->dq_op = NULL; /***/
> +#ifdef CONFIG_QUOTA
> +	sb->s_qcop = &vfs_quotactl_ops;
> +	sb->dq_op = NULL; /* &dquot_operations */
> +#endif
> +
>  	sb->s_magic = fs32_to_cpu(sb, usb3->fs_magic);
>  
>  	uspi->s_sblkno = fs32_to_cpu(sb, usb1->fs_sblkno);
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2010-05-17 23:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-12 19:44 [PATCH 0/6] more quota cleanups Christoph Hellwig
2010-05-12 19:44 ` [PATCH 1/6] dquot: move remount handling into the filesystem Christoph Hellwig
2010-05-17 22:34   ` Jan Kara
2010-05-19 10:55     ` Christoph Hellwig
2010-05-19 13:47       ` Jan Kara
2010-05-12 19:44 ` [PATCH 2/6] quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers Christoph Hellwig
2010-05-17 22:46   ` Jan Kara
2010-05-12 19:44 ` [PATCH 3/6] dquot: move unmount handling into the filesystem Christoph Hellwig
2010-05-17 22:58   ` Jan Kara
2010-05-19 11:03     ` Christoph Hellwig
2010-05-12 19:44 ` [PATCH 4/6] quota: drop remount argument to ->quota_on and ->quota_off Christoph Hellwig
2010-05-17 23:00   ` Jan Kara
2010-05-12 19:44 ` [PATCH 5/6] quota: explicitly set ->dq_op and ->s_qcop Christoph Hellwig
2010-05-17 23:06   ` Jan Kara [this message]
2010-05-19 11:07     ` Christoph Hellwig
2010-05-12 19:44 ` [PATCH 6/6] quota: rename default quotactl methods to dqout_ Christoph Hellwig
2010-05-17 23:09   ` Jan Kara
2010-05-19 11:07     ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2010-05-19 11:16 [PATCH 0/6] more quota cleanups V2 Christoph Hellwig
2010-05-19 11:16 ` [PATCH 5/6] quota: explicitly set ->dq_op and ->s_qcop 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=20100517230604.GK3364@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).