Skip to content

Commit

Permalink
sysfs: add proper sysfs_init() prototype
Browse files Browse the repository at this point in the history
Don't be crufty.  Mark it __must_check too.

Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Andrew Morton authored and Greg Kroah-Hartman committed Sep 26, 2006
1 parent f86db39 commit f20a9ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 1 addition & 9 deletions fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/acct.h>
#include <linux/capability.h>
#include <linux/module.h>
#include <linux/sysfs.h>
#include <linux/seq_file.h>
#include <linux/namespace.h>
#include <linux/namei.h>
Expand All @@ -28,15 +29,6 @@

extern int __init init_rootfs(void);

#ifdef CONFIG_SYSFS
extern int __init sysfs_init(void);
#else
static inline int sysfs_init(void)
{
return 0;
}
#endif

/* spinlock for vfsmount related operations, inplace of dcache_lock */
__cacheline_aligned_in_smp DEFINE_SPINLOCK(vfsmount_lock);

Expand Down
7 changes: 7 additions & 0 deletions include/linux/sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ int __must_check sysfs_create_group(struct kobject *,
void sysfs_remove_group(struct kobject *, const struct attribute_group *);
void sysfs_notify(struct kobject * k, char *dir, char *attr);

extern int __must_check sysfs_init(void);

#else /* CONFIG_SYSFS */

static inline int sysfs_create_dir(struct kobject * k)
Expand Down Expand Up @@ -194,6 +196,11 @@ static inline void sysfs_notify(struct kobject * k, char *dir, char *attr)
{
}

static inline int __must_check sysfs_init(void)
{
return 0;
}

#endif /* CONFIG_SYSFS */

#endif /* _SYSFS_H_ */

0 comments on commit f20a9ea

Please sign in to comment.