Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
bcache: hack sysfs macro code to avoid conflict with mm cache_show
Otherwise the build fails as follows:

In file included from drivers/md/bcache/super.c:132:
drivers/md/bcache/sysfs.c:719: error: conflicting types for ‘cache_show’
include/linux/slab.h:224: note: previous declaration of ‘cache_show’ was here
  • Loading branch information
snitm committed Jan 8, 2013
1 parent 9bc9f26 commit 400b125
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/md/bcache/sysfs.c
Expand Up @@ -623,7 +623,7 @@ static void cache_set_kobject_init(struct cache_set *c)
kobject_init(&c->internal, &cache_set_internal_obj);
}

SHOW(__cache)
SHOW(__bcache)
{
struct cache *ca = container_of(kobj, struct cache, kobj);

Expand Down Expand Up @@ -716,9 +716,9 @@ SHOW(__cache)

return 0;
}
SHOW_LOCKED(cache)
SHOW_LOCKED(bcache)

STORE(__cache)
STORE(__bcache)
{
struct cache *ca = container_of(kobj, struct cache, kobj);

Expand Down Expand Up @@ -785,11 +785,11 @@ STORE(__cache)

return size;
}
STORE_LOCKED(cache)
STORE_LOCKED(bcache)

static void cache_kobject_init(struct cache *ca)
{
static struct attribute *cache_files[] = {
static struct attribute *bcache_files[] = {
&sysfs_bucket_size,
&sysfs_block_size,
&sysfs_nbuckets,
Expand All @@ -804,7 +804,7 @@ static void cache_kobject_init(struct cache *ca)
&sysfs_cache_replacement_policy,
NULL
};
KTYPE(cache, cache_free);
KTYPE(bcache, cache_free);

kobject_init(&ca->kobj, &cache_obj);
kobject_init(&ca->kobj, &bcache_obj);
}

0 comments on commit 400b125

Please sign in to comment.