All of lore.kernel.org
 help / color / mirror / Atom feed
From: Coly Li <colyli@suse.de>
To: linux-bcache@vger.kernel.org
Cc: linux-block@vger.kernel.org, Coly Li <colyli@suse.de>
Subject: [PATCH 05/17] bcache: replace Symbolic permissions by octal permission numbers
Date: Thu,  9 Aug 2018 14:43:08 +0800	[thread overview]
Message-ID: <20180809064320.10229-6-colyli@suse.de> (raw)
In-Reply-To: <20180809064320.10229-1-colyli@suse.de>

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: Coly Li <colyli@suse.de>
---
 drivers/md/bcache/bcache.h | 4 ++--
 drivers/md/bcache/sysfs.h  | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
index 031a75a25d3e..66e6d5639b38 100644
--- a/drivers/md/bcache/bcache.h
+++ b/drivers/md/bcache/bcache.h
@@ -881,11 +881,11 @@ static inline uint8_t bucket_gc_gen(struct bucket *b)
 #define BUCKET_GC_GEN_MAX	96U
 
 #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)				\
 	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)
 {
diff --git a/drivers/md/bcache/sysfs.h b/drivers/md/bcache/sysfs.h
index b54fe9602529..3fe82425859c 100644
--- a/drivers/md/bcache/sysfs.h
+++ b/drivers/md/bcache/sysfs.h
@@ -44,9 +44,9 @@ STORE(fn)								\
 	static struct attribute sysfs_##_name =				\
 		{ .name = #_name, .mode = _mode }
 
-#define write_attribute(n)	__sysfs_attribute(n, S_IWUSR)
-#define read_attribute(n)	__sysfs_attribute(n, S_IRUGO)
-#define rw_attribute(n)		__sysfs_attribute(n, S_IRUGO|S_IWUSR)
+#define write_attribute(n)	__sysfs_attribute(n, 0200)
+#define read_attribute(n)	__sysfs_attribute(n, 0444)
+#define rw_attribute(n)		__sysfs_attribute(n, 0644)
 
 #define sysfs_printf(file, fmt, ...)					\
 do {									\
-- 
2.18.0

  parent reply	other threads:[~2018-08-09  9:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-09  6:43 [PATCH 00/17] fixes reported by checkpatch.pl Coly Li
2018-08-09  6:43 ` [PATCH 01/17] bcache: style fix to replace 'unsigned' by 'unsigned int' Coly Li
2018-08-09  6:43 ` [PATCH 02/17] bcache: style fix to add a blank line after declarations Coly Li
2018-08-09  6:43 ` [PATCH 03/17] bcache: add identifier names to arguments of function definitions Coly Li
2018-08-09  6:43 ` [PATCH 04/17] bcache: style fixes for lines over 80 characters Coly Li
2018-08-09  6:43 ` Coly Li [this message]
2018-08-09  6:43 ` [PATCH 06/17] bcache: replace printk() by pr_*() routines Coly Li
2018-08-09  6:43 ` [PATCH 07/17] bcache: fix indent by replacing blank by tabs Coly Li
2018-08-09  6:43 ` [PATCH 08/17] bcache: replace '%pF' by '%pS' in seq_printf() Coly Li
2018-08-09  6:43 ` [PATCH 09/17] bcache: fix typo 'succesfully' to 'successfully' Coly Li
2018-08-09  6:43 ` [PATCH 10/17] bcache: prefer 'help' in Kconfig Coly Li
2018-08-09  6:43 ` [PATCH 11/17] bcache: do not check NULL pointer before calling kmem_cache_destroy Coly Li
2018-08-09  6:43 ` [PATCH 12/17] bcache: fix code comments style Coly Li
     [not found]   ` <44e430ab-36fd-caed-3d1b-65647fa9b42e@foxmail.com>
2018-08-10  6:55     ` Coly Li
2018-08-09  6:43 ` [PATCH 13/17] bcache: add static const prefix to char * array declarations Coly Li
2018-08-09  6:43 ` [PATCH 14/17] bcache: move open brace at end of function definitions to next line Coly Li
2018-08-09  6:43 ` [PATCH 15/17] bcache: add missing SPDX header Coly Li
2018-08-09  6:43 ` [PATCH 16/17] bcache: remove unnecessary space before ioctl function pointer arguments Coly Li
2018-08-09  6:43 ` [PATCH 17/17] bcache: add the missing code comments for smp_mb() Coly Li

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=20180809064320.10229-6-colyli@suse.de \
    --to=colyli@suse.de \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    /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.