Lines Matching refs:cres
73 static int cachefiles_read(struct netfs_cache_resources *cres, in cachefiles_read() argument
87 if (!fscache_wait_for_operation(cres, FSCACHE_WANT_READ)) in cachefiles_read()
91 object = cachefiles_cres_object(cres); in cachefiles_read()
92 file = cachefiles_cres_file(cres); in cachefiles_read()
144 ki->inval_counter = cres->inval_counter; in cachefiles_read()
197 static int cachefiles_query_occupancy(struct netfs_cache_resources *cres, in cachefiles_query_occupancy() argument
208 if (!fscache_wait_for_operation(cres, FSCACHE_WANT_READ)) in cachefiles_query_occupancy()
211 object = cachefiles_cres_object(cres); in cachefiles_query_occupancy()
212 file = cachefiles_cres_file(cres); in cachefiles_query_occupancy()
360 static int cachefiles_write(struct netfs_cache_resources *cres, in cachefiles_write() argument
366 if (!fscache_wait_for_operation(cres, FSCACHE_WANT_WRITE)) { in cachefiles_write()
372 return __cachefiles_write(cachefiles_cres_object(cres), in cachefiles_write()
373 cachefiles_cres_file(cres), in cachefiles_write()
379 cachefiles_do_prepare_read(struct netfs_cache_resources *cres, in cachefiles_do_prepare_read() argument
386 struct fscache_cookie *cookie = fscache_cres_cookie(cres); in cachefiles_do_prepare_read()
388 struct file *file = cachefiles_cres_file(cres); in cachefiles_do_prepare_read()
413 if (!fscache_wait_for_operation(cres, FSCACHE_WANT_READ)) in cachefiles_do_prepare_read()
415 file = cachefiles_cres_file(cres); in cachefiles_do_prepare_read()
421 object = cachefiles_cres_object(cres); in cachefiles_do_prepare_read()
509 cachefiles_prepare_ondemand_read(struct netfs_cache_resources *cres, in cachefiles_prepare_ondemand_read() argument
513 return cachefiles_do_prepare_read(cres, start, _len, i_size, _flags, ino); in cachefiles_prepare_ondemand_read()
594 static int cachefiles_prepare_write(struct netfs_cache_resources *cres, in cachefiles_prepare_write() argument
598 struct cachefiles_object *object = cachefiles_cres_object(cres); in cachefiles_prepare_write()
603 if (!cachefiles_cres_file(cres)) { in cachefiles_prepare_write()
604 if (!fscache_wait_for_operation(cres, FSCACHE_WANT_WRITE)) in cachefiles_prepare_write()
606 if (!cachefiles_cres_file(cres)) in cachefiles_prepare_write()
611 ret = __cachefiles_prepare_write(object, cachefiles_cres_file(cres), in cachefiles_prepare_write()
621 static void cachefiles_end_operation(struct netfs_cache_resources *cres) in cachefiles_end_operation() argument
623 struct file *file = cachefiles_cres_file(cres); in cachefiles_end_operation()
627 fscache_end_cookie_access(fscache_cres_cookie(cres), fscache_access_io_end); in cachefiles_end_operation()
643 bool cachefiles_begin_operation(struct netfs_cache_resources *cres, in cachefiles_begin_operation() argument
646 struct cachefiles_object *object = cachefiles_cres_object(cres); in cachefiles_begin_operation()
648 if (!cachefiles_cres_file(cres)) { in cachefiles_begin_operation()
649 cres->ops = &cachefiles_netfs_cache_ops; in cachefiles_begin_operation()
652 if (!cres->cache_priv2 && object->file) in cachefiles_begin_operation()
653 cres->cache_priv2 = get_file(object->file); in cachefiles_begin_operation()
658 if (!cachefiles_cres_file(cres) && want_state != FSCACHE_WANT_PARAMS) { in cachefiles_begin_operation()