f2fs: change to use rwsem for gc_mutex
[sfrench/cifs-2.6.git] / fs / f2fs / f2fs.h
index e7208442d32aa101b987f51b4ef66410593072eb..61d62cd06449ea8f6d0d08933607755a3b8af969 100644 (file)
@@ -1391,7 +1391,10 @@ struct f2fs_sb_info {
        struct f2fs_mount_info mount_opt;       /* mount options */
 
        /* for cleaning operations */
-       struct mutex gc_mutex;                  /* mutex for GC */
+       struct rw_semaphore gc_lock;            /*
+                                                * semaphore for GC, avoid
+                                                * race between GC and GC or CP
+                                                */
        struct f2fs_gc_kthread  *gc_thread;     /* GC thread */
        unsigned int cur_victim_sec;            /* current victim section num */
        unsigned int gc_mode;                   /* current GC state */