Commit 4fb5000a authored by J. R. Okajima's avatar J. R. Okajima
Browse files

aufs module: modularize


Signed-off-by: default avatarJ. R. Okajima <hooanon05g@gmail.com>
parent aabf07ba
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
config AUFS_FS config AUFS_FS
bool "Aufs (Advanced multi layered unification filesystem) support" tristate "Aufs (Advanced multi layered unification filesystem) support"
help help
Aufs is a stackable unification filesystem such as Unionfs, Aufs is a stackable unification filesystem such as Unionfs,
which unifies several directories and provides a merged single which unifies several directories and provides a merged single
...@@ -72,7 +72,7 @@ endchoice ...@@ -72,7 +72,7 @@ endchoice
config AUFS_EXPORT config AUFS_EXPORT
bool "NFS-exportable aufs" bool "NFS-exportable aufs"
depends on EXPORTFS = y depends on EXPORTFS
help help
If you want to export your mounted aufs via NFS, then enable this If you want to export your mounted aufs via NFS, then enable this
option. There are several requirements for this configuration. option. There are several requirements for this configuration.
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
include ${srctree}/${src}/magic.mk include ${srctree}/${src}/magic.mk
ifeq (${CONFIG_AUFS_FS},m)
include ${srctree}/${src}/conf.mk
endif
-include ${srctree}/${src}/priv_def.mk -include ${srctree}/${src}/priv_def.mk
# cf. include/linux/kernel.h # cf. include/linux/kernel.h
# enable pr_debug # enable pr_debug
ccflags-y += -DDEBUG ccflags-y += -DDEBUG
# sparse requires the full pathname # sparse requires the full pathname
ifdef M
ccflags-y += -include ${M}/../../include/uapi/linux/aufs_type.h
else
ccflags-y += -include ${srctree}/include/uapi/linux/aufs_type.h ccflags-y += -include ${srctree}/include/uapi/linux/aufs_type.h
endif
obj-$(CONFIG_AUFS_FS) += aufs.o obj-$(CONFIG_AUFS_FS) += aufs.o
aufs-y := module.o sbinfo.o super.o branch.o xino.o sysaufs.o opts.o \ aufs-y := module.o sbinfo.o super.o branch.o xino.o sysaufs.o opts.o \
......
# SPDX-License-Identifier: GPL-2.0
AuConfStr = CONFIG_AUFS_FS=${CONFIG_AUFS_FS}
define AuConf
ifdef ${1}
AuConfStr += ${1}=${${1}}
endif
endef
AuConfAll = BRANCH_MAX_127 BRANCH_MAX_511 BRANCH_MAX_1023 BRANCH_MAX_32767 \
SBILIST \
HNOTIFY HFSNOTIFY \
EXPORT INO_T_64 \
XATTR \
FHSM \
RDU \
DIRREN \
SHWH \
BR_RAMFS \
BR_FUSE POLL \
BR_HFSPLUS \
BDEV_LOOP \
DEBUG MAGIC_SYSRQ
$(foreach i, ${AuConfAll}, \
$(eval $(call AuConf,CONFIG_AUFS_${i})))
AuConfName = ${obj}/conf.str
${AuConfName}.tmp: FORCE
@echo ${AuConfStr} | tr ' ' '\n' | sed -e 's/^/"/' -e 's/$$/\\n"/' > $@
${AuConfName}: ${AuConfName}.tmp
@diff -q $< $@ > /dev/null 2>&1 || { \
echo ' GEN ' $@; \
cp -p $< $@; \
}
FORCE:
clean-files += ${AuConfName} ${AuConfName}.tmp
${obj}/sysfs.o: ${AuConfName}
-include ${srctree}/${src}/conf_priv.mk
...@@ -132,6 +132,7 @@ MODULE_AUTHOR("Junjiro R. Okajima <aufs-users@lists.sourceforge.net>"); ...@@ -132,6 +132,7 @@ MODULE_AUTHOR("Junjiro R. Okajima <aufs-users@lists.sourceforge.net>");
MODULE_DESCRIPTION(AUFS_NAME MODULE_DESCRIPTION(AUFS_NAME
" -- Advanced multi layered unification filesystem"); " -- Advanced multi layered unification filesystem");
MODULE_VERSION(AUFS_VERSION); MODULE_VERSION(AUFS_VERSION);
MODULE_ALIAS_FS(AUFS_NAME);
/* this module parameter has no meaning when SYSFS is disabled */ /* this module parameter has no meaning when SYSFS is disabled */
int sysaufs_brs = 1; int sysaufs_brs = 1;
......
...@@ -11,7 +11,30 @@ ...@@ -11,7 +11,30 @@
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include "aufs.h" #include "aufs.h"
#ifdef CONFIG_AUFS_FS_MODULE
/* this entry violates the "one line per file" policy of sysfs */
static ssize_t config_show(struct kobject *kobj, struct kobj_attribute *attr,
char *buf)
{
ssize_t err;
static char *conf =
/* this file is generated at compiling */
#include "conf.str"
;
err = snprintf(buf, PAGE_SIZE, conf);
if (unlikely(err >= PAGE_SIZE))
err = -EFBIG;
return err;
}
static struct kobj_attribute au_config_attr = __ATTR_RO(config);
#endif
static struct attribute *au_attr[] = { static struct attribute *au_attr[] = {
#ifdef CONFIG_AUFS_FS_MODULE
&au_config_attr.attr,
#endif
NULL, /* need to NULL terminate the list of attributes */ NULL, /* need to NULL terminate the list of attributes */
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment