From: Andy Shevchenko Date: Mon, 28 May 2018 07:37:42 +0000 (+0800) Subject: bcache: Move couple of string arrays to sysfs.c X-Git-Tag: Ubuntu-4.15.0-61.68~329 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=47be6a38fcf8f56d8a25cd4b10ce6bf8129cf8a1;p=mirror_ubuntu-bionic-kernel.git bcache: Move couple of string arrays to sysfs.c BugLink: https://bugs.launchpad.net/bugs/1784665 There is couple of string arrays that are used exclusively in sysfs.c. Move it to there and make them static. Besides above, it will allow further clean up. No functional change intended. Signed-off-by: Andy Shevchenko Signed-off-by: Coly Li Signed-off-by: Jens Axboe (cherry picked from commit 04cbc21137bfa4d7b8771a5b14f3d6c9b2aee671) Signed-off-by: Andrea Righi Acked-by: Stefan Bader Acked-by: Kleber Sacilotto de Souza Signed-off-by: Khalid Elmously --- diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h index f13f898f47b5..65197dfa3983 100644 --- a/drivers/md/bcache/bcache.h +++ b/drivers/md/bcache/bcache.h @@ -947,8 +947,6 @@ void bch_prio_write(struct cache *); void bch_write_bdev_super(struct cached_dev *, struct closure *); extern struct workqueue_struct *bcache_wq; -extern const char * const bch_cache_modes[]; -extern const char * const bch_stop_on_failure_modes[]; extern struct mutex bch_register_lock; extern struct list_head bch_cache_sets; diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 51d1165c827e..2fd84312fc09 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -37,24 +37,6 @@ static const char invalid_uuid[] = { 0xc8, 0x50, 0xfc, 0x5e, 0xcb, 0x16, 0xcd, 0x99 }; -/* Default is -1; we skip past it for struct cached_dev's cache mode */ -const char * const bch_cache_modes[] = { - "default", - "writethrough", - "writeback", - "writearound", - "none", - NULL -}; - -/* Default is -1; we skip past it for stop_when_cache_set_failed */ -const char * const bch_stop_on_failure_modes[] = { - "default", - "auto", - "always", - NULL -}; - static struct kobject *bcache_kobj; struct mutex bch_register_lock; LIST_HEAD(bch_cache_sets); diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c index beb1ddfa8f5a..f4150eba2101 100644 --- a/drivers/md/bcache/sysfs.c +++ b/drivers/md/bcache/sysfs.c @@ -16,6 +16,24 @@ #include #include +/* Default is -1; we skip past it for struct cached_dev's cache mode */ +static const char * const bch_cache_modes[] = { + "default", + "writethrough", + "writeback", + "writearound", + "none", + NULL +}; + +/* Default is -1; we skip past it for stop_when_cache_set_failed */ +static const char * const bch_stop_on_failure_modes[] = { + "default", + "auto", + "always", + NULL +}; + static const char * const cache_replacement_policies[] = { "lru", "fifo",