btrfs: rename DISCARD mount option to to DISCARD_SYNC
authorDennis Zhou <dennis@kernel.org>
Sat, 14 Dec 2019 00:22:11 +0000 (16:22 -0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 20 Jan 2020 15:40:57 +0000 (16:40 +0100)
This series introduces async discard which will use the flag
DISCARD_ASYNC, so rename the original flag to DISCARD_SYNC as it is
synchronously done in transaction commit.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Dennis Zhou <dennis@kernel.org>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/inode.c
fs/btrfs/super.c

index 66fa39632cdea7c3a00a1a68c5762e0be26e9bf4..be1938dc94fd3d57d37aa90bf00b5889d19d991d 100644 (file)
@@ -1349,7 +1349,7 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info)
                spin_unlock(&space_info->lock);
 
                /* DISCARD can flip during remount */
-               trimming = btrfs_test_opt(fs_info, DISCARD);
+               trimming = btrfs_test_opt(fs_info, DISCARD_SYNC);
 
                /* Implicit trim during transaction commit. */
                if (trimming)
index e416ef6c9415a7e6c4b57a0c3f27c60bb84d4117..2f6c21ea84af37a01f7bb61d9596b0cd77b8f129 100644 (file)
@@ -1170,7 +1170,7 @@ static inline u32 BTRFS_MAX_XATTR_SIZE(const struct btrfs_fs_info *info)
 #define BTRFS_MOUNT_FLUSHONCOMMIT       (1 << 7)
 #define BTRFS_MOUNT_SSD_SPREAD         (1 << 8)
 #define BTRFS_MOUNT_NOSSD              (1 << 9)
-#define BTRFS_MOUNT_DISCARD            (1 << 10)
+#define BTRFS_MOUNT_DISCARD_SYNC       (1 << 10)
 #define BTRFS_MOUNT_FORCE_COMPRESS      (1 << 11)
 #define BTRFS_MOUNT_SPACE_CACHE                (1 << 12)
 #define BTRFS_MOUNT_CLEAR_CACHE                (1 << 13)
index 180b9b81d01aa02a53fd2fbb7d04585a46a52c8d..1a8bf943c3e78030922ad20c8df3cc4899610bcb 100644 (file)
@@ -2923,7 +2923,7 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans)
                        break;
                }
 
-               if (btrfs_test_opt(fs_info, DISCARD))
+               if (btrfs_test_opt(fs_info, DISCARD_SYNC))
                        ret = btrfs_discard_extent(fs_info, start,
                                                   end + 1 - start, NULL);
 
index bf5d7ce358b5aa2f2a3a8bd29a10fc2ef5f9687b..6d2bb58d277aa5e545f6076f91e0829961cd4337 100644 (file)
@@ -2584,7 +2584,7 @@ out:
                         * Discard the range before returning it back to the
                         * free space pool
                         */
-                       if (ret && btrfs_test_opt(fs_info, DISCARD))
+                       if (ret && btrfs_test_opt(fs_info, DISCARD_SYNC))
                                btrfs_discard_extent(fs_info,
                                                ordered_extent->disk_bytenr,
                                                ordered_extent->disk_num_bytes,
index f452a94abdc312f011dac108906320f2daef6c55..08ac6a7a67f0dee6e6f3e7baa05dcb9399c373e4 100644 (file)
@@ -695,11 +695,11 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
                                   info->metadata_ratio);
                        break;
                case Opt_discard:
-                       btrfs_set_and_info(info, DISCARD,
-                                          "turning on discard");
+                       btrfs_set_and_info(info, DISCARD_SYNC,
+                                          "turning on sync discard");
                        break;
                case Opt_nodiscard:
-                       btrfs_clear_and_info(info, DISCARD,
+                       btrfs_clear_and_info(info, DISCARD_SYNC,
                                             "turning off discard");
                        break;
                case Opt_space_cache:
@@ -1322,7 +1322,7 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry)
                seq_puts(seq, ",nologreplay");
        if (btrfs_test_opt(info, FLUSHONCOMMIT))
                seq_puts(seq, ",flushoncommit");
-       if (btrfs_test_opt(info, DISCARD))
+       if (btrfs_test_opt(info, DISCARD_SYNC))
                seq_puts(seq, ",discard");
        if (!(info->sb->s_flags & SB_POSIXACL))
                seq_puts(seq, ",noacl");