btrfs: unexport btrfs_run_discard_work and make it static
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Tue, 9 May 2023 17:12:01 +0000 (10:12 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2023 11:59:25 +0000 (13:59 +0200)
Mark btrfs_run_discard_work static and move it above its callers.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/discard.c
fs/btrfs/discard.h

index a6d77fe41e1a9eeb367322c03b26c5edef50e453..944a7340f6a449f7ba6abe199edc97686bab96ef 100644 (file)
@@ -73,6 +73,23 @@ static struct list_head *get_discard_list(struct btrfs_discard_ctl *discard_ctl,
        return &discard_ctl->discard_list[block_group->discard_index];
 }
 
+/*
+ * Determine if async discard should be running.
+ *
+ * @discard_ctl: discard control
+ *
+ * Check if the file system is writeable and BTRFS_FS_DISCARD_RUNNING is set.
+ */
+static bool btrfs_run_discard_work(struct btrfs_discard_ctl *discard_ctl)
+{
+       struct btrfs_fs_info *fs_info = container_of(discard_ctl,
+                                                    struct btrfs_fs_info,
+                                                    discard_ctl);
+
+       return (!(fs_info->sb->s_flags & SB_RDONLY) &&
+               test_bit(BTRFS_FS_DISCARD_RUNNING, &fs_info->flags));
+}
+
 static void __add_to_discard_list(struct btrfs_discard_ctl *discard_ctl,
                                  struct btrfs_block_group *block_group)
 {
@@ -544,23 +561,6 @@ static void btrfs_discard_workfn(struct work_struct *work)
        spin_unlock(&discard_ctl->lock);
 }
 
-/*
- * Determine if async discard should be running.
- *
- * @discard_ctl: discard control
- *
- * Check if the file system is writeable and BTRFS_FS_DISCARD_RUNNING is set.
- */
-bool btrfs_run_discard_work(struct btrfs_discard_ctl *discard_ctl)
-{
-       struct btrfs_fs_info *fs_info = container_of(discard_ctl,
-                                                    struct btrfs_fs_info,
-                                                    discard_ctl);
-
-       return (!(fs_info->sb->s_flags & SB_RDONLY) &&
-               test_bit(BTRFS_FS_DISCARD_RUNNING, &fs_info->flags));
-}
-
 /*
  * Recalculate the base delay.
  *
index 57b9202f427f869a42b108f47dfeb08f26b79472..dddb0f9101ba9216c89e43fea14f7ad01b76ffc4 100644 (file)
@@ -24,7 +24,6 @@ void btrfs_discard_queue_work(struct btrfs_discard_ctl *discard_ctl,
                              struct btrfs_block_group *block_group);
 void btrfs_discard_schedule_work(struct btrfs_discard_ctl *discard_ctl,
                                 bool override);
-bool btrfs_run_discard_work(struct btrfs_discard_ctl *discard_ctl);
 
 /* Update operations */
 void btrfs_discard_calc_delay(struct btrfs_discard_ctl *discard_ctl);