diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 6b037c3..a2cfd57 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -499,6 +499,7 @@ AC_SUBST(MXLND) # LN_CONFIG_O2IB # AC_DEFUN([LN_CONFIG_O2IB],[ + AC_MSG_CHECKING([whether to enable OpenIB gen2 support]) # set default AC_ARG_WITH([o2ib], @@ -571,8 +572,7 @@ else struct ib_pool_fmr pool_fmr; enum ib_cm_rej_reason rej_reason; - cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP); - return PTR_ERR(cm_id); + rdma_destroy_id(NULL); ],[ AC_MSG_RESULT([yes]) O2IBLND="o2iblnd" @@ -620,6 +620,22 @@ fi AC_SUBST(EXTRA_LNET_INCLUDE) AC_SUBST(O2IBCPPFLAGS) AC_SUBST(O2IBLND) + +# In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument +if test $ENABLEO2IB -ne 0; then + AC_MSG_CHECKING([if rdma_create_id wants four args]) + LB_LINUX_TRY_COMPILE([ + #include + ],[ + rdma_create_id(NULL, NULL, 0, 0); + ],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_RDMA_CREATE_ID_4ARG, 1, + [rdma_create_id wants 4 args]) + ],[ + AC_MSG_RESULT([no]) + ]) +fi ]) # diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index ab2803e..8cd5e8d 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -2513,7 +2513,8 @@ kiblnd_startup (lnet_ni_t *ni) ibdev->ibd_ifip = ip; strcpy(&ibdev->ibd_ifname[0], ifname); - id = rdma_create_id(kiblnd_cm_callback, ibdev, RDMA_PS_TCP); + id = rdma_create_id(kiblnd_cm_callback, ibdev, RDMA_PS_TCP, + IB_QPT_RC); if (IS_ERR(id)) { CERROR("Can't create listen ID: %ld\n", PTR_ERR(id)); goto failed; diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h index a9b0d7e..a5ad46d 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.h +++ b/lnet/klnds/o2iblnd/o2iblnd.h @@ -145,6 +145,12 @@ extern kib_tunables_t kiblnd_tunables; IBLND_CREDIT_HIGHWATER_V1 : \ *kiblnd_tunables.kib_peercredits_hiw) /* when eagerly to return credits */ +#ifdef HAVE_RDMA_CREATE_ID_4ARG +#define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, ps, qpt) +#else +#define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, ps) +#endif + static inline int kiblnd_concurrent_sends_v1(void) { diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c index ec5ce4f..eb567a5 100644 --- a/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -1210,7 +1210,9 @@ kiblnd_connect_peer (kib_peer_t *peer) LASSERT (net != NULL); LASSERT (peer->ibp_connecting > 0); - cmid = rdma_create_id(kiblnd_cm_callback, peer, RDMA_PS_TCP); + cmid = kiblnd_rdma_create_id(kiblnd_cm_callback, peer, RDMA_PS_TCP, + IB_QPT_RC); + if (IS_ERR(cmid)) { CERROR("Can't create CMID for %s: %ld\n", libcfs_nid2str(peer->ibp_nid), PTR_ERR(cmid)); diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index d8a7461..3231c0a 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -583,22 +583,27 @@ LB_LINUX_TRY_COMPILE([ # # LC_STATFS_DENTRY_PARAM -# starting from 2.6.18 linux kernel uses dentry instead of -# super_block for first vfs_statfs argument +# starting from 2.6.18 linux kernel uses dentry instead of super_block +# for the first parameter of the super_operations->statfs() callback. +# # AC_DEFUN([LC_STATFS_DENTRY_PARAM], -[AC_MSG_CHECKING([first vfs_statfs parameter is dentry]) +[AC_MSG_CHECKING([if super_ops.statfs() first parameter is dentry]) +tmp_flags="$EXTRA_KCFLAGS" +EXTRA_KCFLAGS="-Werror" LB_LINUX_TRY_COMPILE([ #include ],[ - int vfs_statfs(struct dentry *, struct kstatfs *); + struct super_operations *sop = NULL; + sop->statfs((struct dentry *)0, (struct kstatfs*)0); ],[ AC_DEFINE(HAVE_STATFS_DENTRY_PARAM, 1, - [first parameter of vfs_statfs is dentry]) + [super_ops.statfs() first parameter is dentry]) AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) ]) +EXTRA_KCFLAGS="$tmp_flags" ]) # diff --git a/lustre/mdc/mdc_locks.c b/lustre/mdc/mdc_locks.c index 68382e8..4367f3f 100644 --- a/lustre/mdc/mdc_locks.c +++ b/lustre/mdc/mdc_locks.c @@ -185,7 +185,7 @@ static inline void mdc_clear_replay_flag(struct ptlrpc_request *req, int rc) } } -static int round_up(int val) +static int lu_round_up(int val) { int ret = 1; while (val) { @@ -301,7 +301,7 @@ static struct ptlrpc_request *mdc_intent_open_pack(struct obd_export *exp, rc = lustre_msg_size(class_exp2cliimp(exp)->imp_msg_magic, bufcount, size); if (rc & (rc - 1)) - size[bufcount - 1] = min(size[bufcount - 1] + round_up(rc) - rc, + size[bufcount - 1] = min(size[bufcount - 1] + lu_round_up(rc) - rc, (__u32)obddev->u.cli.cl_max_mds_easize); /* If inode is known, cancel conflicting OPEN locks. */