Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 10 Dec 2014 23:43:30 +0000 (15:43 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 10 Dec 2014 23:43:30 +0000 (15:43 -0800)
Pull quota updates from Jan Kara:
 "Quota improvements and some minor cleanups.

  The main portion in the pull request are changes which move i_dquot
  array from struct inode into fs-private part of an inode which saves
  memory for filesystems which don't use VFS quotas"

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  udf: One function call less in udf_fill_super() after error detection
  udf: Deletion of unnecessary checks before the function call "iput"
  jbd: Deletion of an unnecessary check before the function call "iput"
  vfs: Remove i_dquot field from inode
  jfs: Convert to private i_dquot field
  reiserfs: Convert to private i_dquot field
  ocfs2: Convert to private i_dquot field
  ext4: Convert to private i_dquot field
  ext3: Convert to private i_dquot field
  ext2: Convert to private i_dquot field
  quota: Use function to provide i_dquot pointers
  xfs: Set allowed quota types
  gfs2: Set allowed quota types
  quota: Allow each filesystem to specify which quota types it supports
  quota: Remove const from function declarations
  quota: Add log level to printk

1  2 
fs/gfs2/ops_fstype.c
include/linux/fs.h

diff --combined fs/gfs2/ops_fstype.c
@@@ -129,11 -129,11 +129,11 @@@ static struct gfs2_sbd *init_sbd(struc
  
        init_rwsem(&sdp->sd_log_flush_lock);
        atomic_set(&sdp->sd_log_in_flight, 0);
 +      atomic_set(&sdp->sd_reserving_log, 0);
 +      init_waitqueue_head(&sdp->sd_reserving_log_wait);
        init_waitqueue_head(&sdp->sd_log_flush_wait);
 -      init_waitqueue_head(&sdp->sd_log_frozen_wait);
 -      atomic_set(&sdp->sd_log_freeze, 0);
 -      atomic_set(&sdp->sd_frozen_root, 0);
 -      init_waitqueue_head(&sdp->sd_frozen_root_wait);
 +      atomic_set(&sdp->sd_freeze_state, SFS_UNFROZEN);
 +      mutex_init(&sdp->sd_freeze_mutex);
  
        return sdp;
  }
@@@ -760,7 -760,15 +760,7 @@@ static int init_journal(struct gfs2_sb
        set_bit(SDF_JOURNAL_CHECKED, &sdp->sd_flags);
        gfs2_glock_dq_uninit(&ji_gh);
        jindex = 0;
 -      if (!sdp->sd_args.ar_spectator) {
 -              error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, 0,
 -                                         &sdp->sd_thaw_gh);
 -              if (error) {
 -                      fs_err(sdp, "can't acquire freeze glock: %d\n", error);
 -                      goto fail_jinode_gh;
 -              }
 -      }
 -      gfs2_glock_dq_uninit(&sdp->sd_thaw_gh);
 +      INIT_WORK(&sdp->sd_freeze_work, gfs2_freeze_func);
        return 0;
  
  fail_jinode_gh:
@@@ -1074,6 -1082,7 +1074,7 @@@ static int fill_super(struct super_bloc
        sb->s_export_op = &gfs2_export_ops;
        sb->s_xattr = gfs2_xattr_handlers;
        sb->s_qcop = &gfs2_quotactl_ops;
+       sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP;
        sb_dqopt(sb)->flags |= DQUOT_QUOTA_SYS_FILE;
        sb->s_time_gran = 1;
        sb->s_maxbytes = MAX_LFS_FILESIZE;
diff --combined include/linux/fs.h
@@@ -606,9 -606,6 +606,6 @@@ struct inode 
        const struct file_operations    *i_fop; /* former ->i_op->default_file_ops */
        struct file_lock        *i_flock;
        struct address_space    i_data;
- #ifdef CONFIG_QUOTA
-       struct dquot            *i_dquot[MAXQUOTAS];
- #endif
        struct list_head        i_devices;
        union {
                struct pipe_inode_info  *i_pipe;
@@@ -1224,6 -1221,7 +1221,7 @@@ struct super_block 
        struct backing_dev_info *s_bdi;
        struct mtd_info         *s_mtd;
        struct hlist_node       s_instances;
+       unsigned int            s_quota_types;  /* Bitmask of supported quota types */
        struct quota_info       s_dquot;        /* Diskquota specific options */
  
        struct sb_writers       s_writers;
@@@ -1577,9 -1575,7 +1575,9 @@@ struct super_operations 
        void (*evict_inode) (struct inode *);
        void (*put_super) (struct super_block *);
        int (*sync_fs)(struct super_block *sb, int wait);
 +      int (*freeze_super) (struct super_block *);
        int (*freeze_fs) (struct super_block *);
 +      int (*thaw_super) (struct super_block *);
        int (*unfreeze_fs) (struct super_block *);
        int (*statfs) (struct dentry *, struct kstatfs *);
        int (*remount_fs) (struct super_block *, int *, char *);
  #ifdef CONFIG_QUOTA
        ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
        ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
+       struct dquot **(*get_dquots)(struct inode *);
  #endif
        int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
        long (*nr_cached_objects)(struct super_block *, int);