Whamcloud - gitweb
Branch b_new_cmd
authorvitaly <vitaly>
Tue, 19 Sep 2006 21:51:58 +0000 (21:51 +0000)
committervitaly <vitaly>
Tue, 19 Sep 2006 21:51:58 +0000 (21:51 +0000)
b=22564

perform done_write for pending inodes on shutdown
mark inode as having attributes changed on sync write.

lustre/llite/llite_close.c
lustre/llite/llite_internal.h
lustre/llite/rw.c
lustre/mdt/mdt_reint.c

index 80e6508..f49b21f 100644 (file)
@@ -217,13 +217,12 @@ static struct ll_inode_info *ll_close_next_lli(struct ll_close_queue *lcq)
 
         spin_lock(&lcq->lcq_lock);
 
-        if (lcq->lcq_head.next == NULL)
-                lli = ERR_PTR(-1);
-        else if (!list_empty(&lcq->lcq_head)) {
+        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(-1);
 
         spin_unlock(&lcq->lcq_lock);
         return lli;
@@ -290,7 +289,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);
-        lcq->lcq_head.next = NULL;
+        atomic_inc(&lcq->lcq_stop);
         wake_up(&lcq->lcq_waitq);
         wait_for_completion(&lcq->lcq_comp);
         OBD_FREE(lcq, sizeof(*lcq));
index 83f976f..54c5c07 100644 (file)
@@ -573,6 +573,7 @@ struct ll_close_queue {
         struct list_head        lcq_head;
         wait_queue_head_t       lcq_waitq;
         struct completion       lcq_comp;
+        atomic_t                lcq_stop;
 };
 
 void llap_write_pending(struct inode *inode, struct ll_async_page *llap);
index e74eeab..38dfca5 100644 (file)
@@ -658,7 +658,9 @@ static int queue_or_sync_write(struct obd_export *exp, struct inode *inode,
         }
 
         llap->llap_write_queued = 0;
-
+        /* Do not pass llap here as it is sync write. */
+        llap_write_pending(inode, NULL);
+        
         rc = oig_init(&oig);
         if (rc)
                 GOTO(out, rc);
index e7e3c79..aec45f2 100644 (file)
@@ -155,7 +155,7 @@ int mdt_attr_set(struct mdt_thread_info *info, struct mdt_object *mo, int flags)
          * skip setattr. */
         next = mdt_object_child(mo);
         if (som_update && (info->mti_epoch->ioepoch != mo->mot_ioepoch))
-                        GOTO(out, rc = 0);
+                GOTO(out, rc = 0);
                 
         next = mdt_object_child(mo);
         if (lu_object_assert_not_exists(&mo->mot_obj.mo_lu))