Merge tag 'writeback-proportions' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 31 Jul 2012 05:14:04 +0000 (22:14 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 31 Jul 2012 05:14:04 +0000 (22:14 -0700)
Pull writeback updates from Wu Fengguang:
 "Use time based periods to age the writeback proportions, which can
  adapt equally well to fast/slow devices."

Fix up trivial conflict in comment in fs/sync.c

* tag 'writeback-proportions' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux:
  writeback: Fix some comment errors
  block: Convert BDI proportion calculations to flexible proportions
  lib: Fix possible deadlock in flexible proportion code
  lib: Proportions with flexible period

1  2 
fs/fs-writeback.c
fs/super.c
lib/Makefile

diff --combined fs/fs-writeback.c
@@@ -628,8 -628,8 +628,8 @@@ static long writeback_sb_inodes(struct 
                }
  
                /*
-                * Don't bother with new inodes or inodes beeing freed, first
-                * kind does not need peridic writeout yet, and for the latter
+                * Don't bother with new inodes or inodes being freed, first
+                * kind does not need periodic writeout yet, and for the latter
                 * kind writeout is handled by the freer.
                 */
                spin_lock(&inode->i_lock);
@@@ -1315,8 -1315,6 +1315,8 @@@ void writeback_inodes_sb_nr(struct supe
                .reason                 = reason,
        };
  
 +      if (sb->s_bdi == &noop_backing_dev_info)
 +              return;
        WARN_ON(!rwsem_is_locked(&sb->s_umount));
        bdi_queue_work(sb->s_bdi, &work);
        wait_for_completion(&done);
@@@ -1400,9 -1398,6 +1400,9 @@@ void sync_inodes_sb(struct super_block 
                .reason         = WB_REASON_SYNC,
        };
  
 +      /* Nothing to do? */
 +      if (sb->s_bdi == &noop_backing_dev_info)
 +              return;
        WARN_ON(!rwsem_is_locked(&sb->s_umount));
  
        bdi_queue_work(sb->s_bdi, &work);
diff --combined fs/super.c
@@@ -105,12 -105,11 +105,12 @@@ static int prune_super(struct shrinker 
  /**
   *    alloc_super     -       create new superblock
   *    @type:  filesystem type superblock should belong to
 + *    @flags: the mount flags
   *
   *    Allocates and initializes a new &struct super_block.  alloc_super()
   *    returns a pointer new superblock or %NULL if allocation had failed.
   */
 -static struct super_block *alloc_super(struct file_system_type *type)
 +static struct super_block *alloc_super(struct file_system_type *type, int flags)
  {
        struct super_block *s = kzalloc(sizeof(struct super_block),  GFP_USER);
        static const struct super_operations default_op;
  #else
                INIT_LIST_HEAD(&s->s_files);
  #endif
 +              s->s_flags = flags;
                s->s_bdi = &default_backing_dev_info;
                INIT_HLIST_NODE(&s->s_instances);
                INIT_HLIST_BL_HEAD(&s->s_anon);
@@@ -320,7 -318,7 +320,7 @@@ static int grab_super(struct super_bloc
  
  /*
   *    grab_super_passive - acquire a passive reference
-  *    @s: reference we are trying to grab
+  *    @sb: reference we are trying to grab
   *
   *    Tries to acquire a passive reference. This is used in places where we
   *    cannot take an active reference but we need to ensure that the
@@@ -417,13 -415,11 +417,13 @@@ EXPORT_SYMBOL(generic_shutdown_super)
   *    @type:  filesystem type superblock should belong to
   *    @test:  comparison callback
   *    @set:   setup callback
 + *    @flags: mount flags
   *    @data:  argument to each of them
   */
  struct super_block *sget(struct file_system_type *type,
                        int (*test)(struct super_block *,void *),
                        int (*set)(struct super_block *,void *),
 +                      int flags,
                        void *data)
  {
        struct super_block *s = NULL;
@@@ -454,7 -450,7 +454,7 @@@ retry
        }
        if (!s) {
                spin_unlock(&sb_lock);
 -              s = alloc_super(type);
 +              s = alloc_super(type, flags);
                if (!s)
                        return ERR_PTR(-ENOMEM);
                goto retry;
@@@ -929,12 -925,13 +929,12 @@@ struct dentry *mount_ns(struct file_sys
  {
        struct super_block *sb;
  
 -      sb = sget(fs_type, ns_test_super, ns_set_super, data);
 +      sb = sget(fs_type, ns_test_super, ns_set_super, flags, data);
        if (IS_ERR(sb))
                return ERR_CAST(sb);
  
        if (!sb->s_root) {
                int err;
 -              sb->s_flags = flags;
                err = fill_super(sb, data, flags & MS_SILENT ? 1 : 0);
                if (err) {
                        deactivate_locked_super(sb);
@@@ -995,8 -992,7 +995,8 @@@ struct dentry *mount_bdev(struct file_s
                error = -EBUSY;
                goto error_bdev;
        }
 -      s = sget(fs_type, test_bdev_super, set_bdev_super, bdev);
 +      s = sget(fs_type, test_bdev_super, set_bdev_super, flags | MS_NOSEC,
 +               bdev);
        mutex_unlock(&bdev->bd_fsfreeze_mutex);
        if (IS_ERR(s))
                goto error_s;
        } else {
                char b[BDEVNAME_SIZE];
  
 -              s->s_flags = flags | MS_NOSEC;
                s->s_mode = mode;
                strlcpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id));
                sb_set_blocksize(s, block_size(bdev));
@@@ -1065,11 -1062,13 +1065,11 @@@ struct dentry *mount_nodev(struct file_
        int (*fill_super)(struct super_block *, void *, int))
  {
        int error;
 -      struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL);
 +      struct super_block *s = sget(fs_type, NULL, set_anon_super, flags, NULL);
  
        if (IS_ERR(s))
                return ERR_CAST(s);
  
 -      s->s_flags = flags;
 -
        error = fill_super(s, data, flags & MS_SILENT ? 1 : 0);
        if (error) {
                deactivate_locked_super(s);
@@@ -1092,10 -1091,11 +1092,10 @@@ struct dentry *mount_single(struct file
        struct super_block *s;
        int error;
  
 -      s = sget(fs_type, compare_single, set_anon_super, NULL);
 +      s = sget(fs_type, compare_single, set_anon_super, flags, NULL);
        if (IS_ERR(s))
                return ERR_CAST(s);
        if (!s->s_root) {
 -              s->s_flags = flags;
                error = fill_super(s, data, flags & MS_SILENT ? 1 : 0);
                if (error) {
                        deactivate_locked_super(s);
diff --combined lib/Makefile
@@@ -11,7 -11,7 +11,7 @@@ lib-y := ctype.o string.o vsprintf.o cm
         rbtree.o radix-tree.o dump_stack.o timerqueue.o\
         idr.o int_sqrt.o extable.o prio_tree.o \
         sha1.o md5.o irq_regs.o reciprocal_div.o argv_split.o \
-        proportions.o prio_heap.o ratelimit.o show_mem.o \
+        proportions.o flex_proportions.o prio_heap.o ratelimit.o show_mem.o \
         is_single_threaded.o plist.o decompress.o
  
  lib-$(CONFIG_MMU) += ioremap.o
@@@ -22,7 -22,7 +22,7 @@@ lib-y += kobject.o klist.
  obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
         bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \
         string_helpers.o gcd.o lcm.o list_sort.o uuid.o flex_array.o \
 -       bsearch.o find_last_bit.o find_next_bit.o llist.o
 +       bsearch.o find_last_bit.o find_next_bit.o llist.o memweight.o
  obj-y += kstrtox.o
  obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o
  
@@@ -90,12 -90,7 +90,12 @@@ obj-$(CONFIG_AUDIT_GENERIC) += audit.
  obj-$(CONFIG_SWIOTLB) += swiotlb.o
  obj-$(CONFIG_IOMMU_HELPER) += iommu-helper.o
  obj-$(CONFIG_FAULT_INJECTION) += fault-inject.o
 +obj-$(CONFIG_NOTIFIER_ERROR_INJECTION) += notifier-error-inject.o
  obj-$(CONFIG_CPU_NOTIFIER_ERROR_INJECT) += cpu-notifier-error-inject.o
 +obj-$(CONFIG_PM_NOTIFIER_ERROR_INJECT) += pm-notifier-error-inject.o
 +obj-$(CONFIG_MEMORY_NOTIFIER_ERROR_INJECT) += memory-notifier-error-inject.o
 +obj-$(CONFIG_PSERIES_RECONFIG_NOTIFIER_ERROR_INJECT) += \
 +      pSeries-reconfig-notifier-error-inject.o
  
  lib-$(CONFIG_GENERIC_BUG) += bug.o
  
@@@ -135,11 -130,6 +135,11 @@@ obj-$(CONFIG_GENERIC_STRNLEN_USER) += s
  
  obj-$(CONFIG_STMP_DEVICE) += stmp_device.o
  
 +libfdt_files = fdt.o fdt_ro.o fdt_wip.o fdt_rw.o fdt_sw.o fdt_strerror.o
 +$(foreach file, $(libfdt_files), \
 +      $(eval CFLAGS_$(file) = -I$(src)/../scripts/dtc/libfdt))
 +lib-$(CONFIG_LIBFDT) += $(libfdt_files)
 +
  hostprogs-y   := gen_crc32table
  clean-files   := crc32table.h