From f30581aa19447ea58f0120488acaa57bcd55144d Mon Sep 17 00:00:00 2001 From: Prakash Surya Date: Mon, 11 Jun 2012 09:27:18 -0700 Subject: [PATCH] LU-723 ldiskfs: Drop support for ext3 based ldiskfs Building ldiskfs from ext3 is no longer supported, thus this change attempts to clean things up and only support building ldiskfs from ext4 sources. The main changes made, involved replacing the @BACKFS@ autoconf variable with 'ext4', and removing the HAVE_EXT4_LDISKFS macro. It is now safe to assume that ldiskfs is build based entirely on ext4. Signed-off-by: Prakash Surya Change-Id: Ia0eff6e4c1b755806ccfbf554e4a36201f9f1a64 Reviewed-on: http://review.whamcloud.com/1643 Tested-by: Hudson Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Oleg Drokin --- build/autoconf/lustre-build-ldiskfs.m4 | 86 +++++++------------------- ldiskfs/configure.ac | 7 --- ldiskfs/ldiskfs/Makefile.in | 10 +-- ldiskfs/ldiskfs/autoMakefile.am | 47 +++++++-------- lustre/lvfs/autoMakefile.am | 12 +--- lustre/lvfs/fsfilt_ext3.c | 107 +-------------------------------- lustre/mdd/mdd_device.c | 8 --- lustre/mdd/mdd_dir.c | 8 --- lustre/mdd/mdd_permission.c | 8 --- lustre/mdd/mdd_trans.c | 8 --- lustre/utils/mkfs_lustre.c | 2 - 11 files changed, 55 insertions(+), 248 deletions(-) diff --git a/build/autoconf/lustre-build-ldiskfs.m4 b/build/autoconf/lustre-build-ldiskfs.m4 index 8ffd5e9..94e55af 100644 --- a/build/autoconf/lustre-build-ldiskfs.m4 +++ b/build/autoconf/lustre-build-ldiskfs.m4 @@ -103,7 +103,6 @@ if test x$with_ldiskfs = xyes; then LB_LDISKFS_SYMVERS LB_LDISKFS_RELEASE - LB_LDISKFS_EXT_RELEASE LB_LDISKFS_EXT_DIR LB_LDISKFS_BUILD LB_LDISKFS_DEFINE_OPTIONS @@ -111,7 +110,7 @@ fi # # LDISKFS_DEVEL is required because when using the ldiskfs-devel package the -# ext3/4 source will be fully patched to ldiskfs. When building with the +# ext4 source will be fully patched to ldiskfs. When building with the # in-tree ldiskfs this patching this will occur after the configure step. # We needed a way to determine if we should check the patched or unpatched # source files. @@ -137,41 +136,6 @@ fi ]) # -# LB_LDISKFS_EXT_RELEASE -# -# Determine if ext3 or ext4 sources should be used for ldiskfs. -# -AC_DEFUN([LB_LDISKFS_EXT_RELEASE], -[ -AC_ARG_ENABLE([ext4], - AC_HELP_STRING([--enable-ext4], [enable ldiskfs build using ext4]), - [], - [ - if test x$RHEL_KERNEL = xyes; then - enable_ext4='yes' - else - # 2.6.22-2.6.26 ext4 available but unstable - case x$LINUXRELEASE in - x2.6.2[[0-6]]*) - enable_ext4='no' ;; - *) - enable_ext4='yes' ;; - esac - fi - ]) - -if test x$enable_ext4 = xyes; then - LDISKFS_BACKFS='ext4' -else - LDISKFS_BACKFS='ext3' -fi - -AC_MSG_CHECKING([whether to use ext3 or ext4 source]) -AC_MSG_RESULT([$LDISKFS_BACKFS]) -AC_SUBST(LDISKFS_BACKFS) -]) - -# # LB_LDISKFS_EXT_DIR # # Determine the location of the ext3/ext4 source code. It it required @@ -181,20 +145,20 @@ AC_DEFUN([LB_LDISKFS_EXT_DIR], [ # Kernel ext source located with devel headers linux_src=$LINUX -if test -e "$linux_src/fs/$LDISKFS_BACKFS/super.c"; then - EXT_DIR=$linux_src/fs/$LDISKFS_BACKFS +if test -e "$linux_src/fs/ext4/super.c"; then + EXT_DIR=$linux_src/fs/ext4 else # Kernel ext source provided by kernel-debuginfo-common package linux_src=$(ls -1d /usr/src/debug/*/linux-$LINUXRELEASE \ 2>/dev/null | tail -1) - if test -e "$linux_src/fs/$LDISKFS_BACKFS/super.c"; then - EXT_DIR=$linux_src/fs/$LDISKFS_BACKFS + if test -e "$linux_src/fs/ext4/super.c"; then + EXT_DIR=$linux_src/fs/ext4 else EXT_DIR= fi fi -AC_MSG_CHECKING([$LDISKFS_BACKFS source directory]) +AC_MSG_CHECKING([ext4 source directory]) AC_MSG_RESULT([$EXT_DIR]) AC_SUBST(EXT_DIR) ]) @@ -213,16 +177,16 @@ if test x$EXT_DIR = x; then else LB_CHECK_FILE([$EXT_DIR/dir.c], [], [ enable_ldiskfs_build='no' - AC_MSG_WARN([$LDISKFS_BACKFS must exist for ldiskfs build])]) + AC_MSG_WARN([ext4 must exist for ldiskfs build])]) LB_CHECK_FILE([$EXT_DIR/file.c], [], [ enable_ldiskfs_build='no' - AC_MSG_WARN([$LDISKFS_BACKFS must exist for ldiskfs build])]) + AC_MSG_WARN([ext4 must exist for ldiskfs build])]) LB_CHECK_FILE([$EXT_DIR/inode.c], [], [ enable_ldiskfs_build='no' - AC_MSG_WARN([$LDISKFS_BACKFS must exist for ldiskfs build])]) + AC_MSG_WARN([ext4 must exist for ldiskfs build])]) LB_CHECK_FILE([$EXT_DIR/super.c], [], [ enable_ldiskfs_build='no' - AC_MSG_WARN([$LDISKFS_BACKFS must exist for ldiskfs build])]) + AC_MSG_WARN([ext4 must exist for ldiskfs build])]) fi if test x$enable_ldiskfs_build = xno; then @@ -233,7 +197,7 @@ if test x$enable_ldiskfs_build = xno; then AC_MSG_WARN([ -Disabling server because complete $LDISKFS_BACKFS source does not exist. +Disabling server because complete ext4 source does not exist. If you are building using kernel-devel packages and require ldiskfs server support then ensure that the matching kernel-debuginfo-common @@ -255,22 +219,18 @@ AC_DEFUN([LB_LDISKFS_DEFINE_OPTIONS], AC_DEFINE(HAVE_LDISKFS_OSD, 1, Enable ldiskfs osd) with_ldiskfs_pdo=no -if test $LDISKFS_BACKFS = 'ext4'; then - AC_DEFINE(HAVE_EXT4_LDISKFS, 1, [build ext4 based ldiskfs]) - case $LINUXRELEASE in - 2.6.32*) - if test x$RHEL_KERNEL = xyes; then - with_ldiskfs_pdo=yes - AC_DEFINE(HAVE_LDISKFS_PDO, 1, [have ldiskfs PDO patch]) - fi - if test x$SUSE_KERNEL = xyes; then - with_ldiskfs_pdo=yes - AC_DEFINE(HAVE_LDISKFS_PDO, 1, [have ldiskfs PDO patch]) - fi - ;; - esac -fi - +case $LINUXRELEASE in +2.6.32*) + if test x$RHEL_KERNEL = xyes; then + with_ldiskfs_pdo=yes + AC_DEFINE(HAVE_LDISKFS_PDO, 1, [have ldiskfs PDO patch]) + fi + if test x$SUSE_KERNEL = xyes; then + with_ldiskfs_pdo=yes + AC_DEFINE(HAVE_LDISKFS_PDO, 1, [have ldiskfs PDO patch]) + fi + ;; +esac LB_LDISKFS_JBD2_JOURNAL_CALLBACK_SET AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, diff --git a/ldiskfs/configure.ac b/ldiskfs/configure.ac index 448841b..9176673 100644 --- a/ldiskfs/configure.ac +++ b/ldiskfs/configure.ac @@ -107,18 +107,11 @@ if test x$enable_server$PATCH$QUILT = xyesnono ; then fi AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno) -AM_CONDITIONAL(USE_EXT4, test x$enable_ext4 = xyes) if test x$enable_server$enable_dist = xyesno ; then -LB_LDISKFS_EXT_RELEASE LB_LDISKFS_EXT_DIR LB_LDISKFS_EXT_SOURCE LB_LDISKFS_DEFINE_OPTIONS - -BACKFS=$LDISKFS_BACKFS -AC_SUBST(BACKFS) -BACKFSU=${BACKFS/ext/EXT} -AC_SUBST(BACKFSU) # We need a Upper string fi AM_CONDITIONAL(LDISKFS_PDO, test x$with_ldiskfs_pdo = xyes) diff --git a/ldiskfs/ldiskfs/Makefile.in b/ldiskfs/ldiskfs/Makefile.in index acbd133..e70b077 100644 --- a/ldiskfs/ldiskfs/Makefile.in +++ b/ldiskfs/ldiskfs/Makefile.in @@ -3,13 +3,13 @@ default: all MODULES := ldiskfs # copy makefile over to not break patches -backfs_extra := $(wildcard @LINUX@/fs/@BACKFS@/Makefile) +backfs_extra := $(wildcard @LINUX@/fs/ext4/Makefile) backfs_headers := $(wildcard @EXT_DIR@/*.h) -linux_headers := $(wildcard @LINUX@/include/linux/@BACKFS@*.h) +linux_headers := $(wildcard @LINUX@/include/linux/ext4*.h) linux_new_headers := dynlocks.h @LDISKFS_PDO_TRUE@linux_new_headers += htree_lock.h -trace_headers := $(wildcard @LINUX@/include/trace/events/@BACKFS@*.h) +trace_headers := $(wildcard @LINUX@/include/trace/events/ext4*.h) backfs_sources := $(filter-out %.mod.c,$(wildcard @EXT_DIR@/*.c)) @@ -20,8 +20,8 @@ ext4_new_sources := dynlocks.c fiemap.h mmp.c @LDISKFS_PDO_TRUE@ext4_new_sources += htree_lock.c ext4_new_headers := -new_sources := $(@BACKFS@_new_sources) -new_headers := $(@BACKFS@_new_headers) +new_sources := $(ext4_new_sources) +new_headers := $(ext4_new_headers) ldiskfs_patched_sources := $(notdir $(backfs_sources) $(backfs_headers)) $(new_sources) $(new_headers) ldiskfs_sources := $(ldiskfs_patched_sources) diff --git a/ldiskfs/ldiskfs/autoMakefile.am b/ldiskfs/ldiskfs/autoMakefile.am index a4dda14..a64b8bb 100644 --- a/ldiskfs/ldiskfs/autoMakefile.am +++ b/ldiskfs/ldiskfs/autoMakefile.am @@ -1,24 +1,21 @@ modulefs_DATA = ldiskfs$(KMODEXT) -ldiskfs_linux_headers := $(addprefix linux/,$(subst @BACKFS@,ldiskfs,$(notdir $(linux_headers)))) +ldiskfs_linux_headers := $(addprefix linux/,$(subst ext4,ldiskfs,$(notdir $(linux_headers)))) $(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/\ $@ -%.h: linux-stage/fs/@BACKFS@/%.h +%.h: linux-stage/fs/ext4/%.h sed $(strip $(ldiskfs_sed_flags)) $< > $@ -linux/ldiskfs%.h: linux-stage/include/linux/@BACKFS@%.h +linux/ldiskfs%.h: linux-stage/include/linux/ext4%.h sed $(strip $(ldiskfs_sed_flags)) $< > $@ series := @top_srcdir@/kernel_patches/series/ldiskfs-$(LDISKFS_SERIES) @@ -26,9 +23,9 @@ patches := @top_srcdir@/kernel_patches/patches sources: $(backfs_sources) $(backfs_headers) $(linux_headers) $(series) $(trace_headers) rm -rf linux-stage linux sources trace $(ldiskfs_SOURCES) - mkdir -p linux-stage/fs/@BACKFS@ linux-stage/include/linux \ + mkdir -p linux-stage/fs/ext4 linux-stage/include/linux \ linux-stage/include/trace/events - cp $(backfs_sources) $(backfs_headers) $(backfs_extra) linux-stage/fs/@BACKFS@ + cp $(backfs_sources) $(backfs_headers) $(backfs_extra) linux-stage/fs/ext4 if test -n "$(linux_headers)" ; then \ cp $(linux_headers) linux-stage/include/linux; \ fi @@ -40,7 +37,7 @@ if USE_QUILT ln -s ../$(series) linux-stage/series cd linux-stage && quilt push -a -q else - @echo -n "Applying @BACKFS@ patches:" + @echo -n "Applying ext4 patches:" @cd linux-stage && for i in $$(<../$(series)) ; do \ echo -n " $$i" ; \ patch -s -p1 < ../$(patches)/$$i || exit 1 ; \ @@ -48,28 +45,28 @@ else @echo endif mkdir -p linux trace/events - @echo -n "Replacing '@BACKFS@' with 'ldiskfs':" + @echo -n "Replacing 'ext4' with 'ldiskfs':" for i in $(notdir $(backfs_headers) $(backfs_sources)) $(new_sources) ; do \ echo -n " $$i" ; \ sed $(strip $(ldiskfs_sed_flags)) \ - linux-stage/fs/@BACKFS@/$$i > $$i ; \ + linux-stage/fs/ext4/$$i > $$i ; \ 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 ; \ + for i in $(subst ext4,,$(notdir $(backfs_headers))) ; do \ + if test -f "ext4$$i" ; then \ + echo -n " ext4$$i" ; \ + mv ext4$$i ldiskfs$$i ; \ fi ; \ done - for i in $(subst @BACKFS@,,$(notdir $(linux_headers) $(new_headers))) ; do \ - echo -n " @BACKFS@$$i" ; \ + for i in $(subst ext4,,$(notdir $(linux_headers) $(new_headers))) ; do \ + echo -n " ext4$$i" ; \ sed $(strip $(ldiskfs_sed_flags)) \ - linux-stage/include/linux/@BACKFS@$$i \ + linux-stage/include/linux/ext4$$i \ > linux/ldiskfs$$i ; \ done - for i in $(subst @BACKFS@,,$(notdir $(trace_headers))) ; do \ - echo -n " @BACKFS@$$i"; \ + for i in $(subst ext4,,$(notdir $(trace_headers))) ; do \ + echo -n " ext4$$i"; \ sed $(strip $(ldiskfs_sed_flags)) \ - linux-stage/include/trace/events/@BACKFS@$$i \ + linux-stage/include/trace/events/ext4$$i \ > trace/events/ldiskfs$$i ; \ done for i in $(notdir $(linux_new_headers)) ; do \ diff --git a/lustre/lvfs/autoMakefile.am b/lustre/lvfs/autoMakefile.am index 9fe7838..4d362a9 100644 --- a/lustre/lvfs/autoMakefile.am +++ b/lustre/lvfs/autoMakefile.am @@ -63,20 +63,12 @@ sources: endif #SERVER ldiskfs_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/LDISKFS/g" -e "s/ext3/ldiskfs/g" \ - -e "s/EXT4/LDISKFS/g" -e "s/ext4/ldiskfs/g" \ - -e "s/HAVE_LDISKFS_LDISKFS/HAVE_EXT4_LDISKFS/g" + -e "s/EXT4/LDISKFS/g" -e "s/ext4/ldiskfs/g" fsfilt_ldiskfs.c: fsfilt_ext3.c sed $(strip $(ldiskfs_sed_flags)) $< > $@ - if grep -q '^#define\(.*\)HAVE_EXT4_LDISKFS' @LDISKFS_DIR@/config.h ; then \ - sed -i -e "/DEBUG_SUBSYSTEM\(.*\)S_FILTER/a\#define HAVE_EXT4_LDISKFS 1" $@ ;\ - fi + fsfilt_ldiskfs_quota.h: fsfilt_ext3_quota.h sed $(strip $(ldiskfs_sed_flags)) $< > $@ diff --git a/lustre/lvfs/fsfilt_ext3.c b/lustre/lvfs/fsfilt_ext3.c index 1ca271f..ab6e403 100644 --- a/lustre/lvfs/fsfilt_ext3.c +++ b/lustre/lvfs/fsfilt_ext3.c @@ -49,14 +49,8 @@ #ifdef HAVE_LINUX_EXPORTFS_H #include #endif -#ifdef HAVE_EXT4_LDISKFS #include #include -#else -#include -#include -#include -#endif #include #include #include @@ -96,11 +90,7 @@ extern int ext3_xattr_set_handle(handle_t *, struct inode *, int, const char *, #include #include -#ifdef HAVE_EXT4_LDISKFS #include -#else -#include -#endif #include "lustre_quota_fmt.h" @@ -121,16 +111,8 @@ extern int ext3_xattr_set_handle(handle_t *, struct inode *, int, const char *, #define ext3_mb_discard_inode_preallocations(inode) \ ext3_discard_preallocations(inode) -#ifdef HAVE_EXT4_LDISKFS #define fsfilt_log_start_commit(journal, tid) jbd2_log_start_commit(journal, tid) #define fsfilt_log_wait_commit(journal, tid) jbd2_log_wait_commit(journal, tid) -#else -#define fsfilt_log_start_commit(journal, tid) log_start_commit(journal, tid) -#define fsfilt_log_wait_commit(journal, tid) log_wait_commit(journal, tid) -#define ext_pblock(ex) le32_to_cpu((ex)->ee_start) -#define ext3_ext_store_pblock(ex, pblock) ((ex)->ee_start = cpu_to_le32(pblock)) -#define ext3_inode_bitmap(sb,desc) le32_to_cpu((desc)->bg_inode_bitmap) -#endif #ifdef HAVE_EXT4_JOURNAL_CALLBACK_ADD # define journal_callback ext4_journal_cb_entry @@ -284,21 +266,6 @@ static void *fsfilt_ext3_start(struct inode *inode, int op, void *desc_private, nblocks += 3; /* no break */ case FSFILT_OP_CREATE: { -#if defined(EXT3_EXTENTS_FL) && defined(EXT3_INDEX_FL) && !defined(HAVE_EXT4_LDISKFS) - static int warned; - if (!warned) { - if (!test_opt(inode->i_sb, EXTENTS)) { - warned = 1; - } else if (((EXT3_I(inode)->i_flags & - cpu_to_le32(EXT3_EXTENTS_FL | EXT3_INDEX_FL)) == - cpu_to_le32(EXT3_EXTENTS_FL | EXT3_INDEX_FL))) { - CWARN("extent-mapped directory found with " - "ext3-based ldiskfs - contact " - "http://bugs.whamcloud.com/\n"); - warned = 1; - } - } -#endif /* no break */ } case FSFILT_OP_MKDIR: @@ -690,14 +657,9 @@ static int fsfilt_ext3_iocontrol(struct inode *inode, struct file *file, *(int *)arg |= EXT3_I(inode)->i_flags & EXT3_EXTENTS_FL; } -#ifdef HAVE_EXT4_LDISKFS /* ext4_ioctl does not have a inode argument */ if (inode->i_fop->unlocked_ioctl) rc = inode->i_fop->unlocked_ioctl(file, cmd, arg); -#else - if (inode->i_fop->ioctl) - rc = inode->i_fop->ioctl(inode, file, cmd, arg); -#endif else RETURN(-ENOTTY); @@ -868,13 +830,8 @@ static int fsfilt_ext3_sync(struct super_block *sb) # define fsfilt_up_truncate_sem(inode) up(&LDISKFS_I(inode)->truncate_sem); # define fsfilt_down_truncate_sem(inode) down(&LDISKFS_I(inode)->truncate_sem); #else -# ifdef HAVE_EXT4_LDISKFS -# define fsfilt_up_truncate_sem(inode) do{ }while(0) -# define fsfilt_down_truncate_sem(inode) do{ }while(0) -# else -# define fsfilt_up_truncate_sem(inode) mutex_unlock(&EXT3_I(inode)->truncate_mutex) -# define fsfilt_down_truncate_sem(inode) mutex_lock(&EXT3_I(inode)->truncate_mutex) -# endif +# define fsfilt_up_truncate_sem(inode) do{ }while(0) +# define fsfilt_down_truncate_sem(inode) do{ }while(0) #endif #ifndef EXT_ASSERT @@ -883,11 +840,7 @@ static int fsfilt_ext3_sync(struct super_block *sb) #ifdef EXT3_EXT_HAS_NO_TREE /* for kernels 2.6.18 and later */ -#ifdef HAVE_EXT4_LDISKFS #define EXT_GENERATION(inode) (EXT4_I(inode)->i_ext_generation) -#else -#define EXT_GENERATION(inode) ext_generation(inode) -#endif #define ext3_ext_base inode #define ext3_ext_base2inode(inode) (inode) #define EXT_DEPTH(inode) ext_depth(inode) @@ -1059,7 +1012,6 @@ static int ext3_ext_new_extent_cb(struct ext3_ext_base *base, return EXT_REPEAT; } -#if defined(HAVE_EXT4_LDISKFS) /* In 2.6.32 kernel, ext4_ext_walk_space()'s callback func is not * protected by i_data_sem as whole. so we patch it to store * generation to path and now verify the tree hasn't changed */ @@ -1072,7 +1024,6 @@ static int ext3_ext_new_extent_cb(struct ext3_ext_base *base, ext3_journal_stop(handle); return EXT_REPEAT; } -#endif count = cex->ec_len; pblock = new_blocks(handle, base, path, cex->ec_block, &count, &err); @@ -1108,9 +1059,7 @@ static int ext3_ext_new_extent_cb(struct ext3_ext_base *base, BUG_ON(le32_to_cpu(nex.ee_block) != cex->ec_block); out: -#if defined(HAVE_EXT4_LDISKFS) up_write((&EXT4_I(inode)->i_data_sem)); -#endif ext3_journal_stop(handle); map: if (err >= 0) { @@ -1771,40 +1720,6 @@ static inline int read_old_dqinfo(struct super_block *sb, int type, RETURN(rc); } -#ifndef HAVE_EXT4_LDISKFS -static inline struct ext3_group_desc * -get_group_desc(struct super_block *sb, int group, struct buffer_head **bh) -{ - unsigned long desc_block, desc; - struct ext3_group_desc *gdp; - - desc_block = group / EXT3_DESC_PER_BLOCK(sb); - desc = group % EXT3_DESC_PER_BLOCK(sb); - gdp = (struct ext3_group_desc *) - EXT3_SB(sb)->s_group_desc[desc_block]->b_data; - - return gdp + desc; -} - -static inline struct buffer_head * -ext3_read_inode_bitmap(struct super_block *sb, unsigned long group) -{ - struct ext3_group_desc *desc; - struct buffer_head *bh; - - desc = get_group_desc(sb, group, NULL); - bh = sb_bread(sb, ext3_inode_bitmap(sb, desc)); - return bh; -} - -static __u32 ext3_itable_unused_count(struct super_block *sb, - struct ext3_group_desc *bg) { - return le16_to_cpu(bg->bg_itable_unused); -} -#else -#define get_group_desc ext3_get_group_desc -#endif - struct qchk_ctxt { cfs_hlist_head_t qckt_hash[NR_DQHASH]; /* quotacheck hash */ cfs_list_t qckt_list; /* quotacheck list */ @@ -2066,34 +1981,22 @@ static int fsfilt_ext3_quotacheck(struct super_block *sb, if (uninit_feat) { struct ext3_group_desc *desc; - desc = get_group_desc(sb, group, NULL); + desc = ext3_get_group_desc(sb, group, NULL); if (!desc) GOTO(out, -EIO); /* we don't really need to take the group lock here, * but it may be useful if one day we support online * quotacheck */ -#ifdef HAVE_EXT4_LDISKFS ext4_lock_group(sb, group); -#else - spin_lock(sb_bgl_lock(sbi, group)); -#endif if (desc->bg_flags & cpu_to_le16(EXT3_BG_INODE_UNINIT)) { /* no inode in use in this group, just skip it */ -#ifdef HAVE_EXT4_LDISKFS ext3_unlock_group(sb, group); -#else - spin_unlock(sb_bgl_lock(sbi, group)); -#endif continue; } used_count -= ext3_itable_unused_count(sb, desc); -#ifdef HAVE_EXT4_LDISKFS ext3_unlock_group(sb, group); -#else - spin_unlock(sb_bgl_lock(sbi, group)); -#endif } ino = group * sbi->s_inodes_per_group + 1; @@ -2113,11 +2016,7 @@ static int fsfilt_ext3_quotacheck(struct super_block *sb, ino = i + group * sbi->s_inodes_per_group; if (ino < sbi->s_first_ino) continue; -#if defined(HAVE_EXT4_LDISKFS) || !defined(HAVE_READ_INODE_IN_SBOPS) inode = ext3_iget(sb, ino); -#else - inode = iget(sb, ino); -#endif if (!inode || IS_ERR(inode)) continue; diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c index 75abe60..725677b 100644 --- a/lustre/mdd/mdd_device.c +++ b/lustre/mdd/mdd_device.c @@ -43,11 +43,7 @@ #define DEBUG_SUBSYSTEM S_MDS #include -#ifdef HAVE_EXT4_LDISKFS #include -#else -#include -#endif #include #include #include @@ -56,11 +52,7 @@ #include #include -#ifdef HAVE_EXT4_LDISKFS #include -#else -#include -#endif #include #include #include /* for changelogs */ diff --git a/lustre/mdd/mdd_dir.c b/lustre/mdd/mdd_dir.c index cf6aa1c..9e440ba 100644 --- a/lustre/mdd/mdd_dir.c +++ b/lustre/mdd/mdd_dir.c @@ -43,21 +43,13 @@ #define DEBUG_SUBSYSTEM S_MDS #include -#ifdef HAVE_EXT4_LDISKFS #include -#else -#include -#endif #include #include #include #include #include -#ifdef HAVE_EXT4_LDISKFS #include -#else -#include -#endif #include #include #include diff --git a/lustre/mdd/mdd_permission.c b/lustre/mdd/mdd_permission.c index cd75861..73ceaaa 100644 --- a/lustre/mdd/mdd_permission.c +++ b/lustre/mdd/mdd_permission.c @@ -42,22 +42,14 @@ #define DEBUG_SUBSYSTEM S_MDS #include -#ifdef HAVE_EXT4_LDISKFS #include -#else -#include -#endif #include #include #include #include #include -#ifdef HAVE_EXT4_LDISKFS #include -#else -#include -#endif #include #include diff --git a/lustre/mdd/mdd_trans.c b/lustre/mdd/mdd_trans.c index f5258c5..20f304f 100644 --- a/lustre/mdd/mdd_trans.c +++ b/lustre/mdd/mdd_trans.c @@ -43,22 +43,14 @@ #define DEBUG_SUBSYSTEM S_MDS #include -#ifdef HAVE_EXT4_LDISKFS #include -#else -#include -#endif #include #include #include #include #include -#ifdef HAVE_EXT4_LDISKFS #include -#else -#include -#endif #include #include diff --git a/lustre/utils/mkfs_lustre.c b/lustre/utils/mkfs_lustre.c index e1492d0..eb5a21a 100644 --- a/lustre/utils/mkfs_lustre.c +++ b/lustre/utils/mkfs_lustre.c @@ -643,7 +643,6 @@ static void enable_default_ext4_features(struct mkfs_opts *mop, char *anchor, if (is_e2fsprogs_feature_supp("-O dir_nlink") == 0) append_unique(anchor, ",", "dir_nlink", NULL, maxbuflen); -#ifdef HAVE_EXT4_LDISKFS /* The following options are only valid for ext4-based ldiskfs. * If --backfstype=ext3 is specified, do not enable them. */ if (mop->mo_ldd.ldd_mount_type == LDD_MT_EXT3) @@ -673,7 +672,6 @@ static void enable_default_ext4_features(struct mkfs_opts *mop, char *anchor, } } /* Don't add any more "-O" options here, see last comment above */ -#endif } /** -- 1.8.3.1