Whamcloud - gitweb
Branch b1_6
authoryangsheng <yangsheng>
Sat, 7 Mar 2009 07:02:58 +0000 (07:02 +0000)
committeryangsheng <yangsheng>
Sat, 7 Mar 2009 07:02:58 +0000 (07:02 +0000)
b=18503

Back changes for ext4 support.

build/autoconf/lustre-build.m4
ldiskfs/configure.ac
ldiskfs/ldiskfs/Makefile.in
ldiskfs/ldiskfs/autoMakefile.am

index 343748d..9ba15bc 100644 (file)
@@ -273,9 +273,6 @@ AC_DEFUN([LB_DEFINE_LDISKFS_OPTIONS],
        AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [enable extended attributes for ldiskfs])
        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_LDISKFS_FS_XATTR, 1, [enable extended attributes for ldiskfs])
        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_LDISKFSDEV_FS_POSIX_ACL, 1, [enable posix acls for ldiskfs])
-       AC_DEFINE(CONFIG_LDISKFSDEV_FS_XATTR, 1, [enable extented attributes for ldiskfs])
-       AC_DEFINE(CONFIG_LDISKFSDEV_FS_SECURITY, 1, [enable fs security for ldiskfs])
 ])
 
 #
 ])
 
 #
index 7de84cf..e7b19c1 100644 (file)
@@ -33,13 +33,6 @@ $2
 esac
 ])
 
 esac
 ])
 
-AC_DEFUN([LC_KERNEL_WITH_EXT4],
-[if test -f $LINUX/fs/ext4/ext4.h ; then
-$1
-else
-$2
-fi
-])
 
 AC_MSG_CHECKING([whether to build kernel modules])
 AC_ARG_ENABLE([modules],
 
 AC_MSG_CHECKING([whether to build kernel modules])
 AC_ARG_ENABLE([modules],
@@ -90,25 +83,6 @@ AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
 
 LB_DEFINE_LDISKFS_OPTIONS
 
 
 LB_DEFINE_LDISKFS_OPTIONS
 
-AC_MSG_CHECKING([whether to build ldisk base on ext4])
-AC_ARG_ENABLE([ext4],
-             AC_HELP_STRING([--disable-ext4],
-                            [disable building of ldiskfs base on ext4]),[],
-                            [LC_KERNEL_WITH_EXT4([enable_ext4='yes'],
-                            [enable_ext4='no'])])
-AC_MSG_RESULT([$enable_ext4])
-
-if test x$enable_ext4 = xyes ; then
-        BACKFS=ext4
-else
-        BACKFS=ext3
-fi
-AC_SUBST(BACKFS)
-BACKFSU=${BACKFS/ext/EXT}
-AC_SUBST(BACKFSU) # We need a Upper string
-
-AM_CONDITIONAL(USE_EXT4, test x$enable_ext4 = xyes)
-
 AC_MSG_CHECKING([which ldiskfs series to use])
 case $LINUXRELEASE in
 2.6.5*) LDISKFS_SERIES="2.6-suse.series" ;;
 AC_MSG_CHECKING([which ldiskfs series to use])
 case $LINUXRELEASE in
 2.6.5*) LDISKFS_SERIES="2.6-suse.series" ;;
@@ -120,17 +94,12 @@ case $LINUXRELEASE in
 2.6.16*) LDISKFS_SERIES="2.6-sles10.series";;
 2.6.18*)
        if test x$RHEL_KENEL = xyes; then
 2.6.16*) LDISKFS_SERIES="2.6-sles10.series";;
 2.6.18*)
        if test x$RHEL_KENEL = xyes; then
-                if test x$enable_ext4 = xyes; then
-                       LDISKFS_SERIES="2.6-rhel5-ext4.series"
-                else
-                       LDISKFS_SERIES="2.6-rhel5.series"
-                fi
+               LDISKFS_SERIES="2.6-rhel5.series"
        else
                LDISKFS_SERIES="2.6.18-vanilla.series"
        fi
        ;;
 2.6.22*) LDISKFS_SERIES="2.6.22-vanilla.series";;
        else
                LDISKFS_SERIES="2.6.18-vanilla.series"
        fi
        ;;
 2.6.22*) LDISKFS_SERIES="2.6.22-vanilla.series";;
