Thread (25 messages) 25 messages, 3 authors, 2016-06-15

Re: [PATCH v2 08/17] read-cache: invalidate untracked cache data when reading WAMA

From: David Turner <hidden>
Date: 2016-06-15 23:09:06

On Tue, 2016-03-29 at 09:50 +0700, Duy Nguyen wrote:
On Sat, Mar 19, 2016 at 8:04 AM, David Turner <
dturner@twopensource.com> wrote:
quoted
@@ -1407,10 +1472,24 @@ static int read_watchman_ext(struct
index_state *istate, const void *data,
        ewah_each_bit(bitmap, mark_no_watchman, istate);
        ewah_free(bitmap);

-       /*
-        * TODO: update the untracked cache from the untracked data
in this
-        * extension.
-        */
+       if (istate->untracked && istate->untracked->root) {
+               int i;
+               const char *untracked;
+
+               untracked = data + len + 8 + bitmap_size;
+               for (i = 0; i < untracked_nr; ++i) {
+                       int len = strlen(untracked);
+                       string_list_append(&istate->untracked
->invalid_untracked,
+                                          untracked);
+                       untracked += len + 1;
+               }
+
+               for_each_string_list(&istate->untracked
->invalid_untracked,
+                        mark_untracked_invalid, istate
->untracked);
I think it's a bit early to invalidate untracked cache here. We can
do
that in refresh_by_watchman() in 10/17, where ce_mark_uptodate() to
prevent lstat() is also done.
Will move/squash
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help