These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / staging / lustre / lustre / llite / llite_close.c
index a94ba02..3f348a3 100644 (file)
@@ -221,7 +221,7 @@ int ll_som_update(struct inode *inode, struct md_op_data *op_data)
                       inode->i_ino, inode->i_generation,
                       lli->lli_flags);
 
-       OBDO_ALLOC(oa);
+       oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO);
        if (!oa) {
                CERROR("can't allocate memory for Size-on-MDS update.\n");
                return -ENOMEM;
@@ -252,7 +252,7 @@ int ll_som_update(struct inode *inode, struct md_op_data *op_data)
                        NULL, 0, NULL, 0, &request, NULL);
        ptlrpc_req_finished(request);
 
-       OBDO_FREE(oa);
+       kmem_cache_free(obdo_cachep, oa);
        return rc;
 }
 
@@ -293,19 +293,18 @@ static void ll_done_writing(struct inode *inode)
                goto out;
 
        rc = md_done_writing(ll_i2sbi(inode)->ll_md_exp, op_data, NULL);
-       if (rc == -EAGAIN) {
+       if (rc == -EAGAIN)
                /* MDS has instructed us to obtain Size-on-MDS attribute from
                 * OSTs and send setattr to back to MDS. */
                rc = ll_som_update(inode, op_data);
-       } else if (rc) {
+       else if (rc)
                CERROR("inode %lu mdc done_writing failed: rc = %d\n",
                       inode->i_ino, rc);
-       }
 out:
        ll_finish_md_op_data(op_data);
        if (och) {
                md_clear_open_replay_data(ll_i2sbi(inode)->ll_md_exp, och);
-               OBD_FREE_PTR(och);
+               kfree(och);
        }
 }
 
@@ -374,7 +373,7 @@ int ll_close_thread_start(struct ll_close_queue **lcq_ret)
 
        task = kthread_run(ll_close_thread, lcq, "ll_close");
        if (IS_ERR(task)) {
-               OBD_FREE(lcq, sizeof(*lcq));
+               kfree(lcq);
                return PTR_ERR(task);
        }
 
@@ -389,5 +388,5 @@ void ll_close_thread_shutdown(struct ll_close_queue *lcq)
        atomic_inc(&lcq->lcq_stop);
        wake_up(&lcq->lcq_waitq);
        wait_for_completion(&lcq->lcq_comp);
-       OBD_FREE(lcq, sizeof(*lcq));
+       kfree(lcq);
 }