Skip to content

Commit

Permalink
sysfs, kernfs: reorganize SYSFS_* constants
Browse files Browse the repository at this point in the history
We want to add one more SYSFS_FLAG_* but we can't use the next higher
bit, 0x10000, as the flag field is 16bits wide.  The flags are
currently arranged weirdly - 8 bits are set aside for the type flags
when there are only three three used, the first flag starts at 0x1000
instead of 0x0100 and flag literals have 5 digits (20 bits) when only
4 digits can be used.

Rearrange them so that type bits are only the lowest four, flags start
at 0x0010 and similar flags are grouped.

This patch doesn't cause any behavior difference.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Tejun Heo authored and Greg Kroah-Hartman committed Nov 30, 2013
1 parent 024f647 commit 2b25a62
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fs/sysfs/sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,18 @@ struct sysfs_dirent {

#define SD_DEACTIVATED_BIAS INT_MIN

#define SYSFS_TYPE_MASK 0x00ff
#define SYSFS_TYPE_MASK 0x000f
#define SYSFS_DIR 0x0001
#define SYSFS_KOBJ_ATTR 0x0002
#define SYSFS_KOBJ_LINK 0x0008
#define SYSFS_KOBJ_LINK 0x0004
#define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK)
#define SYSFS_ACTIVE_REF SYSFS_KOBJ_ATTR

#define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK
#define SYSFS_FLAG_NS 0x01000
#define SYSFS_FLAG_REMOVED 0x02000
#define SYSFS_FLAG_HAS_SEQ_SHOW 0x04000
#define SYSFS_FLAG_HAS_MMAP 0x08000
#define SYSFS_FLAG_REMOVED 0x0010
#define SYSFS_FLAG_NS 0x0020
#define SYSFS_FLAG_HAS_SEQ_SHOW 0x0040
#define SYSFS_FLAG_HAS_MMAP 0x0080

static inline unsigned int sysfs_type(struct sysfs_dirent *sd)
{
Expand Down

0 comments on commit 2b25a62

Please sign in to comment.