From 85e4fee3be74cd0e6f2f2e5593711abd6ec4eb23 Mon Sep 17 00:00:00 2001 From: scjody Date: Sat, 31 Mar 2007 00:20:55 +0000 Subject: [PATCH] Branch HEAD Add new ldiskfs2 module based on ldiskfs. b=11981 r=adilger r=nathan --- lustre/Makefile.in | 2 +- lustre/autoMakefile.am | 6 +- lustre/autoconf/lustre-core.m4 | 10 ++- .../kernel_patches/series/ldiskfs2-2.6-fc3.series | 13 ++++ .../kernel_patches/series/ldiskfs2-2.6-fc5.series | 12 ++++ .../series/ldiskfs2-2.6-rhel4.series | 15 ++++ .../series/ldiskfs2-2.6-sles10.series | 13 ++++ .../kernel_patches/series/ldiskfs2-2.6-suse.series | 16 +++++ .../series/ldiskfs2-2.6.12-vanilla.series | 15 ++++ .../series/ldiskfs2-2.6.18-vanilla.series | 12 ++++ lustre/ldiskfs2/.cvsignore | 19 +++++ lustre/ldiskfs2/Makefile.in | 21 ++++++ lustre/ldiskfs2/autoMakefile.am | 80 ++++++++++++++++++++++ lustre/lvfs/.cvsignore | 4 +- lustre/lvfs/Makefile.in | 4 +- lustre/lvfs/autoMakefile.am | 28 +++++++- 16 files changed, 259 insertions(+), 11 deletions(-) create mode 100644 lustre/kernel_patches/series/ldiskfs2-2.6-fc3.series create mode 100644 lustre/kernel_patches/series/ldiskfs2-2.6-fc5.series create mode 100644 lustre/kernel_patches/series/ldiskfs2-2.6-rhel4.series create mode 100644 lustre/kernel_patches/series/ldiskfs2-2.6-sles10.series create mode 100644 lustre/kernel_patches/series/ldiskfs2-2.6-suse.series create mode 100644 lustre/kernel_patches/series/ldiskfs2-2.6.12-vanilla.series create mode 100644 lustre/kernel_patches/series/ldiskfs2-2.6.18-vanilla.series create mode 100644 lustre/ldiskfs2/.cvsignore create mode 100644 lustre/ldiskfs2/Makefile.in create mode 100644 lustre/ldiskfs2/autoMakefile.am diff --git a/lustre/Makefile.in b/lustre/Makefile.in index 1b7a9be..cca2b21 100644 --- a/lustre/Makefile.in +++ b/lustre/Makefile.in @@ -1,4 +1,4 @@ -@LDISKFS_TRUE@subdir-m += ldiskfs +@LDISKFS_TRUE@subdir-m += ldiskfs ldiskfs2 subdir-m += lvfs subdir-m += obdclass diff --git a/lustre/autoMakefile.am b/lustre/autoMakefile.am index f0531e8..b2097ea 100644 --- a/lustre/autoMakefile.am +++ b/lustre/autoMakefile.am @@ -9,7 +9,7 @@ AUTOMAKE_OPTIONS = foreign ALWAYS_SUBDIRS := include lvfs obdclass ldlm ptlrpc osc lov obdecho \ mgc doc utils tests scripts autoconf contrib -SERVER_SUBDIRS := ldiskfs obdfilter ost mds mgs +SERVER_SUBDIRS := ldiskfs ldiskfs2 obdfilter ost mds mgs CLIENT_SUBDIRS := mdc llite @@ -45,9 +45,11 @@ DIST_SUBDIRS := $(ALWAYS_SUBDIRS) $(SERVER_SUBDIRS) $(CLIENT_SUBDIRS) \ EXTRA_DIST = BUGS FDL kernel_patches if LDISKFS -LDISKFS = ldiskfs-sources +LDISKFS = ldiskfs-sources ldiskfs2-sources ldiskfs-sources: $(MAKE) sources -C ldiskfs +ldiskfs2-sources: + $(MAKE) sources -C ldiskfs2 endif lvfs-sources: diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index f9ee3a8..20e788f 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -340,8 +340,12 @@ if test x$enable_ldiskfs = xyes ; then AC_DEFINE(CONFIG_LDISKFS_FS_MODULE, 1, [build ldiskfs as a module]) AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [enable extended attributes for ldiskfs]) - AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [enable posix acls]) - AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1, [enable fs security]) + AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [enable posix acls for ldiskfs]) + AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1, [enable fs security for ldiskfs]) + + AC_DEFINE(CONFIG_LDISKFS2_FS_XATTR, 1, [enable extended attributes for ldiskfs2]) + AC_DEFINE(CONFIG_LDISKFS2_FS_POSIX_ACL, 1, [enable posix acls for ldiskfs2]) + AC_DEFINE(CONFIG_LDISKFS2_FS_SECURITY, 1, [enable fs security for ldiskfs2]) fi AC_MSG_CHECKING([which backing filesystem to use]) @@ -1297,6 +1301,8 @@ lustre/kernel_patches/targets/suse-2.4.21-2.target lustre/kernel_patches/targets/sles-2.4.target lustre/ldiskfs/Makefile lustre/ldiskfs/autoMakefile +lustre/ldiskfs2/Makefile +lustre/ldiskfs2/autoMakefile lustre/ldlm/Makefile lustre/liblustre/Makefile lustre/liblustre/tests/Makefile diff --git a/lustre/kernel_patches/series/ldiskfs2-2.6-fc3.series b/lustre/kernel_patches/series/ldiskfs2-2.6-fc3.series new file mode 100644 index 0000000..3661023 --- /dev/null +++ b/lustre/kernel_patches/series/ldiskfs2-2.6-fc3.series @@ -0,0 +1,13 @@ +ext3-wantedi-2.6-rhel4.patch +ext3-san-jdike-2.6-suse.patch +iopen-2.6-rhel4.patch +export_symbols-ext3-2.6-suse.patch +ext3-map_inode_page-2.6-suse.patch +ext3-ea-in-inode-2.6-rhel4.patch +export-ext3-2.6-rhel4.patch +ext3-include-fixes-2.6-rhel4.patch +ext3-extents-2.6.9-rhel4.patch +ext3-mballoc2-2.6.9-rhel4.patch +ext3-nlinks-2.6.9.patch +ext3-ialloc-2.6.patch +ext3-lookup-dotdot-2.6.9.patch diff --git a/lustre/kernel_patches/series/ldiskfs2-2.6-fc5.series b/lustre/kernel_patches/series/ldiskfs2-2.6-fc5.series new file mode 100644 index 0000000..1c853bd --- /dev/null +++ b/lustre/kernel_patches/series/ldiskfs2-2.6-fc5.series @@ -0,0 +1,12 @@ +ext3-wantedi-2.6-rhel4.patch +ext3-san-jdike-2.6-suse.patch +iopen-2.6-fc5.patch +ext3-map_inode_page-2.6-suse.patch +export-ext3-2.6-rhel4.patch +ext3-include-fixes-2.6-rhel4.patch +ext3-extents-2.6.15.patch +ext3-mballoc2-2.6-fc5.patch +ext3-nlinks-2.6.9.patch +ext3-ialloc-2.6.patch +ext3-remove-cond_resched-calls-2.6.12.patch +ext3-filterdata-2.6.15.patch diff --git a/lustre/kernel_patches/series/ldiskfs2-2.6-rhel4.series b/lustre/kernel_patches/series/ldiskfs2-2.6-rhel4.series new file mode 100644 index 0000000..7829040 --- /dev/null +++ b/lustre/kernel_patches/series/ldiskfs2-2.6-rhel4.series @@ -0,0 +1,15 @@ +ext3-wantedi-2.6-rhel4.patch +ext3-san-jdike-2.6-suse.patch +iopen-2.6-rhel4.patch +export_symbols-ext3-2.6-suse.patch +ext3-map_inode_page-2.6-suse.patch +ext3-ea-in-inode-2.6-rhel4.patch +export-ext3-2.6-rhel4.patch +ext3-include-fixes-2.6-rhel4.patch +ext3-extents-2.6.9-rhel4.patch +ext3-mballoc2-2.6.9-rhel4.patch +ext3-nlinks-2.6.9.patch +ext3-ialloc-2.6.patch +ext3-lookup-dotdot-2.6.9.patch +ext3-sector_t-overflow-2.6.9-rhel4.patch +ext3-check-jbd-errors-2.6.9.patch diff --git a/lustre/kernel_patches/series/ldiskfs2-2.6-sles10.series b/lustre/kernel_patches/series/ldiskfs2-2.6-sles10.series new file mode 100644 index 0000000..18a2997 --- /dev/null +++ b/lustre/kernel_patches/series/ldiskfs2-2.6-sles10.series @@ -0,0 +1,13 @@ +ext3-wantedi-2.6-rhel4.patch +ext3-san-jdike-2.6-suse.patch +iopen-2.6-fc5.patch +ext3-map_inode_page-2.6-suse.patch +export-ext3-2.6-rhel4.patch +ext3-include-fixes-2.6-rhel4.patch +ext3-extents-2.6.16-sles10.patch +ext3-mballoc2-2.6-fc5.patch +ext3-nlinks-2.6.9.patch +ext3-ialloc-2.6.patch +ext3-remove-cond_resched-calls-2.6.12.patch +ext3-filterdata-2.6.15.patch +ext3-disable-write-barrier-by-default-2.6-sles10.patch diff --git a/lustre/kernel_patches/series/ldiskfs2-2.6-suse.series b/lustre/kernel_patches/series/ldiskfs2-2.6-suse.series new file mode 100644 index 0000000..6a5f05d --- /dev/null +++ b/lustre/kernel_patches/series/ldiskfs2-2.6-suse.series @@ -0,0 +1,16 @@ +ext3-wantedi-2.6-suse.patch +ext3-san-jdike-2.6-suse.patch +iopen-2.6-suse.patch +export_symbols-ext3-2.6-suse.patch +ext3-map_inode_page-2.6-suse.patch +ext3-ea-in-inode-2.6-suse.patch +export-ext3-2.6-suse.patch +ext3-include-fixes-2.6-suse.patch +ext3-extents-2.6.5.patch +ext3-mballoc2-2.6-suse.patch +ext3-nlinks-2.6.7.patch +ext3-rename-reserve-2.6-suse.patch +ext3-ialloc-2.6.patch +ext3-lookup-dotdot-2.6.9.patch +ext3-sector_t-overflow-2.6.5-suse.patch +ext3-check-jbd-errors-2.6.5.patch diff --git a/lustre/kernel_patches/series/ldiskfs2-2.6.12-vanilla.series b/lustre/kernel_patches/series/ldiskfs2-2.6.12-vanilla.series new file mode 100644 index 0000000..53c060b --- /dev/null +++ b/lustre/kernel_patches/series/ldiskfs2-2.6.12-vanilla.series @@ -0,0 +1,15 @@ +ext3-wantedi-2.6-rhel4.patch +ext3-san-jdike-2.6-suse.patch +iopen-2.6.12.patch +ext3-map_inode_page-2.6-suse.patch +export-ext3-2.6-rhel4.patch +ext3-include-fixes-2.6-rhel4.patch +ext3-extents-2.6.12.patch +ext3-mballoc2-2.6.12.patch +ext3-nlinks-2.6.9.patch +ext3-ialloc-2.6.patch +ext3-remove-cond_resched-calls-2.6.12.patch +ext3-htree-dot-2.6.patch +ext3-external-journal-2.6.12.patch +ext3-lookup-dotdot-2.6.9.patch +ext3-sector_t-overflow-2.6.12.patch diff --git a/lustre/kernel_patches/series/ldiskfs2-2.6.18-vanilla.series b/lustre/kernel_patches/series/ldiskfs2-2.6.18-vanilla.series new file mode 100644 index 0000000..532c05c --- /dev/null +++ b/lustre/kernel_patches/series/ldiskfs2-2.6.18-vanilla.series @@ -0,0 +1,12 @@ +ext3-wantedi-2.6-rhel4.patch +ext3-san-jdike-2.6-suse.patch +iopen-2.6-fc5.patch +ext3-map_inode_page-2.6-suse.patch +export-ext3-2.6-rhel4.patch +ext3-include-fixes-2.6-rhel4.patch +ext3-extents-2.6.18-vanilla.patch +ext3-mballoc2-2.6.18-vanilla.patch +ext3-nlinks-2.6.9.patch +ext3-ialloc-2.6.patch +ext3-remove-cond_resched-calls-2.6.12.patch +ext3-filterdata-2.6.15.patch diff --git a/lustre/ldiskfs2/.cvsignore b/lustre/ldiskfs2/.cvsignore new file mode 100644 index 0000000..9ad7f07 --- /dev/null +++ b/lustre/ldiskfs2/.cvsignore @@ -0,0 +1,19 @@ +.Xrefs +config.log +config.status +configure +Makefile +.deps +TAGS +autoMakefile.in +autoMakefile +*.ko +*.mod.c +.*.cmd +.*.flags +.tmp_versions +linux-stage +linux +*.c +*.h +sources diff --git a/lustre/ldiskfs2/Makefile.in b/lustre/ldiskfs2/Makefile.in new file mode 100644 index 0000000..d7739d8 --- /dev/null +++ b/lustre/ldiskfs2/Makefile.in @@ -0,0 +1,21 @@ +default: all + +MODULES := ldiskfs2 + +# copy makefile over to not break patches +ext3_extra := $(wildcard @LINUX@/fs/ext3/Makefile) + +ext3_headers := $(wildcard @LINUX@/fs/ext3/*.h) +linux_headers := $(wildcard @LINUX@/include/linux/ext3*.h) + +ext3_sources := $(filter-out %.mod.c,$(wildcard @LINUX@/fs/ext3/*.c)) +new_sources := iopen.c iopen.h extents.c mballoc.c +new_headers := ext3_extents.h +ldiskfs2_patched_sources := $(notdir $(ext3_sources) $(ext3_headers)) $(new_sources) $(new_headers) +ldiskfs2_sources := $(ldiskfs2_patched_sources) + +ldiskfs2-objs := $(filter %.o,$(ldiskfs2_sources:.c=.o)) + +EXTRA_PRE_CFLAGS := -I@LINUX@/fs -I@LUSTRE@ -I@LUSTRE@/ldiskfs2 + +@INCLUDE_RULES@ diff --git a/lustre/ldiskfs2/autoMakefile.am b/lustre/ldiskfs2/autoMakefile.am new file mode 100644 index 0000000..5b7ac7c --- /dev/null +++ b/lustre/ldiskfs2/autoMakefile.am @@ -0,0 +1,80 @@ +if MODULES +if LDISKFS +modulefs_DATA = ldiskfs2$(KMODEXT) +endif +endif + +ldiskfs2_linux_headers := $(addprefix linux/,$(subst ext3,ldiskfs2,$(notdir $(linux_headers)))) + +$(filter %.c,$(ldiskfs2_patched_sources)): sources $(ldiskfs2_linux_headers) $(filter %.h,$(ldiskfs2_patched_sources)) + +ldiskfs2_sed_flags = \ + -e "s/dx_hash_info/ext3_dx_hash_info/g" \ + -e "s/dir_private_info/ext3_dir_private_info/g" \ + -e "s/DX_HASH/EXT3_DX_HASH/g" \ + -e "s/reserve_window/ext3_reserve_window/g" \ + -e "s/rsv_window_add/ext3_rsv_window_add/g" \ + -e "s/EXT3/LDISKFS2/g" -e "s/ext3/ldiskfs2/g" + +%.c: linux-stage/fs/ext3/%.c + sed $(strip $(ldiskfs2_sed_flags)) $< > $@ + +%.h: linux-stage/fs/ext3/%.h + sed $(strip $(ldiskfs2_sed_flags)) $< > $@ + +linux/ldiskfs2%.h: linux-stage/include/linux/ext3%.h + sed $(strip $(ldiskfs2_sed_flags)) $< > $@ + +# +# FIXME: we need to grab the series in configure somehow +# (see bug 1679) +# +series := @top_srcdir@/lustre/kernel_patches/series/ldiskfs2-$(LDISKFS_SERIES) +patches := @top_srcdir@/lustre/kernel_patches/patches + +sources: $(ext3_sources) $(ext3_headers) $(linux_headers) $(series) + rm -rf linux-stage linux sources $(ldiskfs2_SOURCES) + mkdir -p linux-stage/fs/ext3 linux-stage/include/linux + cp $(ext3_sources) $(ext3_headers) $(ext3_extra) linux-stage/fs/ext3 + cp $(linux_headers) linux-stage/include/linux +if USE_QUILT + ln -s ../$(patches) linux-stage/patches + ln -s ../$(series) linux-stage/series + cd linux-stage && quilt push -a -q +else + @echo -n "Applying ext3 patches:" + @cd linux-stage && for i in $$(<../$(series)) ; do \ + echo -n " $$i" ; \ + patch -s -p1 < ../$(patches)/$$i || exit 1 ; \ + done + @echo +endif + mkdir linux + @echo -n "Replacing 'ext3' with 'ldiskfs2':" + @for i in $(notdir $(ext3_headers) $(ext3_sources)) $(new_sources) ; do \ + echo -n " $$i" ; \ + sed $(strip $(ldiskfs2_sed_flags)) \ + linux-stage/fs/ext3/$$i > $$i ; \ + done + @for i in $(subst ext3,,$(notdir $(linux_headers) $(new_headers))) ; do \ + echo -n " ext3$$i" ; \ + sed $(strip $(ldiskfs2_sed_flags)) \ + linux-stage/include/linux/ext3$$i \ + > linux/ldiskfs2$$i ; \ + done + @echo + touch sources + +foo-check: + @echo "ldiskfs2_sources: $(ldiskfs2_sources)" + @echo "ldiskfs2_SOURCES: $(ldiskfs2_SOURCES)" + @echo "ldiskfs2_headers: $(ldiskfs2_headers)" + @echo "ldiskfs2_objects: $(ldiskfs2_objects)" + @echo "ldiskfs2_OBJECTS: $(ldiskfs2_OBJECTS)" + @echo "ldiskfs2_LDADD: $(ldiskfs2_LDADD)" + +MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ +CLEANFILES = sources $(notdir $(linux_headers) $(ext3_headers) $(ext3_sources) $(new_sources) $(new_headers)) + +clean: clean-am + rm -rf linux linux-stage diff --git a/lustre/lvfs/.cvsignore b/lustre/lvfs/.cvsignore index d18b255..fe3989f 100644 --- a/lustre/lvfs/.cvsignore +++ b/lustre/lvfs/.cvsignore @@ -15,5 +15,5 @@ autoMakefile .tmp_versions .depend sources -fsfilt_ldiskfs.* -fsfilt-ldiskfs.* +fsfilt_ldiskfs* +fsfilt-ldiskfs* diff --git a/lustre/lvfs/Makefile.in b/lustre/lvfs/Makefile.in index 2e31097..6a8feb5 100644 --- a/lustre/lvfs/Makefile.in +++ b/lustre/lvfs/Makefile.in @@ -1,5 +1,6 @@ MODULES := lvfs @SERVER_TRUE@MODULES += fsfilt_@BACKINGFS@ +@LDISKFS_TRUE@MODULES += fsfilt_ldiskfs2 @QUOTA_TRUE@MODULES += quotafmt_test lvfs-objs := lvfs_common.o lvfs_linux.o fsfilt.o upcall_cache.o @@ -9,12 +10,13 @@ lvfs-objs := lvfs_common.o lvfs_linux.o fsfilt.o upcall_cache.o ifeq ($(PATCHLEVEL),6) fsfilt_@BACKINGFS@-objs := fsfilt-@BACKINGFS@.o +fsfilt_ldiskfs2-objs := fsfilt-ldiskfs2.o $(obj)/fsfilt-%.c: $(obj)/fsfilt_%.c ln -s $< $@ endif # for on 2.6 -EXTRA_PRE_CFLAGS := -I@LINUX@/fs -I@LUSTRE@ -I@LUSTRE@/ldiskfs +EXTRA_PRE_CFLAGS := -I@LINUX@/fs -I@LUSTRE@ -I@LUSTRE@/ldiskfs -I@LUSTRE@/ldiskfs2 @INCLUDE_RULES@ diff --git a/lustre/lvfs/autoMakefile.am b/lustre/lvfs/autoMakefile.am index 61d8fdf..77faaf2 100644 --- a/lustre/lvfs/autoMakefile.am +++ b/lustre/lvfs/autoMakefile.am @@ -21,12 +21,24 @@ modulefs_DATA := lvfs$(KMODEXT) if SERVER modulefs_DATA += fsfilt_$(BACKINGFS)$(KMODEXT) + +if LDISKFS + +modulefs_DATA += fsfilt_ldiskfs2$(KMODEXT) +sources: fsfilt_$(BACKINGFS).c fsfilt_ldiskfs2.c + touch sources + +else #LDISKFS + sources: fsfilt_$(BACKINGFS).c touch sources -else + +endif #LDISKFS + +else #SERVER sources: -endif +endif #SERVER fsfilt_extN.c: fsfilt_ext3.c sed -e "s/EXT3/EXTN/g" -e "s/ext3/extN/g" $< > $@ @@ -39,8 +51,18 @@ ldiskfs_sed_flags = \ -e "s/rsv_window_add/ext3_rsv_window_add/g" \ -e "s/EXT3/LDISKFS/g" -e "s/ext3/ldiskfs/g" +ldiskfs2_sed_flags = \ + -e "s/dx_hash_info/ext3_dx_hash_info/g" \ + -e "s/dir_private_info/ext3_dir_private_info/g" \ + -e "s/DX_HASH/EXT3_DX_HASH/g" \ + -e "s/reserve_window/ext3_reserve_window/g" \ + -e "s/rsv_window_add/ext3_rsv_window_add/g" \ + -e "s/EXT3/LDISKFS2/g" -e "s/ext3/ldiskfs2/g" + fsfilt_ldiskfs.c: fsfilt_ext3.c sed $(strip $(ldiskfs_sed_flags)) $< > $@ +fsfilt_ldiskfs2.c: fsfilt_ext3.c + sed $(strip $(ldiskfs2_sed_flags)) $< > $@ fsfilt_ldiskfs_quota.h: fsfilt_ext3_quota.h sed $(strip $(ldiskfs_sed_flags)) $< > $@ @@ -77,5 +99,5 @@ DIST_SOURCES = fsfilt.c fsfilt_ext3.c fsfilt_reiserfs.c lvfs_common.c \ # quotacheck_test.c quotactl_test.c fsfilt_ext3_quota.h MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ -CLEANFILES = fsfilt-*.c fsfilt_ldiskfs.c fsfilt_extN.c sources +CLEANFILES = fsfilt-*.c fsfilt_ldiskfs*.c fsfilt_extN.c sources -- 1.8.3.1