Add new ldiskfs2 module based on ldiskfs.
b=11981
r=adilger
r=nathan
-@LDISKFS_TRUE@subdir-m += ldiskfs
+@LDISKFS_TRUE@subdir-m += ldiskfs ldiskfs2
subdir-m += lvfs
subdir-m += obdclass
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
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:
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])
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
--- /dev/null
+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
--- /dev/null
+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
--- /dev/null
+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
--- /dev/null
+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
--- /dev/null
+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
--- /dev/null
+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
--- /dev/null
+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
--- /dev/null
+.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
--- /dev/null
+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@
--- /dev/null
+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
.tmp_versions
.depend
sources
-fsfilt_ldiskfs.*
-fsfilt-ldiskfs.*
+fsfilt_ldiskfs*
+fsfilt-ldiskfs*
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
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 <ext3/xattr.h> 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@
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" $< > $@
-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)) $< > $@
# 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