Skip to content

Commit ebaa1ac

Browse files
Coly Liaxboe
authored andcommitted
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>
1 parent 08a1782 commit ebaa1ac

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

‎drivers/md/bcache/super.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,13 +2127,6 @@ static int run_cache_set(struct cache_set *c)
21272127
return -EIO;
21282128
}
21292129

2130-
static bool can_attach_cache(struct cache *ca, struct cache_set *c)
2131-
{
2132-
return ca->sb.block_size == c->sb.block_size &&
2133-
ca->sb.bucket_size == c->sb.bucket_size &&
2134-
ca->sb.nr_in_set == c->sb.nr_in_set;
2135-
}
2136-
21372130
static const char *register_cache_set(struct cache *ca)
21382131
{
21392132
char buf[12];
@@ -2145,9 +2138,6 @@ static const char *register_cache_set(struct cache *ca)
21452138
if (c->cache)
21462139
return "duplicate cache set member";
21472140

2148-
if (!can_attach_cache(ca, c))
2149-
return "cache sb does not match set";
2150-
21512141
if (!CACHE_SYNC(&ca->sb))
21522142
SET_CACHE_SYNC(&c->sb, false);
21532143

0 commit comments

Comments
 (0)