From: Christopher J. Morrone Date: Mon, 28 Jan 2013 17:28:25 +0000 (-0800) Subject: LU-1199 ldiskfs: Remove HAVE_{EXT4,JBD2}_JOURNAL_CALLBACK_{SET,ADD} X-Git-Tag: 2.3.61~7 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=c52d5f2913c33eb7efe0d8a9073c90091e169b8c LU-1199 ldiskfs: Remove HAVE_{EXT4,JBD2}_JOURNAL_CALLBACK_{SET,ADD} Lustre servers now only support kernels/ldiskfs with {ext4,ldiskfs}_journal_callback_add(). Additionally, the HAVE_EXT4_JOURNAL_CALLBACK_ADD define is not in the upstream 3.3 kernel where the ext4_journal_callback_add() patch landed. Therefore we remove the HAVE_{LDISKFS,EXT4}_JOURNAL_CALLBACK_{SET,ADD} checks and just assume that it is set. Change-Id: I10cc79fcf07dd05a10ae83014f188c613ab1620c Signed-off-by: Christopher J. Morrone Reviewed-on: http://review.whamcloud.com/5055 Reviewed-by: James Simmons Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/build/autoconf/lustre-build-ldiskfs.m4 b/build/autoconf/lustre-build-ldiskfs.m4 index 59c281f..d821f85 100644 --- a/build/autoconf/lustre-build-ldiskfs.m4 +++ b/build/autoconf/lustre-build-ldiskfs.m4 @@ -218,8 +218,6 @@ AC_DEFUN([LB_LDISKFS_DEFINE_OPTIONS], [ AC_DEFINE(HAVE_LDISKFS_OSD, 1, Enable ldiskfs osd) -LB_LDISKFS_JBD2_JOURNAL_CALLBACK_SET - AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [enable extended attributes for ldiskfs]) AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, @@ -235,19 +233,6 @@ AC_DEFINE(CONFIG_LDISKFSDEV_FS_SECURITY, 1, ]) # -# Check for jbd2_journal_callback_set(), which is needed for commit -# callbacks. When LU-433 lands jbd2_journal_callback_set() will only -# remain for legacy reasons and AC_MSG_ERROR can be removed. -# -AC_DEFUN([LB_LDISKFS_JBD2_JOURNAL_CALLBACK_SET], -[ - LB_CHECK_SYMBOL_EXPORT([jbd2_journal_callback_set], - [fs/jbd2/journal.c], - [AC_DEFINE(HAVE_JBD2_JOURNAL_CALLBACK_SET, 1, - [kernel exports jbd2_journal_callback_set])]) -]) - -# # Optionally configure/make the ldiskfs sources. If the sources are # determined to reside in-tree this feature will automatically be # enabled. If the sources are not in-tree it will be disabled. diff --git a/ldiskfs/config/ldiskfs-build.m4 b/ldiskfs/config/ldiskfs-build.m4 index 680895e..429bb8c 100644 --- a/ldiskfs/config/ldiskfs-build.m4 +++ b/ldiskfs/config/ldiskfs-build.m4 @@ -616,8 +616,6 @@ fi # AC_DEFUN([LB_LDISKFS_DEFINE_OPTIONS], [ -LB_LDISKFS_JBD2_JOURNAL_CALLBACK_SET - AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [enable extended attributes for ldiskfs]) AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, @@ -632,20 +630,6 @@ AC_DEFINE(CONFIG_LDISKFSDEV_FS_SECURITY, 1, [enable fs security for ldiskfs]) ]) -# -# Check for jbd2_journal_callback_set(), which is needed for commit -# callbacks. When LU-433 lands jbd2_journal_callback_set() will only -# remain for legacy reasons and AC_MSG_ERROR can be removed. -# -AC_DEFUN([LB_LDISKFS_JBD2_JOURNAL_CALLBACK_SET], -[ - LB_CHECK_SYMBOL_EXPORT([jbd2_journal_callback_set], - [fs/jbd2/journal.c], - [AC_DEFINE(HAVE_JBD2_JOURNAL_CALLBACK_SET, 1, - [kernel exports jbd2_journal_callback_set])]) -]) - - AC_DEFUN([LB_LDISKFS_SYMVERS], [ AC_MSG_CHECKING([ldiskfs module symbols]) diff --git a/lustre/lvfs/fsfilt_ext3.c b/lustre/lvfs/fsfilt_ext3.c index 7d1e5ac..c1c0e19 100644 --- a/lustre/lvfs/fsfilt_ext3.c +++ b/lustre/lvfs/fsfilt_ext3.c @@ -71,25 +71,14 @@ #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) -#ifdef HAVE_EXT4_JOURNAL_CALLBACK_ADD -# define journal_callback ext4_journal_cb_entry -# define fsfilt_journal_callback_set(handle, func, jcb) \ - ext4_journal_callback_add(handle, func, jcb) -#elif defined(HAVE_JBD2_JOURNAL_CALLBACK_SET) -# define fsfilt_journal_callback_set(handle, func, jcb) \ - jbd2_journal_callback_set(handle, func, jcb) -#else -# error missing journal commit callback -#endif /* HAVE_EXT4_JOURNAL_CALLBACK_ADD */ - static cfs_mem_cache_t *fcb_cache; struct fsfilt_cb_data { - struct journal_callback cb_jcb; /* jbd private data - MUST BE FIRST */ - fsfilt_cb_t cb_func; /* MDS/OBD completion function */ - struct obd_device *cb_obd; /* MDS/OBD completion device */ - __u64 cb_last_rcvd; /* MDS/OST last committed operation */ - void *cb_data; /* MDS/OST completion function data */ + struct ext4_journal_cb_entry cb_jcb; /* private data - MUST BE FIRST */ + fsfilt_cb_t cb_func; /* MDS/OBD completion function */ + struct obd_device *cb_obd; /* MDS/OBD completion device */ + __u64 cb_last_rcvd; /* MDS/OST last committed operation */ + void *cb_data; /* MDS/OST completion function data */ }; static char *fsfilt_ext3_get_label(struct super_block *sb) diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index d589556..1b3c323 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -623,12 +623,8 @@ static int osd_param_is_not_sane(const struct osd_device *dev, /* * Concurrency: shouldn't matter. */ -#ifdef HAVE_LDISKFS_JOURNAL_CALLBACK_ADD static void osd_trans_commit_cb(struct super_block *sb, - struct journal_callback *jcb, int error) -#else -static void osd_trans_commit_cb(struct journal_callback *jcb, int error) -#endif + struct ldiskfs_journal_cb_entry *jcb, int error) { struct osd_thandle *oh = container_of0(jcb, struct osd_thandle, ot_jcb); struct thandle *th = &oh->ot_super; @@ -825,7 +821,7 @@ static int osd_trans_stop(const struct lu_env *env, struct thandle *th) * notice we don't do this in osd_trans_start() * as underlying transaction can change during truncate */ - osd_journal_callback_set(hdl, osd_trans_commit_cb, + ldiskfs_journal_callback_add(hdl, osd_trans_commit_cb, &oh->ot_jcb); LASSERT(oti->oti_txns == 1); diff --git a/lustre/osd-ldiskfs/osd_internal.h b/lustre/osd-ldiskfs/osd_internal.h index 19560c5..ea2a1c0 100644 --- a/lustre/osd-ldiskfs/osd_internal.h +++ b/lustre/osd-ldiskfs/osd_internal.h @@ -54,14 +54,6 @@ #include #include -#ifdef HAVE_LDISKFS_JOURNAL_CALLBACK_ADD -# define journal_callback ldiskfs_journal_cb_entry -# define osd_journal_callback_set(handle, func, jcb) \ - ldiskfs_journal_callback_add(handle, func, jcb) -#else -# define osd_journal_callback_set(handle, func, jcb) \ - jbd2_journal_callback_set(handle, func, jcb) -#endif /* fsfilt_{get|put}_ops */ #include @@ -331,7 +323,7 @@ enum { struct osd_thandle { struct thandle ot_super; handle_t *ot_handle; - struct journal_callback ot_jcb; + struct ldiskfs_journal_cb_entry ot_jcb; cfs_list_t ot_dcb_list; /* Link to the device, for debugging. */ struct lu_ref_link *ot_dev_link;