Btrfs: fix possible empty list access when flushing the delalloc inodes
[linux-2.6-block.git] / fs / btrfs / ctree.h
index 5f4921554f0aa801498015d7b9b23e609a2c67cc..2a9d32e193a5f9c7b10f8f8f1d3b8abb8ede9bb6 100644 (file)
@@ -1490,6 +1490,7 @@ struct btrfs_fs_info {
         */
        struct list_head ordered_roots;
 
+       struct mutex delalloc_root_mutex;
        spinlock_t delalloc_root_lock;
        /* all fs/file tree roots that have delalloc inodes. */
        struct list_head delalloc_roots;
@@ -1805,6 +1806,7 @@ struct btrfs_root {
        spinlock_t root_item_lock;
        atomic_t refs;
 
+       struct mutex delalloc_mutex;
        spinlock_t delalloc_lock;
        /*
         * all of the inodes that have delalloc bytes.  It is possible for