-2.6.27*) LDISKFS_SERIES="2.6.27-vanilla.series";;
 *) AC_MSG_WARN([Unknown kernel version $LINUXRELEASE, fix ldiskfs/configure.ac])
 esac
 AC_MSG_RESULT([$LDISKFS_SERIES])
 *) AC_MSG_WARN([Unknown kernel version $LINUXRELEASE, fix ldiskfs/configure.ac])
 esac
 AC_MSG_RESULT([$LDISKFS_SERIES])
index 7f369b2..d70d42b 100644 (file)
@@ -3,23 +3,15 @@ default: all
 MODULES := ldiskfs
 
 # copy makefile over to not break patches
 MODULES := ldiskfs
 
 # copy makefile over to not break patches
-backfs_extra := $(wildcard @LINUX@/fs/@BACKFS@/Makefile)
+ext3_extra := $(wildcard @LINUX@/fs/ext3/Makefile)
 
 
-backfs_headers := $(wildcard @LINUX@/fs/@BACKFS@/*.h)
-linux_headers := $(wildcard @LINUX@/include/linux/@BACKFS@*.h)
+ext3_headers := $(wildcard @LINUX@/fs/ext3/*.h)
+linux_headers := $(wildcard @LINUX@/include/linux/ext3*.h)
 
 
-backfs_sources := $(filter-out %.mod.c,$(wildcard @LINUX@/fs/@BACKFS@/*.c))
-
-ext3_new_sources := iopen.c iopen.h extents.c mballoc.c group.h fiemap.h
-ext3_new_headers := ext3_extents.h 
-
-ext4_new_sources := iopen.c iopen.h fiemap.h
-ext4_new_headers :=
-
-new_sources := $(@BACKFS@_new_sources)
-new_headers := $(@BACKFS@_new_headers)
-
-ldiskfs_patched_sources := $(notdir $(backfs_sources) $(backfs_headers)) $(new_sources) $(new_headers)
+ext3_sources := $(filter-out %.mod.c,$(wildcard @LINUX@/fs/ext3/*.c))
+new_sources := iopen.c iopen.h extents.c mballoc.c group.h fiemap.h
+new_headers := ext3_extents.h 
+ldiskfs_patched_sources := $(notdir $(ext3_sources) $(ext3_headers)) $(new_sources) $(new_headers)
 ldiskfs_sources := $(ldiskfs_patched_sources)
 
 ldiskfs-objs := $(filter %.o,$(ldiskfs_sources:.c=.o))
 ldiskfs_sources := $(ldiskfs_patched_sources)
 
 ldiskfs-objs := $(filter %.o,$(ldiskfs_sources:.c=.o))
index 13a9558..f7b83ad 100644 (file)
@@ -1,42 +1,40 @@
 modulefs_DATA = ldiskfs$(KMODEXT)
 
 modulefs_DATA = ldiskfs$(KMODEXT)
 
-ldiskfs_linux_headers := $(addprefix linux/,$(subst @BACKFS@,ldiskfs,$(notdir $(linux_headers))))
+ldiskfs_linux_headers := $(addprefix linux/,$(subst ext3,ldiskfs,$(notdir $(linux_headers))))
 
 $(filter %.c,$(ldiskfs_patched_sources)): sources $(ldiskfs_linux_headers) $(filter %.h,$(ldiskfs_patched_sources))
 
 ldiskfs_sed_flags = \
 
 $(filter %.c,$(ldiskfs_patched_sources)): sources $(ldiskfs_linux_headers) $(filter %.h,$(ldiskfs_patched_sources))
 
 ldiskfs_sed_flags = \
-       -e "s/dx_hash_info/@BACKFS@_dx_hash_info/g" \
-       -e "s/dir_private_info/@BACKFS@_dir_private_info/g" \
-       -e "s/DX_HASH/@BACKFSU@_DX_HASH/g" \
-       -e "s/\<reserve_window/@BACKFS@_reserve_window/g" \
-       -e "s/\<rsv_window_add/@BACKFS@_rsv_window_add/g" \
-       -e "s/@BACKFSU@/LDISKFS/g" -e "s/@BACKFS@/ldiskfs/g"
+       -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/LDISKFS/g" -e "s/ext3/ldiskfs/g"
 
 
-%.c: linux-stage/fs/@BACKFS@/%.c
+%.c: linux-stage/fs/ext3/%.c
        sed $(strip $(ldiskfs_sed_flags)) $< > $@
 
        sed $(strip $(ldiskfs_sed_flags)) $< > $@
 
-%.h: linux-stage/fs/@BACKFS@/%.h
+%.h: linux-stage/fs/ext3/%.h
        sed $(strip $(ldiskfs_sed_flags)) $< > $@
 
        sed $(strip $(ldiskfs_sed_flags)) $< > $@
 
-linux/ldiskfs%.h: linux-stage/include/linux/@BACKFS@%.h
+linux/ldiskfs%.h: linux-stage/include/linux/ext3%.h
        sed $(strip $(ldiskfs_sed_flags)) $< > $@
 
 series := @top_srcdir@/kernel_patches/series/ldiskfs-$(LDISKFS_SERIES)
 patches := @top_srcdir@/kernel_patches/patches
 
        sed $(strip $(ldiskfs_sed_flags)) $< > $@
 
 series := @top_srcdir@/kernel_patches/series/ldiskfs-$(LDISKFS_SERIES)
 patches := @top_srcdir@/kernel_patches/patches
 
-sources: $(backfs_sources) $(backfs_headers) $(linux_headers) $(series)
+sources: $(ext3_sources) $(ext3_headers) $(linux_headers) $(series)
        rm -rf linux-stage linux sources $(ldiskfs_SOURCES)
        rm -rf linux-stage linux sources $(ldiskfs_SOURCES)
-       mkdir -p linux-stage/fs/@BACKFS@ linux-stage/include/linux
-       cp $(backfs_sources) $(backfs_headers) $(backfs_extra) linux-stage/fs/@BACKFS@
-       if test -n "$(linux_headers)" ; then \
-               cp $(linux_headers) linux-stage/include/linux; \
-       fi
+       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
 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 @BACKFS@ patches:"
+       @echo -n "Applying ext3 patches:"
        @cd linux-stage && for i in $$(<../$(series)) ; do \
                echo -n " $$i" ; \
                patch -s -p1 < ../$(patches)/$$i || exit 1 ; \
        @cd linux-stage && for i in $$(<../$(series)) ; do \
                echo -n " $$i" ; \
                patch -s -p1 < ../$(patches)/$$i || exit 1 ; \
@@ -44,22 +42,16 @@ else
        @echo
 endif
        mkdir linux
        @echo
 endif
        mkdir linux
-       @echo -n "Replacing '@BACKFS@' with 'ldiskfs':"
-       for i in $(notdir $(backfs_headers) $(backfs_sources)) $(new_sources) ; do \
+       @echo -n "Replacing 'ext3' with 'ldiskfs':"
+       @for i in $(notdir $(ext3_headers) $(ext3_sources)) $(new_sources) ; do \
                echo -n " $$i" ; \
                sed $(strip $(ldiskfs_sed_flags)) \
                echo -n " $$i" ; \
                sed $(strip $(ldiskfs_sed_flags)) \
-                       linux-stage/fs/@BACKFS@/$$i > $$i ; \
+                       linux-stage/fs/ext3/$$i > $$i ; \
        done
        done
-       for i in $(subst @BACKFS@,,$(notdir $(backfs_headers))) ; do \
-               if test -f "@BACKFS@$$i" ; then \
-                       echo -n " @BACKFS@$$i" ; \
-                       mv @BACKFS@$$i ldiskfs$$i ; \
-               fi ; \
-       done
-       for i in $(subst @BACKFS@,,$(notdir $(linux_headers) $(new_headers))) ; do \
-               echo -n " @BACKFS@$$i" ; \
+       @for i in $(subst ext3,,$(notdir $(linux_headers) $(new_headers))) ; do \
+               echo -n " ext3$$i" ; \
                sed $(strip $(ldiskfs_sed_flags)) \
                sed $(strip $(ldiskfs_sed_flags)) \
-                       linux-stage/include/linux/@BACKFS@$$i \
+                       linux-stage/include/linux/ext3$$i \
                        > linux/ldiskfs$$i ; \
        done
        @echo
                        > linux/ldiskfs$$i ; \
        done
        @echo
@@ -74,7 +66,7 @@ foo-check:
        @echo "ldiskfs_LDADD: $(ldiskfs_LDADD)"
 
 MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ 
        @echo "ldiskfs_LDADD: $(ldiskfs_LDADD)"
 
 MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ 
-CLEANFILES = sources $(notdir $(linux_headers) $(backfs_headers) $(backfs_sources) $(new_sources) $(new_headers))
+CLEANFILES = sources $(notdir $(linux_headers) $(ext3_headers) $(ext3_sources) $(new_sources) $(new_headers))
 
 clean: clean-am
 
 clean: clean-am
-       rm -rf linux linux-stage ldiskfs*.h
+       rm -rf linux linux-stage