down(&mds->mds_md_sem);
if (!IS_ERR(mds->mds_md_obd) && mds->mds_md_exp != NULL) {
LASSERT(mds->mds_md_connected);
-
+
obd_register_observer(mds->mds_md_obd, NULL);
if (flags & OBD_OPT_FORCE) {
}
OBD_ALLOC(n, namlen + 1);
+
+ /* XXX: should be memory allocation checked here in some more smart
+ * manner? */
+ LASSERT(n != NULL);
+
memcpy(n, name, namlen);
n[namlen] = (char) 0;
struct obdo *oa = NULL;
int rc, mea_size = 0;
struct lustre_id id;
- void *handle;
+ void *handle;
ENTRY;
if (update_mode != LCK_EX)
*/
oa->o_id = dir->i_ino;
- down(&dir->i_sem);
+ /* get parent id: ldlm lock on the parent protects ea */
rc = mds_read_inode_sid(obd, dir, &id);
- up(&dir->i_sem);
if (rc) {
CERROR("Can't read inode self id, inode %lu, "
"rc %d.\n", dir->i_ino, rc);
int objcount, struct obd_ioobj *obj,
int niocount, struct niobuf_remote *nb,
struct niobuf_local *res,
- struct obd_trans_info *oti)
+ struct obd_trans_info *oti, struct lustre_capa *capa)
{
struct niobuf_remote *rnb;
struct niobuf_local *lnb = NULL;
}
int mds_choose_mdsnum(struct obd_device *obd, const char *name, int len, int flags,
- struct ptlrpc_peer *peer, struct inode *parent)
+ struct ptlrpc_peer *peer, struct inode *parent, int local)
{
struct mds_obd *mds = &obd->u.mds;
- struct lmv_obd *lmv;
- int i = mds->mds_num;
char peer_str[PTL_NALFMT_SIZE];
- if (flags & REC_REINT_CREATE) {
+ int i = mds->mds_num;
+ struct lmv_obd *lmv;
+ ENTRY;
+
+ if (local)
+ RETURN(mds->mds_num);
+
+ if (flags & REC_REINT_CREATE) {
i = mds->mds_num;
} else if (mds->mds_md_exp != NULL && peer != NULL) {
LASSERT(parent != NULL);
it.it_op = IT_UNLINK;
OBD_ALLOC(it.d.fs_data, sizeof(struct lustre_intent_data));
+ if (!it.d.fs_data) {
+ OBD_FREE(*rlockh, handle_size);
+ OBD_FREE(op_data, sizeof(*op_data));
+ RETURN(-ENOMEM);
+ }
rc = md_enqueue(mds->mds_md_exp, LDLM_IBITS, &it, LCK_EX,
op_data, *rlockh, NULL, 0, ldlm_completion_ast,
mds_blocking_ast, NULL);
+
OBD_FREE(op_data, sizeof(*op_data));
OBD_FREE(it.d.fs_data, sizeof(struct lustre_intent_data));
EXIT;