return -ENOMEM;
}
- return 0;
+ return rc;
}
d_unhashed((struct dentry *)de) ? "" : "hashed,",
list_empty(&de->d_subdirs) ? "" : "subdirs");
+#ifdef HAVE_DCACHE_LOCK
+ LASSERT(d_refcount(de) == 0);
+#else
/* kernel >= 2.6.38 last refcount is decreased after this function. */
-#ifdef DCACHE_OP_DELETE
LASSERT(d_refcount(de) == 1);
-#else
- LASSERT(d_refcount(de) == 0);
#endif
/* if not ldlm lock for this inode, set i_nlink to 0 so that
if (lld != NULL && init_sa != 0)
lld->lld_sa_generation = 0;
-#ifdef DCACHE_OP_HASH
- LASSERT(de->d_op == &ll_d_ops);
-#else
+#ifdef HAVE_DCACHE_LOCK
de->d_op = &ll_d_ops;
+#else
+ /* kernel >= 2.6.38 d_op is set in d_alloc() */
+ LASSERT(de->d_op == &ll_d_ops);
#endif
return rc;
}
int rc;
ENTRY;
-#ifdef LOOKUP_RCU
+#ifndef HAVE_DCACHE_LOCK
+ /* kernel >= 2.6.38 supports rcu-walk, but lustre doesn't. */
if (nd->flags & LOOKUP_RCU)
return -ECHILD;
#endif
int rc;
ENTRY;
-#ifdef IPERM_FLAG_RCU
+#ifdef HAVE_GENERIC_PERMISSION_4ARGS
if (flags & IPERM_FLAG_RCU)
return -ECHILD;
#endif
int rc = 0;
ENTRY;
-#ifdef IPERM_FLAG_RCU
+#ifdef HAVE_GENERIC_PERMISSION_4ARGS
if (flags & IPERM_FLAG_RCU)
return -ECHILD;
#endif
cl_sb_init(sb);
sb->s_root = d_alloc_root(root);
-#ifdef DCACHE_OP_HASH
+#ifdef HAVE_DCACHE_LOCK
+ sb->s_root->d_op = &ll_d_root_ops;
+#else
+ /* kernel >= 2.6.38 store dentry operations in sb->s_d_op. */
d_set_d_op(sb->s_root, &ll_d_root_ops);
sb->s_d_op = &ll_d_ops;
-#else
- sb->s_root->d_op = &ll_d_root_ops;
#endif
sbi->ll_sdev_orig = sb->s_dev;
const struct cl_io_slice *ios,
enum cl_req_type crt, struct cl_2queue *queue)
{
- struct obd_export *exp;
struct cl_page *page;
struct cl_page *tmp;
struct client_obd *cli = NULL;
CDEBUG(D_CACHE, "%d %d\n", qin->pl_nr, crt);
osc = cl2osc(ios->cis_obj);
- exp = osc_export(osc);
cli = osc_cli(osc);
max_pages = cli->cl_max_pages_per_rpc;