]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
uclient: do not do locking for 'atomic' writes
authorSage Weil <sage@newdream.net>
Tue, 15 Sep 2009 20:14:01 +0000 (13:14 -0700)
committerSage Weil <sage@newdream.net>
Tue, 15 Sep 2009 20:14:01 +0000 (13:14 -0700)
They aren't tested and aren't safe (client may fail; there's no cleanup).

src/TODO
src/client/Client.cc

index 74ec64e2524237754510371ca51f18380884ab2b..f667c97c72314010a25af3daecfae355f06c6a65 100644 (file)
--- a/src/TODO
+++ b/src/TODO
@@ -35,8 +35,6 @@ v0.15
 
 - kclient: retry alloc on ENOMEM when reading from connection?
 - client authentication
-- radosgw
-- uclient: fix write vs max_size?
 
 - mds: put migration vectors in mdsmap
 
@@ -65,8 +63,9 @@ mount.ceph
 - should look at multiple A records, pass all IPs to kernel
 
 rados
-- usage accounting
 - make rest interface superset of s3?
+  - create/delete snapshots
+  - list, access snapped version
 - perl swig wrapper
 - 'rados call foo.bar'?
 - merge pgs
index f670fadb7e3f0a922140d940f637c5490b241204..bdde2cbefe655ef4a2405fbe6a3af2fb4a5e6f17 100644 (file)
@@ -4304,24 +4304,23 @@ int Client::_write(Fh *f, __s64 offset, __u64 size, const char *buf)
   
   dout(10) << " snaprealm " << *in->snaprealm << dendl;
 
-  if (g_conf.client_oc) {
-    if (in->caps_issued_mask(CEPH_CAP_FILE_BUFFER)) {
-      // do buffered write
-      if (in->cap_refs[CEPH_CAP_FILE_BUFFER] == 0)
-       get_cap_ref(in, CEPH_CAP_FILE_BUFFER);
-      
-      // wait? (this may block!)
-      objectcacher->wait_for_write(size, client_lock);
-      
-      // async, caching, non-blocking.
-      objectcacher->file_write(in->ino, &in->layout, in->snaprealm->get_snap_context(),
-                              offset, size, bl, g_clock.now(), 0);
-    } else {
+  if (g_conf.client_oc && (got & CEPH_CAP_FILE_BUFFER)) {
+    // do buffered write
+    if (in->cap_refs[CEPH_CAP_FILE_BUFFER] == 0)
+      get_cap_ref(in, CEPH_CAP_FILE_BUFFER);
+    
+    // wait? (this may block!)
+    objectcacher->wait_for_write(size, client_lock);
+    
+    // async, caching, non-blocking.
+    objectcacher->file_write(in->ino, &in->layout, in->snaprealm->get_snap_context(),
+                            offset, size, bl, g_clock.now(), 0);
+  } else {
+    /*
       // atomic, synchronous, blocking.
       objectcacher->file_atomic_sync_write(in->ino, &in->layout, in->snaprealm->get_snap_context(),
                                           offset, size, bl, g_clock.now(), 0, client_lock);
-    }   
-  } else {
+    */
     // simple, non-atomic sync write
     Mutex flock("Client::_write flock");
     Cond cond;
@@ -4330,7 +4329,7 @@ int Client::_write(Fh *f, __s64 offset, __u64 size, const char *buf)
     Context *onsafe = new C_Client_SyncCommit(this, in);
 
     unsafe_sync_write++;
-    get_cap_ref(in, CEPH_CAP_FILE_BUFFER);
+    get_cap_ref(in, CEPH_CAP_FILE_BUFFER);  // released by onsafe callback
     
     filer->write(in->ino, &in->layout, in->snaprealm->get_snap_context(),
                 offset, size, bl, g_clock.now(), 0, onfinish, onsafe);