diff options
Diffstat (limited to 'fs/fscache/cookie.c')
-rw-r--r-- | fs/fscache/cookie.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c index 8dcb114758e3..e2cba1f60c21 100644 --- a/fs/fscache/cookie.c +++ b/fs/fscache/cookie.c | |||
@@ -237,13 +237,12 @@ static int fscache_alloc_object(struct fscache_cache *cache, | |||
237 | struct fscache_cookie *cookie) | 237 | struct fscache_cookie *cookie) |
238 | { | 238 | { |
239 | struct fscache_object *object; | 239 | struct fscache_object *object; |
240 | struct hlist_node *_n; | ||
241 | int ret; | 240 | int ret; |
242 | 241 | ||
243 | _enter("%p,%p{%s}", cache, cookie, cookie->def->name); | 242 | _enter("%p,%p{%s}", cache, cookie, cookie->def->name); |
244 | 243 | ||
245 | spin_lock(&cookie->lock); | 244 | spin_lock(&cookie->lock); |
246 | hlist_for_each_entry(object, _n, &cookie->backing_objects, | 245 | hlist_for_each_entry(object, &cookie->backing_objects, |
247 | cookie_link) { | 246 | cookie_link) { |
248 | if (object->cache == cache) | 247 | if (object->cache == cache) |
249 | goto object_already_extant; | 248 | goto object_already_extant; |
@@ -311,7 +310,6 @@ static int fscache_attach_object(struct fscache_cookie *cookie, | |||
311 | { | 310 | { |
312 | struct fscache_object *p; | 311 | struct fscache_object *p; |
313 | struct fscache_cache *cache = object->cache; | 312 | struct fscache_cache *cache = object->cache; |
314 | struct hlist_node *_n; | ||
315 | int ret; | 313 | int ret; |
316 | 314 | ||
317 | _enter("{%s},{OBJ%x}", cookie->def->name, object->debug_id); | 315 | _enter("{%s},{OBJ%x}", cookie->def->name, object->debug_id); |
@@ -321,7 +319,7 @@ static int fscache_attach_object(struct fscache_cookie *cookie, | |||
321 | /* there may be multiple initial creations of this object, but we only | 319 | /* there may be multiple initial creations of this object, but we only |
322 | * want one */ | 320 | * want one */ |
323 | ret = -EEXIST; | 321 | ret = -EEXIST; |
324 | hlist_for_each_entry(p, _n, &cookie->backing_objects, cookie_link) { | 322 | hlist_for_each_entry(p, &cookie->backing_objects, cookie_link) { |
325 | if (p->cache == object->cache) { | 323 | if (p->cache == object->cache) { |
326 | if (p->state >= FSCACHE_OBJECT_DYING) | 324 | if (p->state >= FSCACHE_OBJECT_DYING) |
327 | ret = -ENOBUFS; | 325 | ret = -ENOBUFS; |
@@ -331,7 +329,7 @@ static int fscache_attach_object(struct fscache_cookie *cookie, | |||
331 | 329 | ||
332 | /* pin the parent object */ | 330 | /* pin the parent object */ |
333 | spin_lock_nested(&cookie->parent->lock, 1); | 331 | spin_lock_nested(&cookie->parent->lock, 1); |
334 | hlist_for_each_entry(p, _n, &cookie->parent->backing_objects, | 332 | hlist_for_each_entry(p, &cookie->parent->backing_objects, |
335 | cookie_link) { | 333 | cookie_link) { |
336 | if (p->cache == object->cache) { | 334 | if (p->cache == object->cache) { |
337 | if (p->state >= FSCACHE_OBJECT_DYING) { | 335 | if (p->state >= FSCACHE_OBJECT_DYING) { |
@@ -435,7 +433,6 @@ EXPORT_SYMBOL(__fscache_wait_on_invalidate); | |||
435 | void __fscache_update_cookie(struct fscache_cookie *cookie) | 433 | void __fscache_update_cookie(struct fscache_cookie *cookie) |
436 | { | 434 | { |
437 | struct fscache_object *object; | 435 | struct fscache_object *object; |
438 | struct hlist_node *_p; | ||
439 | 436 | ||
440 | fscache_stat(&fscache_n_updates); | 437 | fscache_stat(&fscache_n_updates); |
441 | 438 | ||
@@ -452,7 +449,7 @@ void __fscache_update_cookie(struct fscache_cookie *cookie) | |||
452 | spin_lock(&cookie->lock); | 449 | spin_lock(&cookie->lock); |
453 | 450 | ||
454 | /* update the index entry on disk in each cache backing this cookie */ | 451 | /* update the index entry on disk in each cache backing this cookie */ |
455 | hlist_for_each_entry(object, _p, | 452 | hlist_for_each_entry(object, |
456 | &cookie->backing_objects, cookie_link) { | 453 | &cookie->backing_objects, cookie_link) { |
457 | fscache_raise_event(object, FSCACHE_OBJECT_EV_UPDATE); | 454 | fscache_raise_event(object, FSCACHE_OBJECT_EV_UPDATE); |
458 | } | 455 | } |