]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - fs/gfs2/glock.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[mirror_ubuntu-zesty-kernel.git] / fs / gfs2 / glock.c
index 3a90b2b5b9bb3f0ecab5e86b1f0224a64f27d661..94f50cac91c617b03025d4d596d8d9d65d2c185b 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/list.h>
 #include <linux/wait.h>
 #include <linux/module.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 #include <linux/seq_file.h>
 #include <linux/debugfs.h>
 #include <linux/kthread.h>
@@ -69,7 +69,7 @@ static atomic_t lru_count = ATOMIC_INIT(0);
 static DEFINE_SPINLOCK(lru_lock);
 
 #define GFS2_GL_HASH_SHIFT      15
-#define GFS2_GL_HASH_SIZE       (1 << GFS2_GL_HASH_SHIFT)
+#define GFS2_GL_HASH_SIZE       BIT(GFS2_GL_HASH_SHIFT)
 
 static struct rhashtable_params ht_parms = {
        .nelem_hint = GFS2_GL_HASH_SIZE * 3 / 4,
@@ -695,7 +695,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
        gl->gl_target = LM_ST_UNLOCKED;
        gl->gl_demote_state = LM_ST_EXCLUSIVE;
        gl->gl_ops = glops;
-       gl->gl_dstamp = ktime_set(0, 0);
+       gl->gl_dstamp = 0;
        preempt_disable();
        /* We use the global stats to estimate the initial per-glock stats */
        gl->gl_stats = this_cpu_ptr(sdp->sd_lkstats)->lkstats[glops->go_type];
@@ -1781,7 +1781,13 @@ int __init gfs2_glock_init(void)
                return -ENOMEM;
        }
 
-       register_shrinker(&glock_shrinker);
+       ret = register_shrinker(&glock_shrinker);
+       if (ret) {
+               destroy_workqueue(gfs2_delete_workqueue);
+               destroy_workqueue(glock_workqueue);
+               rhashtable_destroy(&gl_hash_table);
+               return ret;
+       }
 
        return 0;
 }