Skip to content
Snippets Groups Projects
Commit bcde98b4 authored by alex's avatar alex
Browse files

- support for raw lookup in mds_getattr_name()

- configure script sets HAVE_LOOKUP_RAW if kernel has the feature
parent 683d2b72
No related branches found
No related tags found
No related merge requests found
...@@ -545,6 +545,17 @@ if test x$enable_modules != xno ; then ...@@ -545,6 +545,17 @@ if test x$enable_modules != xno ; then
fi # BACKINGFS = ext3 fi # BACKINGFS = ext3
fi 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" CPPFLAGS="-include \$(top_builddir)/include/config.h $CPPFLAGS"
EXTRA_KCFLAGS="-include $PWD/include/config.h $EXTRA_KCFLAGS" EXTRA_KCFLAGS="-include $PWD/include/config.h $EXTRA_KCFLAGS"
AC_SUBST(EXTRA_KCFLAGS) AC_SUBST(EXTRA_KCFLAGS)
......
...@@ -913,21 +913,32 @@ static int mds_getattr_name(int offset, struct ptlrpc_request *req, ...@@ -913,21 +913,32 @@ static int mds_getattr_name(int offset, struct ptlrpc_request *req,
goto fill_inode; goto fill_inode;
} }
#if HAVE_LOOKUP_RAW
/* FIXME: handle raw lookup */ /* FIXME: handle raw lookup */
#if 0
if (body->valid == OBD_MD_FLID) { if (body->valid == OBD_MD_FLID) {
struct mds_obd *mds = &obd->u.mds;
struct mds_body *mds_reply; struct mds_body *mds_reply;
int size = sizeof(*mds_reply); int size = sizeof(*mds_reply);
struct inode *dir;
ino_t inum; 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 // The user requested ONLY the inode number, so do a raw lookup
rc = lustre_pack_reply(req, 1, &size, NULL); rc = lustre_pack_reply(req, 1, &size, NULL);
if (rc) { if (rc) {
CERROR("out of memory\n"); CERROR("out of memory\n");
l_dput(dparent);
GOTO(cleanup, rc); 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); rc = dir->i_op->lookup_raw(dir, name, namesize - 1, &inum);
l_dput(dparent);
mds_reply = lustre_msg_buf(req->rq_repmsg, offset, mds_reply = lustre_msg_buf(req->rq_repmsg, offset,
sizeof(*mds_reply)); sizeof(*mds_reply));
mds_reply->fid1.id = inum; mds_reply->fid1.id = inum;
......
...@@ -545,6 +545,17 @@ if test x$enable_modules != xno ; then ...@@ -545,6 +545,17 @@ if test x$enable_modules != xno ; then
fi # BACKINGFS = ext3 fi # BACKINGFS = ext3
fi 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" CPPFLAGS="-include \$(top_builddir)/include/config.h $CPPFLAGS"
EXTRA_KCFLAGS="-include $PWD/include/config.h $EXTRA_KCFLAGS" EXTRA_KCFLAGS="-include $PWD/include/config.h $EXTRA_KCFLAGS"
AC_SUBST(EXTRA_KCFLAGS) AC_SUBST(EXTRA_KCFLAGS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment