/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2011, 2012, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
/*The caller should make sure only 1 process access the lgh_last_idx,
*Otherwise it might hit the assert.*/
LASSERT(index < LLOG_BITMAP_SIZE(llh));
- cfs_spin_lock(&loghandle->lgh_hdr_lock);
+ spin_lock(&loghandle->lgh_hdr_lock);
if (ext2_set_bit(index, llh->llh_bitmap)) {
CERROR("argh, index %u already set in log bitmap?\n", index);
- cfs_spin_unlock(&loghandle->lgh_hdr_lock);
+ spin_unlock(&loghandle->lgh_hdr_lock);
LBUG(); /* should never happen */
}
llh->llh_count++;
- cfs_spin_unlock(&loghandle->lgh_hdr_lock);
+ spin_unlock(&loghandle->lgh_hdr_lock);
llh->llh_tail.lrt_index = index;
rc = llog_lvfs_write_blob(obd, file, &llh->llh_hdr, NULL, 0);
logid->lgl_ogen, rc);
GOTO(out, rc);
}
- /* l_dentry_open will call dput(dchild) if there is an error */
handle->lgh_file = l_dentry_open(&obd->obd_lvfs_ctxt, dchild,
O_RDWR | O_LARGEFILE);
+ l_dput(dchild);
if (IS_ERR(handle->lgh_file)) {
rc = PTR_ERR(handle->lgh_file);
handle->lgh_file = NULL;
GOTO(out, rc = PTR_ERR(dchild));
file = l_dentry_open(&obd->obd_lvfs_ctxt, dchild, open_flags);
+ l_dput(dchild);
if (IS_ERR(file))
GOTO(out, rc = PTR_ERR(file));
handle->lgh_id.lgl_oseq = oa->o_seq;