Commit 958bf494 authored by Coly Li's avatar Coly Li Committed by Jens Axboe

bcache: replace Symbolic permissions by octal permission numbers

Symbolic permission names are used in bcache, for now octal permission
numbers are encouraged to use for readability. This patch replaces
all symbolic permissions by octal permission numbers.
Signed-off-by: default avatarColy Li <colyli@suse.de>
Reviewed-by: default avatarShenghui Wang <shhuiw@foxmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent b0d30981
...@@ -881,11 +881,11 @@ static inline uint8_t bucket_gc_gen(struct bucket *b) ...@@ -881,11 +881,11 @@ static inline uint8_t bucket_gc_gen(struct bucket *b)
#define BUCKET_GC_GEN_MAX 96U #define BUCKET_GC_GEN_MAX 96U
#define kobj_attribute_write(n, fn) \ #define kobj_attribute_write(n, fn) \
static struct kobj_attribute ksysfs_##n = __ATTR(n, S_IWUSR, NULL, fn) static struct kobj_attribute ksysfs_##n = __ATTR(n, 0200, NULL, fn)
#define kobj_attribute_rw(n, show, store) \ #define kobj_attribute_rw(n, show, store) \
static struct kobj_attribute ksysfs_##n = \ static struct kobj_attribute ksysfs_##n = \
__ATTR(n, S_IWUSR|S_IRUSR, show, store) __ATTR(n, 0600, show, store)
static inline void wake_up_allocators(struct cache_set *c) static inline void wake_up_allocators(struct cache_set *c)
{ {
......
...@@ -44,9 +44,9 @@ STORE(fn) \ ...@@ -44,9 +44,9 @@ STORE(fn) \
static struct attribute sysfs_##_name = \ static struct attribute sysfs_##_name = \
{ .name = #_name, .mode = _mode } { .name = #_name, .mode = _mode }
#define write_attribute(n) __sysfs_attribute(n, S_IWUSR) #define write_attribute(n) __sysfs_attribute(n, 0200)
#define read_attribute(n) __sysfs_attribute(n, S_IRUGO) #define read_attribute(n) __sysfs_attribute(n, 0444)
#define rw_attribute(n) __sysfs_attribute(n, S_IRUGO|S_IWUSR) #define rw_attribute(n) __sysfs_attribute(n, 0644)
#define sysfs_printf(file, fmt, ...) \ #define sysfs_printf(file, fmt, ...) \
do { \ do { \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment