Skip to content

Commit

Permalink
kernfs: s/sysfs_dirent/kernfs_node/ and rename its friends accordingly
Browse files Browse the repository at this point in the history
kernfs has just been separated out from sysfs and we're already in
full conflict mode.  Nothing can make the situation any worse.  Let's
take the chance to name things properly.

This patch performs the following renames.

* s/sysfs_elem_dir/kernfs_elem_dir/
* s/sysfs_elem_symlink/kernfs_elem_symlink/
* s/sysfs_elem_attr/kernfs_elem_file/
* s/sysfs_dirent/kernfs_node/
* s/sd/kn/ in kernfs proper
* s/parent_sd/parent/
* s/target_sd/target/
* s/dir_sd/parent/
* s/to_sysfs_dirent()/rb_to_kn()/
* misc renames of local vars when they conflict with the above

Because md, mic and gpio dig into sysfs details, this patch ends up
modifying them.  All are sysfs_dirent renames and trivial.  While we
can avoid these by introducing a dummy wrapping struct sysfs_dirent
around kernfs_node, given the limited usage outside kernfs and sysfs
proper, I don't think such workaround is called for.

This patch is strictly rename only and doesn't introduce any
functional difference.

- mic / gpio renames were missing.  Spotted by kbuild test robot.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Neil Brown <neilb@suse.de>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Cc: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
htejun authored and gregkh committed Dec 11, 2013
1 parent a8b1c01 commit 324a56e
Show file tree
Hide file tree
Showing 21 changed files with 774 additions and 773 deletions.
4 changes: 2 additions & 2 deletions drivers/gpio/gpiolib.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ static const DEVICE_ATTR(value, 0644,

static irqreturn_t gpio_sysfs_irq(int irq, void *priv)
{
struct sysfs_dirent *value_sd = priv;
struct kernfs_node *value_sd = priv;

sysfs_notify_dirent(value_sd);
return IRQ_HANDLED;
Expand All @@ -402,7 +402,7 @@ static irqreturn_t gpio_sysfs_irq(int irq, void *priv)
static int gpio_setup_irq(struct gpio_desc *desc, struct device *dev,
unsigned long gpio_flags)
{
struct sysfs_dirent *value_sd;
struct kernfs_node *value_sd;
unsigned long irq_flags;
int ret, irq, id;

Expand Down
2 changes: 1 addition & 1 deletion drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,7 @@ int bitmap_create(struct mddev *mddev)
sector_t blocks = mddev->resync_max_sectors;
struct file *file = mddev->bitmap_info.file;
int err;
struct sysfs_dirent *bm = NULL;
struct kernfs_node *bm = NULL;

BUILD_BUG_ON(sizeof(bitmap_super_t) != 256);

Expand Down
2 changes: 1 addition & 1 deletion drivers/md/bitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ struct bitmap {
wait_queue_head_t overflow_wait;
wait_queue_head_t behind_wait;

struct sysfs_dirent *sysfs_can_clear;
struct kernfs_node *sysfs_can_clear;
};

/* the bitmap API */
Expand Down
10 changes: 5 additions & 5 deletions drivers/md/md.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ struct md_rdev {
*/
struct work_struct del_work; /* used for delayed sysfs removal */

struct sysfs_dirent *sysfs_state; /* handle for 'state'
struct kernfs_node *sysfs_state; /* handle for 'state'
* sysfs entry */

struct badblocks {
Expand Down Expand Up @@ -376,10 +376,10 @@ struct mddev {
sector_t resync_max; /* resync should pause
* when it gets here */

struct sysfs_dirent *sysfs_state; /* handle for 'array_state'
struct kernfs_node *sysfs_state; /* handle for 'array_state'
* file in sysfs.
*/
struct sysfs_dirent *sysfs_action; /* handle for 'sync_action' */
struct kernfs_node *sysfs_action; /* handle for 'sync_action' */

struct work_struct del_work; /* used for delayed sysfs removal */

Expand Down Expand Up @@ -498,13 +498,13 @@ struct md_sysfs_entry {
};
extern struct attribute_group md_bitmap_group;

static inline struct sysfs_dirent *sysfs_get_dirent_safe(struct sysfs_dirent *sd, char *name)
static inline struct kernfs_node *sysfs_get_dirent_safe(struct kernfs_node *sd, char *name)
{
if (sd)
return sysfs_get_dirent(sd, name);
return sd;
}
static inline void sysfs_notify_dirent_safe(struct sysfs_dirent *sd)
static inline void sysfs_notify_dirent_safe(struct kernfs_node *sd)
{
if (sd)
sysfs_notify_dirent(sd);
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/mic/host/mic_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ struct mic_device {
struct work_struct shutdown_work;
u8 state;
u8 shutdown_status;
struct sysfs_dirent *state_sysfs;
struct kernfs_node *state_sysfs;
struct completion reset_wait;
void *log_buf_addr;
int *log_buf_len;
Expand Down
Loading

0 comments on commit 324a56e

Please sign in to comment.