Later patches replace open-coded refcounting and attributes with
kobjects, which form the producer for sysfs. If CONFIG_SYSFS is
disabled, all the functionality of kobjects still exist but the
sysfs operations become no-ops.
This patch removes the CONFIG_AUFS_SYSAUFS option and builds sysaufs.c
unconditionally.
Signed-off-by: Jeff Mahoney <[EMAIL PROTECTED]>
---
fs/aufs/Makefile | 13 ++-------
fs/aufs/module.c | 5 ---
fs/aufs/super.h | 2 -
fs/aufs/sysaufs.h | 75 ------------------------------------------------------
fs/aufs/wkq.c | 2 -
5 files changed, 4 insertions(+), 93 deletions(-)
--- a/fs/aufs/Makefile
+++ b/fs/aufs/Makefile
@@ -62,14 +62,10 @@ endif
########################################
obj-$(CONFIG_AUFS) += aufs.o
-aufs-y := module.o super.o sbinfo.o xino.o \
- branch.o cpup.o whout.o plink.o wkq.o dcsub.o vfsub.o wbr_policy.o \
- opts.o \
- dentry.o dinfo.o \
- file.o f_op.o finfo.o \
- dir.o vdir.o \
- inode.o i_op.o i_op_add.o i_op_del.o i_op_ren.o iinfo.o \
- misc.o
+aufs-y += branch.o cpup.o dcsub.o dentry.o dinfo.o dir.o file.o finfo.o
\
+ f_op.o iinfo.o inode.o i_op_add.o i_op_del.o i_op.o i_op_ren.o\
+ misc.o module.o opts.o plink.o sbinfo.o super.o sysaufs.o \
+ vdir.o vfsub.o wbr_policy.o whout.o wkq.o xino.o
#xattr.o
ifeq ($(strip $(shell test ${SUBLEVEL} -ge 19 && echo t)),t)
@@ -84,7 +80,6 @@ endif
aufs-$(CONFIG_AUFS_WORKAROUND_FUSE) += br_fuse.o
aufs-$(CONFIG_AUFS_DLGT) += dlgt.o
-aufs-$(CONFIG_AUFS_SYSAUFS) += sysaufs.o
aufs-$(CONFIG_AUFS_HINOTIFY) += hinotify.o hin_or_dlgt.o
# dirty
ifndef CONFIG_AUFS_HINOTIFY
--- a/fs/aufs/module.c
+++ b/fs/aufs/module.c
@@ -246,10 +246,7 @@ static int __init aufs_init(void)
au_dir_roflags = au_file_roflags(O_DIRECTORY | O_LARGEFILE);
-//todo: move to sysaufs.h
-#ifndef CONFIG_AUFS_SYSAUFS
sysaufs_brs = 0;
-#endif
err = -EINVAL;
if (unlikely(aufs_nwkq <= 0))
@@ -333,14 +330,12 @@ module_exit(aufs_exit);
CONFIG_AUFS_BRANCH_MAX_511 or smaller is recommended.
#endif
-#ifdef CONFIG_AUFS_SYSAUFS
#ifndef CONFIG_SYSFS
#error CONFIG_AUFS_SYSAUFS requires CONFIG_SYSFS.
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
#error CONFIG_AUFS_SYSAUFS requires linux-2.6.18 and later.
#endif
-#endif /* CONFIG_AUFS_SYSAUFS */
#ifdef CONFIG_AUFS_EXPORT
#if !defined(CONFIG_EXPORTFS) && !defined(CONFIG_EXPORTFS_MODULE)
--- a/fs/aufs/super.h
+++ b/fs/aufs/super.h
@@ -145,10 +145,8 @@ struct aufs_sbinfo {
#endif
/* sysfs */
-#ifdef CONFIG_AUFS_SYSAUFS
/* super_blocks list is not exported */
struct list_head si_list;
-#endif
struct sysaufs_sbinfo *si_sa; // todo: move inside ifdef
#ifdef CONFIG_AUFS_ROBR
--- a/fs/aufs/sysaufs.h
+++ b/fs/aufs/sysaufs.h
@@ -67,29 +67,24 @@ enum {
};
struct sysaufs_sbinfo {
-#ifdef CONFIG_AUFS_SYSAUFS
//todo: try kset directly
au_subsys_t subsys;
struct attribute attr[SysaufsSb_Last];
struct kref ref;
int added;
-#endif
};
/* 'brN' entry under sysfs per super block */
struct sysaufs_br {
-#ifdef CONFIG_AUFS_SYSAUFS
char name[8];
struct attribute attr;
struct kref ref;
int added;
-#endif
};
/* ---------------------------------------------------------------------- */
struct aufs_branch;
-#ifdef CONFIG_AUFS_SYSAUFS
extern struct mutex au_sbilist_mtx;
extern struct list_head au_sbilist;
@@ -127,75 +122,5 @@ void sysaufs_sbinfo_del(struct super_blo
int __init sysaufs_init(void);
void sysaufs_fin(void);
-#else
-
-#define au_lock_sbilist() do {} while (0)
-#define au_unlock_sbilist() do {} while (0)
-
-static inline void au_sbilist_del(struct aufs_sbinfo *sbinfo)
-{
- /* empty */
-}
-
-static inline void au_sbilist_add(struct aufs_sbinfo *sbinfo)
-{
- /* empty */
-}
-
-static inline struct sysaufs_br *sysaufs_br_alloc(void)
-{
- return (void *)-1; //todo: poison
-}
-
-static inline void sysaufs_br_get(struct aufs_branch *br)
-{
- /* nothing */
-}
-
-static inline void sysaufs_br_put(struct aufs_branch *br)
-{
- /* nothing */
-}
-
-static inline void sysaufs_brs_add(struct super_block *sb)
-{
- /* nothing */
-}
-
-static inline void sysaufs_brs_del(struct super_block *sb)
-{
- /* nothing */
-}
-
-static inline struct sysaufs_sbinfo *sysaufs_sbinfo_alloc(void)
-{
- return (void *)-1; //todo: poison
-}
-
-static inline void sysaufs_sbinfo_get(struct super_block *sb)
-{
- /* nothing */
-}
-
-static inline void sysaufs_sbinfo_put(struct super_block *sb)
-{
- /* nothing */
-}
-
-static inline void sysaufs_sbinfo_add(struct super_block *sb)
-{
- /* nothing */
-}
-
-static inline void sysaufs_sbinfo_del(struct super_block *sb)
-{
- /* nothing */
-}
-
-#define sysaufs_init() 0
-#define sysaufs_fin() do {} while (0)
-
-#endif /* CONFIG_AUFS_SYSAUFS */
-
#endif /* __KERNEL__ */
#endif /* __SYSAUFS_H__ */
--- a/fs/aufs/wkq.c
+++ b/fs/aufs/wkq.c
@@ -117,7 +117,6 @@ static void dlgt_func(struct au_wkinfo *
static void update_busy(struct au_wkq *wkq, struct au_wkinfo *wkinfo)
{
-#ifdef CONFIG_AUFS_SYSAUFS
unsigned int new, old;
do {
@@ -126,7 +125,6 @@ static void update_busy(struct au_wkq *w
if (new <= old)
break;
} while (cmpxchg(&wkq->max_busy, old, new) == old);
-#endif
}
static int enqueue(struct au_wkq *wkq, struct au_wkinfo *wkinfo)
--
Jeff Mahoney
SUSE Labs
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone