X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fllite%2Fllite_close.c;h=8bff949f245e7ab3268341b08007649a0a1a6fa5;hb=69ddb2e08ecb0226ae820b69932ec4eb424f481a;hp=5cedfa9de19ba41a2ffab19f1c1b59f3f9ef5eea;hpb=e089a515efae3391709b997be889ebe0f3306e9d;p=fs%2Flustre-release.git diff --git a/lustre/llite/llite_close.c b/lustre/llite/llite_close.c index 5cedfa9..8bff949 100644 --- a/lustre/llite/llite_close.c +++ b/lustre/llite/llite_close.c @@ -95,16 +95,16 @@ void ll_queue_done_writing(struct inode *inode, unsigned long flags) struct ll_close_queue *lcq = ll_i2sbi(inode)->ll_lcq; if (lli->lli_flags & LLIF_MDS_SIZE_LOCK) - CWARN("ino %lu/%u(flags %u) som valid it just after " - "recovery\n", - inode->i_ino, inode->i_generation, - lli->lli_flags); - /* DONE_WRITING is allowed and inode has no dirty page. */ + CWARN("%s: file "DFID"(flags %u) Size-on-MDS valid, " + "done writing allowed and no diry pages\n", + ll_get_fsname(inode->i_sb, NULL, 0), + PFID(ll_inode2fid(inode)), lli->lli_flags); + /* DONE_WRITING is allowed and inode has no dirty page. */ spin_lock(&lcq->lcq_lock); - LASSERT(cfs_list_empty(&lli->lli_close_list)); - CDEBUG(D_INODE, "adding inode %lu/%u to close list\n", - inode->i_ino, inode->i_generation); + LASSERT(cfs_list_empty(&lli->lli_close_list)); + CDEBUG(D_INODE, "adding inode "DFID" to close list\n", + PFID(ll_inode2fid(inode))); cfs_list_add_tail(&lli->lli_close_list, &lcq->lcq_head); /* Avoid a concurrent insertion into the close thread queue: @@ -131,9 +131,10 @@ void ll_done_writing_attr(struct inode *inode, struct md_op_data *op_data) op_data->op_flags |= MF_SOM_CHANGE; /* Check if Size-on-MDS attributes are valid. */ if (lli->lli_flags & LLIF_MDS_SIZE_LOCK) - CERROR("ino %lu/%u(flags %u) som valid it just after " - "recovery\n", inode->i_ino, inode->i_generation, - lli->lli_flags); + CERROR("%s: inode "DFID"(flags %u) MDS holds lock on " + "Size-on-MDS attributes\n", + ll_get_fsname(inode->i_sb, NULL, 0), + PFID(ll_inode2fid(inode)), lli->lli_flags); if (!cl_local_size(inode)) { /* Send Size-on-MDS Attributes if valid. */ @@ -229,9 +230,10 @@ int ll_som_update(struct inode *inode, struct md_op_data *op_data) LASSERT(op_data != NULL); if (lli->lli_flags & LLIF_MDS_SIZE_LOCK) - CERROR("ino %lu/%u(flags %u) som valid it just after " - "recovery\n", inode->i_ino, inode->i_generation, - lli->lli_flags); + CERROR("%s: inode "DFID"(flags %u) MDS holds lock on " + "Size-on-MDS attributes\n", + ll_get_fsname(inode->i_sb, NULL, 0), + PFID(ll_inode2fid(inode)), lli->lli_flags); OBDO_ALLOC(oa); if (!oa) { @@ -249,10 +251,11 @@ int ll_som_update(struct inode *inode, struct md_op_data *op_data) if (rc) { oa->o_valid = 0; if (rc != -ENOENT) - CERROR("inode_getattr failed (%d): unable to " - "send a Size-on-MDS attribute update " - "for inode %lu/%u\n", rc, inode->i_ino, - inode->i_generation); + CERROR("%s: inode_getattr failed - unable to " + "send a Size-on-MDS attribute update " + "for inode "DFID": rc = %d\n", + ll_get_fsname(inode->i_sb, NULL, 0), + PFID(ll_inode2fid(inode)), rc); } else { CDEBUG(D_INODE, "Size-on-MDS update on "DFID"\n", PFID(&lli->lli_fid)); @@ -315,8 +318,9 @@ static void ll_done_writing(struct inode *inode) * OSTs and send setattr to back to MDS. */ rc = ll_som_update(inode, op_data); } else if (rc) { - CERROR("inode %lu mdc done_writing failed: rc = %d\n", - inode->i_ino, rc); + CERROR("%s: inode "DFID" mdc done_writing failed: rc = %d\n", + ll_get_fsname(inode->i_sb, NULL, 0), + PFID(ll_inode2fid(inode)), rc); } out: ll_finish_md_op_data(op_data); @@ -333,12 +337,12 @@ static struct ll_inode_info *ll_close_next_lli(struct ll_close_queue *lcq) spin_lock(&lcq->lcq_lock); - if (!cfs_list_empty(&lcq->lcq_head)) { - lli = cfs_list_entry(lcq->lcq_head.next, struct ll_inode_info, - lli_close_list); - cfs_list_del_init(&lli->lli_close_list); - } else if (cfs_atomic_read(&lcq->lcq_stop)) - lli = ERR_PTR(-EALREADY); + if (!list_empty(&lcq->lcq_head)) { + lli = list_entry(lcq->lcq_head.next, struct ll_inode_info, + lli_close_list); + list_del_init(&lli->lli_close_list); + } else if (atomic_read(&lcq->lcq_stop)) + lli = ERR_PTR(-EALREADY); spin_unlock(&lcq->lcq_lock); return lli; @@ -363,8 +367,8 @@ static int ll_close_thread(void *arg) break; inode = ll_info2i(lli); - CDEBUG(D_INFO, "done_writting for inode %lu/%u\n", - inode->i_ino, inode->i_generation); + CDEBUG(D_INFO, "done_writting for inode "DFID"\n", + PFID(ll_inode2fid(inode))); ll_done_writing(inode); iput(inode); } @@ -377,7 +381,7 @@ static int ll_close_thread(void *arg) int ll_close_thread_start(struct ll_close_queue **lcq_ret) { struct ll_close_queue *lcq; - cfs_task_t *task; + struct task_struct *task; if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_CLOSE_THREAD)) return -EINTR; @@ -405,7 +409,7 @@ int ll_close_thread_start(struct ll_close_queue **lcq_ret) void ll_close_thread_shutdown(struct ll_close_queue *lcq) { init_completion(&lcq->lcq_comp); - cfs_atomic_inc(&lcq->lcq_stop); + atomic_inc(&lcq->lcq_stop); wake_up(&lcq->lcq_waitq); wait_for_completion(&lcq->lcq_comp); OBD_FREE(lcq, sizeof(*lcq));