staging: erofs: localize erofs_workgroup_get
authorGao Xiang <gaoxiang25@huawei.com>
Wed, 16 Jan 2019 08:59:53 +0000 (16:59 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jan 2019 09:34:01 +0000 (10:34 +0100)
Staticize erofs_workgroup_get since no external user
out of utils.c directly calls erofs_workgroup_get.

Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/erofs/internal.h
drivers/staging/erofs/utils.c

index 80cc09ea787d28c94f3e111a60d539480d71f16f..967ec1a567268bd82ffc50f6948e13a4589d8a58 100644 (file)
@@ -252,28 +252,7 @@ static inline int erofs_wait_on_workgroup_freezed(struct erofs_workgroup *grp)
 }
 #endif
 
-static inline int erofs_workgroup_get(struct erofs_workgroup *grp, int *ocnt)
-{
-       int o;
-
-repeat:
-       o = erofs_wait_on_workgroup_freezed(grp);
-
-       if (unlikely(o <= 0))
-               return -1;
-
-       if (unlikely(atomic_cmpxchg(&grp->refcount, o, o + 1) != o))
-               goto repeat;
-
-       *ocnt = o;
-       return 0;
-}
-
-#define __erofs_workgroup_get(grp)     atomic_inc(&(grp)->refcount)
-#define __erofs_workgroup_put(grp)     atomic_dec(&(grp)->refcount)
-
 extern int erofs_workgroup_put(struct erofs_workgroup *grp);
-
 extern struct erofs_workgroup *erofs_find_workgroup(
        struct super_block *sb, pgoff_t index, bool *tag);
 
index aed211cd5875890081e0c5f017c03b69daa6352f..d24945aab133caf41f4805db097d5718c20d84b8 100644 (file)
@@ -31,6 +31,25 @@ struct page *erofs_allocpage(struct list_head *pool, gfp_t gfp)
 static atomic_long_t erofs_global_shrink_cnt;
 
 #ifdef CONFIG_EROFS_FS_ZIP
+#define __erofs_workgroup_get(grp)     atomic_inc(&(grp)->refcount)
+#define __erofs_workgroup_put(grp)     atomic_dec(&(grp)->refcount)
+
+static int erofs_workgroup_get(struct erofs_workgroup *grp, int *ocnt)
+{
+       int o;
+
+repeat:
+       o = erofs_wait_on_workgroup_freezed(grp);
+
+       if (unlikely(o <= 0))
+               return -1;
+
+       if (unlikely(atomic_cmpxchg(&grp->refcount, o, o + 1) != o))
+               goto repeat;
+
+       *ocnt = o;
+       return 0;
+}
 
 struct erofs_workgroup *erofs_find_workgroup(
        struct super_block *sb, pgoff_t index, bool *tag)