diff options
-rw-r--r-- | fs/fscache/object.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/fs/fscache/object.c b/fs/fscache/object.c index 1a1afa82f798..74bc562a2cbc 100644 --- a/fs/fscache/object.c +++ b/fs/fscache/object.c | |||
@@ -105,6 +105,7 @@ static inline void fscache_done_parent_op(struct fscache_object *object) | |||
105 | static void fscache_object_state_machine(struct fscache_object *object) | 105 | static void fscache_object_state_machine(struct fscache_object *object) |
106 | { | 106 | { |
107 | enum fscache_object_state new_state; | 107 | enum fscache_object_state new_state; |
108 | struct fscache_cookie *cookie; | ||
108 | 109 | ||
109 | ASSERT(object != NULL); | 110 | ASSERT(object != NULL); |
110 | 111 | ||
@@ -158,11 +159,17 @@ static void fscache_object_state_machine(struct fscache_object *object) | |||
158 | 159 | ||
159 | spin_lock(&object->lock); | 160 | spin_lock(&object->lock); |
160 | object->state = FSCACHE_OBJECT_DYING; | 161 | object->state = FSCACHE_OBJECT_DYING; |
161 | if (object->cookie && | 162 | cookie = object->cookie; |
162 | test_and_clear_bit(FSCACHE_COOKIE_CREATING, | 163 | if (cookie) { |
163 | &object->cookie->flags)) | 164 | if (test_and_clear_bit(FSCACHE_COOKIE_LOOKING_UP, |
164 | wake_up_bit(&object->cookie->flags, | 165 | &cookie->flags)) |
165 | FSCACHE_COOKIE_CREATING); | 166 | wake_up_bit(&cookie->flags, |
167 | FSCACHE_COOKIE_LOOKING_UP); | ||
168 | if (test_and_clear_bit(FSCACHE_COOKIE_CREATING, | ||
169 | &cookie->flags)) | ||
170 | wake_up_bit(&cookie->flags, | ||
171 | FSCACHE_COOKIE_CREATING); | ||
172 | } | ||
166 | spin_unlock(&object->lock); | 173 | spin_unlock(&object->lock); |
167 | 174 | ||
168 | fscache_done_parent_op(object); | 175 | fscache_done_parent_op(object); |