Commit a7e20e31 authored by David Howells's avatar David Howells

netfs: Move cookie debug ID to struct netfs_cache_resources

Move the cookie debug ID from struct netfs_read_request to struct
netfs_cache_resources and drop the 'cookie_' prefix.  This makes it
available for things that want to use netfs_cache_resources without having
a netfs_read_request.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Reviewed-by: default avatarJeff Layton <jlayton@redhat.com>
cc: linux-cachefs@redhat.com
Link: https://lore.kernel.org/r/162431190784.2908479.13386972676539789127.stgit@warthog.procyon.org.uk/
parent 4c5e4139
...@@ -410,7 +410,7 @@ int cachefiles_begin_read_operation(struct netfs_read_request *rreq, ...@@ -410,7 +410,7 @@ int cachefiles_begin_read_operation(struct netfs_read_request *rreq,
rreq->cache_resources.cache_priv = op; rreq->cache_resources.cache_priv = op;
rreq->cache_resources.cache_priv2 = file; rreq->cache_resources.cache_priv2 = file;
rreq->cache_resources.ops = &cachefiles_netfs_cache_ops; rreq->cache_resources.ops = &cachefiles_netfs_cache_ops;
rreq->cookie_debug_id = object->fscache.debug_id; rreq->cache_resources.debug_id = object->fscache.debug_id;
_leave(""); _leave("");
return 0; return 0;
......
...@@ -102,6 +102,7 @@ struct netfs_cache_resources { ...@@ -102,6 +102,7 @@ struct netfs_cache_resources {
const struct netfs_cache_ops *ops; const struct netfs_cache_ops *ops;
void *cache_priv; void *cache_priv;
void *cache_priv2; void *cache_priv2;
unsigned int debug_id; /* Cookie debug ID */
}; };
/* /*
...@@ -137,7 +138,6 @@ struct netfs_read_request { ...@@ -137,7 +138,6 @@ struct netfs_read_request {
struct list_head subrequests; /* Requests to fetch I/O from disk or net */ struct list_head subrequests; /* Requests to fetch I/O from disk or net */
void *netfs_priv; /* Private data for the netfs */ void *netfs_priv; /* Private data for the netfs */
unsigned int debug_id; unsigned int debug_id;
unsigned int cookie_debug_id;
atomic_t nr_rd_ops; /* Number of read ops in progress */ atomic_t nr_rd_ops; /* Number of read ops in progress */
atomic_t nr_wr_ops; /* Number of write ops in progress */ atomic_t nr_wr_ops; /* Number of write ops in progress */
size_t submitted; /* Amount submitted for I/O so far */ size_t submitted; /* Amount submitted for I/O so far */
......
...@@ -139,7 +139,7 @@ TRACE_EVENT(netfs_read, ...@@ -139,7 +139,7 @@ TRACE_EVENT(netfs_read,
TP_fast_assign( TP_fast_assign(
__entry->rreq = rreq->debug_id; __entry->rreq = rreq->debug_id;
__entry->cookie = rreq->cookie_debug_id; __entry->cookie = rreq->cache_resources.debug_id;
__entry->start = start; __entry->start = start;
__entry->len = len; __entry->len = len;
__entry->what = what; __entry->what = what;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment