aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Barksdale <amatus.amongus@gmail.com>2012-07-18 23:46:11 -0500
committerDavid Barksdale <amatus.amongus@gmail.com>2012-07-18 23:46:11 -0500
commit5654c9bf58211e1fcec5f7553fa751066d7e6824 (patch)
tree11a6c13fccda5287dd157abdefdcedc2a8f31444
parent7e91baad1150e634bce63bd6a6b11730bc0aad52 (diff)
Make truncate not clobber :file-table.
-rw-r--r--src/clojure/foofs/localbackend.clj6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/clojure/foofs/localbackend.clj b/src/clojure/foofs/localbackend.clj
index 7968d02..d15712b 100644
--- a/src/clojure/foofs/localbackend.clj
+++ b/src/clojure/foofs/localbackend.clj
@@ -394,10 +394,8 @@
(fn [state]
(if (nil? (get-in state [:inode-table nodeid]))
(do (continuation! errno-noent) state)
- (let [file (get-in state [:file-table nodeid])
- state (assoc-in state [:inode-table nodeid :size] size)
- state (assoc-in state [:file-table nodeid]
- (take size (concat file (repeat (byte 0)))))]
+ (let [state (assoc-in state [:inode-table nodeid :size] size)]
+ ;; TODO truncate block-list
(agent-do state-agent (continuation! nil))
state)))))
(setatime [_ nodeid seconds nseconds continuation!]