* Use is subject to license terms.
*/
/*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*
struct cl_object *clob;
struct lu_site *site;
struct lu_fid *fid;
- const struct cl_object_conf conf = {
+ struct cl_object_conf conf = {
.coc_inode = inode,
.u = {
.coc_md = md
int result = 0;
int refcheck;
- /* LASSERT(inode->i_state & I_NEW); */
LASSERT(md->body->valid & OBD_MD_FLID);
if (!S_ISREG(cl_inode_mode(inode)))
LASSERT(fid_is_sane(fid));
if (lli->lli_clob == NULL) {
+ /* clob is slave of inode, empty lli_clob means for new inode,
+ * there is no clob in cache with the given fid, so it is
+ * unnecessary to perform lookup-alloc-lookup-insert, just
+ * alloc and insert directly. */
+#ifdef __KERNEL__
+ LASSERT(inode->i_state & I_NEW);
+#endif
+ conf.coc_lu.loc_flags = LOC_F_NEW;
clob = cl_object_find(env, lu2cl_dev(site->ls_top_dev),
fid, &conf);
if (!IS_ERR(clob)) {
/**
* build inode number from passed @fid */
-__u64 cl_fid_build_ino(const struct lu_fid *fid, int need_32bit)
+__u64 cl_fid_build_ino(const struct lu_fid *fid, int api32)
{
-#if BITS_PER_LONG == 32
- RETURN(fid_flatten32(fid));
-#else
- if (need_32bit)
+ if (BITS_PER_LONG == 32 || api32)
RETURN(fid_flatten32(fid));
else
RETURN(fid_flatten(fid));
-#endif
}
/**