Whamcloud - gitweb
b=1883
authorphil <phil>
Mon, 24 Nov 2003 04:45:49 +0000 (04:45 +0000)
committerphil <phil>
Mon, 24 Nov 2003 04:45:49 +0000 (04:45 +0000)
- Adds llite_close.c; Zach's originally, somewhat heavily hacked
- Adds an MDS_DONE_WRITING rpc and handler
- Adds client-side code for storing the MDS FID and epoch in the
  obdo's inline field in BRW_WRITE requests

lustre/llite/llite_lib.c
lustre/llite/rw24.c

index 27c25d3..03b78af 100644 (file)
 #include <linux/module.h>
 #include <linux/random.h>
 #include <linux/version.h>
+
 #include <linux/lustre_lite.h>
 #include <linux/lustre_ha.h>
 #include <linux/lustre_dlm.h>
-#include <linux/init.h>
-#include <linux/fs.h>
 #include <linux/lprocfs_status.h>
 #include "llite_internal.h"
 
@@ -174,6 +173,12 @@ int lustre_common_fill_super(struct super_block *sb, char *mdc, char *osc)
                 GOTO(out_root, err = -EBADF);
         }
 
+        err = ll_close_thread_start(&sbi->ll_lcq);
+        if (err) {
+                CERROR("cannot start close thread: rc %d\n", err);
+                GOTO(out_root, err);
+        }
+
         sb->s_root = d_alloc_root(root);
         RETURN(err);
 
@@ -195,6 +200,8 @@ void lustre_common_put_super(struct super_block *sb)
         struct hlist_node *tmp, *next;
         ENTRY;
 
+        ll_close_thread_shutdown(sbi->ll_lcq);
+
         list_del(&sbi->ll_conn_chain);
         obd_disconnect(sbi->ll_osc_exp, 0);
 
@@ -291,6 +298,8 @@ void ll_lli_init(struct ll_inode_info *lli)
         sema_init(&lli->lli_open_sem, 1);
         lli->lli_flags = 0;
         lli->lli_maxbytes = PAGE_CACHE_MAXBYTES;
+        spin_lock_init(&lli->lock);
+        INIT_LIST_HEAD(&lli->lli_pending_write_llaps);
 }
 
 int ll_fill_super(struct super_block *sb, void *data, int silent)
@@ -813,7 +822,7 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr)
                 /* XXX when we fix the AST intents to pass the discard-range
                  * XXX extent, make ast_flags always LDLM_AST_DISCARD_DATA
                  * XXX here. */
-                if (extent.start == 0)
+                if (attr->ia_size == 0)
                         ast_flags = LDLM_AST_DISCARD_DATA;
 
                 /* bug 1639: avoid write/truncate i_sem/DLM deadlock */
@@ -830,6 +839,8 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr)
                         set_bit(LLI_F_HAVE_OST_SIZE_LOCK,
                                 &ll_i2info(inode)->lli_flags);
 
+                //ll_try_done_writing(inode);
+
                 /* unlock now as we don't mind others file lockers racing with
                  * the mds updates below? */
                 err = ll_extent_unlock(NULL, inode, lsm, LCK_PW, &lockh);
index 6a8ff9b..fe11b27 100644 (file)
@@ -76,6 +76,12 @@ void ll_ap_completion_24(void *data, int cmd, int rc)
         LL_CDEBUG_PAGE(page, "io complete, unlocking\n");
 
         unlock_page(page);
+
+        if (0 && cmd == OBD_BRW_WRITE) {
+                llap_write_complete(page->mapping->host, llap);
+                ll_try_done_writing(page->mapping->host);
+        }
+
         page_cache_release(page);
 }
 
@@ -168,10 +174,7 @@ static int ll_direct_IO_24(int rw, struct inode *inode, struct kiobuf *iobuf,
                         POISON_PAGE(iobuf->maplist[i], 0x0d);
         }
 
-        oa.o_id = lsm->lsm_object_id;
-        oa.o_valid = OBD_MD_FLID;
-        obdo_from_inode(&oa, inode, OBD_MD_FLTYPE | OBD_MD_FLATIME |
-                                    OBD_MD_FLMTIME | OBD_MD_FLCTIME);
+        ll_inode_fill_obdo(inode, rw, &oa);
 
         if (rw == WRITE)
                 lprocfs_counter_add(ll_i2sbi(inode)->ll_stats,