X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=fs%2Fsuper.c;h=eae088f6aaaeb6e8a3380adad19fb66feebe9905;hb=9d9420f1209a1facea7110d549ac695f5aeeb503;hp=b9a214d2fe98b8b37a7560ebf1a7d1dc7c5d83e0;hpb=f58f0cba15c2d0bfbc72b1eedd0a6294e8c83419;p=firefly-linux-kernel-4.4.55.git diff --git a/fs/super.c b/fs/super.c index b9a214d2fe98..eae088f6aaae 100644 --- a/fs/super.c +++ b/fs/super.c @@ -80,6 +80,8 @@ static unsigned long super_cache_scan(struct shrinker *shrink, inodes = list_lru_count_node(&sb->s_inode_lru, sc->nid); dentries = list_lru_count_node(&sb->s_dentry_lru, sc->nid); total_objects = dentries + inodes + fs_objects + 1; + if (!total_objects) + total_objects = 1; /* proportion the scan between the caches */ dentries = mult_frac(sc->nr_to_scan, dentries, total_objects); @@ -175,7 +177,8 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags) goto fail; for (i = 0; i < SB_FREEZE_LEVELS; i++) { - if (percpu_counter_init(&s->s_writers.counter[i], 0) < 0) + if (percpu_counter_init(&s->s_writers.counter[i], 0, + GFP_KERNEL) < 0) goto fail; lockdep_init_map(&s->s_writers.lock_map[i], sb_writers_name[i], &type->s_writers_key[i], 0);