From ee1235a9a06813429c201bf186397a6feeea07bf Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 4 Apr 2018 13:41:28 +0100 Subject: fscache: Pass object size in rather than calling back for it Pass the object size in to fscache_acquire_cookie() and fscache_write_page() rather than the netfs providing a callback by which it can be received. This makes it easier to update the size of the object when a new page is written that extends the object. The current object size is also passed by fscache to the check_aux function, obviating the need to store it in the aux data. Signed-off-by: David Howells Acked-by: Anna Schumaker Tested-by: Steve Dickson --- fs/cachefiles/interface.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'fs/cachefiles/interface.c') diff --git a/fs/cachefiles/interface.c b/fs/cachefiles/interface.c index 3264dcfdc92a..222bc5d8b62c 100644 --- a/fs/cachefiles/interface.c +++ b/fs/cachefiles/interface.c @@ -441,7 +441,7 @@ static int cachefiles_attr_changed(struct fscache_object *_object) loff_t oi_size; int ret; - _object->cookie->def->get_attr(_object->cookie->netfs_data, &ni_size); + ni_size = _object->store_limit_l; _enter("{OBJ%x},[%llu]", _object->debug_id, (unsigned long long) ni_size); @@ -513,8 +513,7 @@ static void cachefiles_invalidate_object(struct fscache_operation *op) cache = container_of(object->fscache.cache, struct cachefiles_cache, cache); - op->object->cookie->def->get_attr(op->object->cookie->netfs_data, - &ni_size); + ni_size = op->object->store_limit_l; _enter("{OBJ%x},[%llu]", op->object->debug_id, (unsigned long long)ni_size); -- cgit v1.2.3