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 <dhowells@redhat.com> Acked-by: Anna Schumaker <anna.schumaker@netapp.com> Tested-by: Steve Dickson <steved@redhat.com>
This commit is contained in:
@@ -182,7 +182,8 @@ int cachefiles_check_auxdata(struct cachefiles_object *object)
|
||||
goto error;
|
||||
|
||||
xlen--;
|
||||
validity = fscache_check_aux(&object->fscache, &auxbuf->data, xlen);
|
||||
validity = fscache_check_aux(&object->fscache, &auxbuf->data, xlen,
|
||||
i_size_read(d_backing_inode(dentry)));
|
||||
if (validity != FSCACHE_CHECKAUX_OKAY)
|
||||
goto error;
|
||||
|
||||
@@ -251,7 +252,8 @@ int cachefiles_check_object_xattr(struct cachefiles_object *object,
|
||||
object->fscache.cookie->def->name, dlen);
|
||||
|
||||
result = fscache_check_aux(&object->fscache,
|
||||
&auxbuf->data, dlen);
|
||||
&auxbuf->data, dlen,
|
||||
i_size_read(d_backing_inode(dentry)));
|
||||
|
||||
switch (result) {
|
||||
/* entry okay as is */
|
||||
|
Reference in New Issue
Block a user