mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
bcache: remove can_attach_cache()
After removing the embedded struct cache_sb from struct cache_set, cache set will directly reference the in-memory super block of struct cache. It is unnecessary to compare block_size, bucket_size and nr_in_set from the identical in-memory super block in can_attach_cache(). This is a preparation patch for latter removing cache_set->sb from struct cache_set. Signed-off-by: Coly Li <colyli@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
08a1782881
commit
ebaa1ac12b
@ -2127,13 +2127,6 @@ static int run_cache_set(struct cache_set *c)
|
|||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool can_attach_cache(struct cache *ca, struct cache_set *c)
|
|
||||||
{
|
|
||||||
return ca->sb.block_size == c->sb.block_size &&
|
|
||||||
ca->sb.bucket_size == c->sb.bucket_size &&
|
|
||||||
ca->sb.nr_in_set == c->sb.nr_in_set;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const char *register_cache_set(struct cache *ca)
|
static const char *register_cache_set(struct cache *ca)
|
||||||
{
|
{
|
||||||
char buf[12];
|
char buf[12];
|
||||||
@ -2145,9 +2138,6 @@ static const char *register_cache_set(struct cache *ca)
|
|||||||
if (c->cache)
|
if (c->cache)
|
||||||
return "duplicate cache set member";
|
return "duplicate cache set member";
|
||||||
|
|
||||||
if (!can_attach_cache(ca, c))
|
|
||||||
return "cache sb does not match set";
|
|
||||||
|
|
||||||
if (!CACHE_SYNC(&ca->sb))
|
if (!CACHE_SYNC(&ca->sb))
|
||||||
SET_CACHE_SYNC(&c->sb, false);
|
SET_CACHE_SYNC(&c->sb, false);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user