diff --git a/lnet/archdep.m4 b/lnet/archdep.m4 index cb6e0a22f65b7207d39eaac1363f9cd08b7e8e94..95f5ebe82103d289b302a4ce11ec05712d82d976 100644 --- a/lnet/archdep.m4 +++ b/lnet/archdep.m4 @@ -545,6 +545,17 @@ if test x$enable_modules != xno ; then fi # BACKINGFS = ext3 fi +# ---------- check ->lookup_raw() support -------- + +AC_MSG_CHECKING([if kernel supports ->lookup_raw()]) +HAVE_LOOKUP_RAW="`grep -c 'lookup_raw.*struct inode' $LINUX/include/linux/proc_fs.h`" +if test "$HAVE_LOOKUP_RAW" != 0 ; then + AC_DEFINE(HAVE_LOOKUP_RAW, 1, [the kernel supports ->lookup_raw()]) + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + CPPFLAGS="-include \$(top_builddir)/include/config.h $CPPFLAGS" EXTRA_KCFLAGS="-include $PWD/include/config.h $EXTRA_KCFLAGS" AC_SUBST(EXTRA_KCFLAGS) diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index c1ba5f1c0d70bd5fba48d1e7d8770991fe1c131d..345786336dc304ec98e274604c253309d0afde9a 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -913,21 +913,32 @@ static int mds_getattr_name(int offset, struct ptlrpc_request *req, goto fill_inode; } +#if HAVE_LOOKUP_RAW /* FIXME: handle raw lookup */ -#if 0 if (body->valid == OBD_MD_FLID) { + struct mds_obd *mds = &obd->u.mds; struct mds_body *mds_reply; int size = sizeof(*mds_reply); + struct inode *dir; ino_t inum; + dparent = mds_fid2dentry(mds, &body->fid1, NULL); + if (IS_ERR(dparent)) { + rc = PTR_ERR(dparent); + GOTO(cleanup, rc); + } + LASSERT(dparent != NULL); + LASSERT(dparent->d_inode != NULL); // The user requested ONLY the inode number, so do a raw lookup rc = lustre_pack_reply(req, 1, &size, NULL); if (rc) { CERROR("out of memory\n"); + l_dput(dparent); GOTO(cleanup, rc); } - + dir = dparent->d_inode; + LASSERT(dir->i_op->lookup_raw != NULL); rc = dir->i_op->lookup_raw(dir, name, namesize - 1, &inum); - + l_dput(dparent); mds_reply = lustre_msg_buf(req->rq_repmsg, offset, sizeof(*mds_reply)); mds_reply->fid1.id = inum; diff --git a/lustre/portals/archdep.m4 b/lustre/portals/archdep.m4 index cb6e0a22f65b7207d39eaac1363f9cd08b7e8e94..95f5ebe82103d289b302a4ce11ec05712d82d976 100644 --- a/lustre/portals/archdep.m4 +++ b/lustre/portals/archdep.m4 @@ -545,6 +545,17 @@ if test x$enable_modules != xno ; then fi # BACKINGFS = ext3 fi +# ---------- check ->lookup_raw() support -------- + +AC_MSG_CHECKING([if kernel supports ->lookup_raw()]) +HAVE_LOOKUP_RAW="`grep -c 'lookup_raw.*struct inode' $LINUX/include/linux/proc_fs.h`" +if test "$HAVE_LOOKUP_RAW" != 0 ; then + AC_DEFINE(HAVE_LOOKUP_RAW, 1, [the kernel supports ->lookup_raw()]) + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + CPPFLAGS="-include \$(top_builddir)/include/config.h $CPPFLAGS" EXTRA_KCFLAGS="-include $PWD/include/config.h $EXTRA_KCFLAGS" AC_SUBST(EXTRA_KCFLAGS)