aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cachefiles/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cachefiles/interface.c')
-rw-r--r--fs/cachefiles/interface.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/cachefiles/interface.c b/fs/cachefiles/interface.c
index 746ce532e130..d4c1206af9fc 100644
--- a/fs/cachefiles/interface.c
+++ b/fs/cachefiles/interface.c
@@ -13,8 +13,6 @@
13#include <linux/mount.h> 13#include <linux/mount.h>
14#include "internal.h" 14#include "internal.h"
15 15
16#define list_to_page(head) (list_entry((head)->prev, struct page, lru))
17
18struct cachefiles_lookup_data { 16struct cachefiles_lookup_data {
19 struct cachefiles_xattr *auxdata; /* auxiliary data */ 17 struct cachefiles_xattr *auxdata; /* auxiliary data */
20 char *key; /* key path */ 18 char *key; /* key path */
@@ -212,20 +210,29 @@ static void cachefiles_update_object(struct fscache_object *_object)
212 object = container_of(_object, struct cachefiles_object, fscache); 210 object = container_of(_object, struct cachefiles_object, fscache);
213 cache = container_of(object->fscache.cache, struct cachefiles_cache, 211 cache = container_of(object->fscache.cache, struct cachefiles_cache,
214 cache); 212 cache);
213
214 if (!fscache_use_cookie(_object)) {
215 _leave(" [relinq]");
216 return;
217 }
218
215 cookie = object->fscache.cookie; 219 cookie = object->fscache.cookie;
216 220
217 if (!cookie->def->get_aux) { 221 if (!cookie->def->get_aux) {
222 fscache_unuse_cookie(_object);
218 _leave(" [no aux]"); 223 _leave(" [no aux]");
219 return; 224 return;
220 } 225 }
221 226
222 auxdata = kmalloc(2 + 512 + 3, cachefiles_gfp); 227 auxdata = kmalloc(2 + 512 + 3, cachefiles_gfp);
223 if (!auxdata) { 228 if (!auxdata) {
229 fscache_unuse_cookie(_object);
224 _leave(" [nomem]"); 230 _leave(" [nomem]");
225 return; 231 return;
226 } 232 }
227 233
228 auxlen = cookie->def->get_aux(cookie->netfs_data, auxdata->data, 511); 234 auxlen = cookie->def->get_aux(cookie->netfs_data, auxdata->data, 511);
235 fscache_unuse_cookie(_object);
229 ASSERTCMP(auxlen, <, 511); 236 ASSERTCMP(auxlen, <, 511);
230 237
231 auxdata->len = auxlen + 1; 238 auxdata->len = auxlen + 1;
@@ -263,7 +270,7 @@ static void cachefiles_drop_object(struct fscache_object *_object)
263#endif 270#endif
264 271
265 /* delete retired objects */ 272 /* delete retired objects */
266 if (object->fscache.state == FSCACHE_OBJECT_RECYCLING && 273 if (test_bit(FSCACHE_COOKIE_RETIRED, &object->fscache.cookie->flags) &&
267 _object != cache->cache.fsdef 274 _object != cache->cache.fsdef
268 ) { 275 ) {
269 _debug("- retire object OBJ%x", object->fscache.debug_id); 276 _debug("- retire object OBJ%x", object->fscache.debug_id);