From: Dongsheng Yang <dongsheng.yang@linux.dev>
To: Li Chen <me@linux.beauty>,
dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org,
Zheng Gu <cengku@gmail.com>
Subject: Re: [PATCH v2 1/3] dm-pcache: allow built-in build and rename flush helper
Date: Thu, 13 Nov 2025 14:39:39 +0800 [thread overview]
Message-ID: <698ecc2f-0c19-4a9a-a493-f675dc14ec5e@linux.dev> (raw)
In-Reply-To: <20251111121337.1063443-2-me@linux.beauty>
在 11/11/2025 8:13 PM, Li Chen 写道:
> From: Li Chen <chenl311@chinatelecom.cn>
>
> CONFIG_BCACHE is tristate, so dm-pcache can also be built-in.
> Switch the Makefile to use obj-$(CONFIG_DM_PCACHE) so the target can be
> linked into vmlinux instead of always being a loadable module.
>
> Also rename cache_flush() to pcache_cache_flush() to avoid a global
> symbol clash with sunrpc/cache.c's cache_flush().
>
> Signed-off-by: Li Chen <chenl311@chinatelecom.cn>
Reviewed-by: Dongsheng Yang <dongsheng.yang@linux.dev>
> ---
> drivers/md/dm-pcache/Makefile | 2 +-
> drivers/md/dm-pcache/cache.c | 2 +-
> drivers/md/dm-pcache/cache.h | 2 +-
> drivers/md/dm-pcache/cache_req.c | 6 +++---
> 4 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/md/dm-pcache/Makefile b/drivers/md/dm-pcache/Makefile
> index 86776e4acad2..cedfd38854f6 100644
> --- a/drivers/md/dm-pcache/Makefile
> +++ b/drivers/md/dm-pcache/Makefile
> @@ -1,3 +1,3 @@
> dm-pcache-y := dm_pcache.o cache_dev.o segment.o backing_dev.o cache.o cache_gc.o cache_writeback.o cache_segment.o cache_key.o cache_req.o
>
> -obj-m += dm-pcache.o
> +obj-$(CONFIG_DM_PCACHE) += dm-pcache.o
> diff --git a/drivers/md/dm-pcache/cache.c b/drivers/md/dm-pcache/cache.c
> index d8e92367d947..d516d4904227 100644
> --- a/drivers/md/dm-pcache/cache.c
> +++ b/drivers/md/dm-pcache/cache.c
> @@ -411,7 +411,7 @@ void pcache_cache_stop(struct dm_pcache *pcache)
> {
> struct pcache_cache *cache = &pcache->cache;
>
> - cache_flush(cache);
> + pcache_cache_flush(cache);
>
> cancel_delayed_work_sync(&cache->gc_work);
> flush_work(&cache->clean_work);
> diff --git a/drivers/md/dm-pcache/cache.h b/drivers/md/dm-pcache/cache.h
> index 1136d86958c8..27613b56be54 100644
> --- a/drivers/md/dm-pcache/cache.h
> +++ b/drivers/md/dm-pcache/cache.h
> @@ -339,7 +339,7 @@ void cache_seg_put(struct pcache_cache_segment *cache_seg);
> void cache_seg_set_next_seg(struct pcache_cache_segment *cache_seg, u32 seg_id);
>
> /* cache request*/
> -int cache_flush(struct pcache_cache *cache);
> +int pcache_cache_flush(struct pcache_cache *cache);
> void miss_read_end_work_fn(struct work_struct *work);
> int pcache_cache_handle_req(struct pcache_cache *cache, struct pcache_request *pcache_req);
>
> diff --git a/drivers/md/dm-pcache/cache_req.c b/drivers/md/dm-pcache/cache_req.c
> index 27f94c1fa968..7854a30e07b7 100644
> --- a/drivers/md/dm-pcache/cache_req.c
> +++ b/drivers/md/dm-pcache/cache_req.c
> @@ -790,7 +790,7 @@ static int cache_write(struct pcache_cache *cache, struct pcache_request *pcache
> }
>
> /**
> - * cache_flush - Flush all ksets to persist any pending cache data
> + * pcache_cache_flush - Flush all ksets to persist any pending cache data
> * @cache: Pointer to the cache structure
> *
> * This function iterates through all ksets associated with the provided `cache`
> @@ -802,7 +802,7 @@ static int cache_write(struct pcache_cache *cache, struct pcache_request *pcache
> * the respective error code, preventing the flush operation from proceeding to
> * subsequent ksets.
> */
> -int cache_flush(struct pcache_cache *cache)
> +int pcache_cache_flush(struct pcache_cache *cache)
> {
> struct pcache_cache_kset *kset;
> int ret;
> @@ -827,7 +827,7 @@ int pcache_cache_handle_req(struct pcache_cache *cache, struct pcache_request *p
> struct bio *bio = pcache_req->bio;
>
> if (unlikely(bio->bi_opf & REQ_PREFLUSH))
> - return cache_flush(cache);
> + return pcache_cache_flush(cache);
>
> if (bio_data_dir(bio) == READ)
> return cache_read(cache, pcache_req);
next prev parent reply other threads:[~2025-11-13 6:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-11 12:13 [PATCH v2 0/3] dm-pcache: built-in support and metadata hardening Li Chen
2025-11-11 12:13 ` [PATCH v2 1/3] dm-pcache: allow built-in build and rename flush helper Li Chen
2025-11-13 6:39 ` Dongsheng Yang [this message]
2025-11-11 12:13 ` [PATCH v2 2/3] dm-pcache: reuse meta_addr in pcache_meta_find_latest Li Chen
2025-11-13 6:40 ` Dongsheng Yang
2025-11-11 12:13 ` [PATCH v2 3/3] dm-pcache: zero cache_info before default init Li Chen
2025-11-12 8:24 ` Zheng Gu
2025-11-13 6:40 ` Dongsheng Yang
2025-11-13 6:43 ` [PATCH v2 0/3] dm-pcache: built-in support and metadata hardening Dongsheng Yang
2025-11-18 18:05 ` Mikulas Patocka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=698ecc2f-0c19-4a9a-a493-f675dc14ec5e@linux.dev \
--to=dongsheng.yang@linux.dev \
--cc=cengku@gmail.com \
--cc=dm-devel@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=me@linux.beauty \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.