summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGao Xiang <xiang@kernel.org>2026-08-12 15:15:27 +0100
committerChristian Brauner <brauner@kernel.org>2026-08-12 16:24:26 +0200
commit949eb95d5bcc530e6ce74cc95897c1849c53ea89 (patch)
tree3faf5fa1ff9f87a25c39c372f13bb703b0759365 /include
parentdb2ddb87143519e20a95aa36c60b36107b736a58 (diff)
cachefiles,netfs: sunset ondemand mode
It was an effort to enhance fscache as a kernel cache for lazy pulling (at least according to previous Incremental FS discussion [1]) and EROFS over fscache was the in-tree user of this mode. fscache has since evolved to be netfslib-oriented, serving network filesystem inodes via the netfs library, but EROFS never acts as a network filesystem and we need to cache golden filesystem images rather than individual EROFS inodes. Since EROFS over fscache is now removed, clean up netfs/fscache/ cachefiles upstream too. [1] https://lore.kernel.org/r/CAOQ4uxi4dzxArY24YO=+kBCK2gGoq3Ptb8WkzCqSogPgU_R3dQ@mail.gmail.com [dh] Fixed up comments on: https://sashiko.dev/#/patchset/20260716103030.3065561-1-dhowells%40redhat.com https://sashiko.dev/#/patchset/20260722130218.78958-1-dhowells%40redhat.com Signed-off-by: Gao Xiang <xiang@kernel.org> Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/1046393.1786544127@warthog.procyon.org.uk cc: Paulo Alcantara <pc@manguebit.org> cc: netfs@lists.linux.dev cc: linux-erofs@lists.ozlabs.org cc: bpf@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netfs.h9
-rw-r--r--include/trace/events/cachefiles.h184
-rw-r--r--include/uapi/linux/cachefiles.h68
3 files changed, 1 insertions, 260 deletions
diff --git a/include/linux/netfs.h b/include/linux/netfs.h
index d0b62d53eea9..f837a501008c 100644
--- a/include/linux/netfs.h
+++ b/include/linux/netfs.h
@@ -191,7 +191,6 @@ struct netfs_io_subrequest {
#define NETFS_SREQ_COPY_TO_CACHE 0 /* Set if should copy the data to the cache */
#define NETFS_SREQ_CLEAR_TAIL 1 /* Set if the rest of the read should be cleared */
#define NETFS_SREQ_MADE_PROGRESS 4 /* Set if we transferred at least some data */
-#define NETFS_SREQ_ONDEMAND 5 /* Set if it's from on-demand read mode */
#define NETFS_SREQ_BOUNDARY 6 /* Set if ends on hard boundary (eg. ceph object) */
#define NETFS_SREQ_HIT_EOF 7 /* Set if short due to EOF */
#define NETFS_SREQ_IN_PROGRESS 8 /* Unlocked when the subrequest completes */
@@ -374,14 +373,6 @@ struct netfs_cache_ops {
loff_t *_start, size_t *_len, size_t upper_len,
loff_t i_size, bool no_space_allocated_yet);
- /* Prepare an on-demand read operation, shortening it to a cached/uncached
- * boundary as appropriate.
- */
- enum netfs_io_source (*prepare_ondemand_read)(struct netfs_cache_resources *cres,
- loff_t start, size_t *_len,
- loff_t i_size,
- unsigned long *_flags, ino_t ino);
-
/* Query the occupancy of the cache in a region, returning where the
* next chunk of data starts and how long it is.
*/
diff --git a/include/trace/events/cachefiles.h b/include/trace/events/cachefiles.h
index 6e3b1424eea4..9259bc71049e 100644
--- a/include/trace/events/cachefiles.h
+++ b/include/trace/events/cachefiles.h
@@ -31,10 +31,6 @@ enum cachefiles_obj_ref_trace {
cachefiles_obj_see_lookup_failed,
cachefiles_obj_see_withdraw_cookie,
cachefiles_obj_see_withdrawal,
- cachefiles_obj_get_ondemand_fd,
- cachefiles_obj_put_ondemand_fd,
- cachefiles_obj_get_read_req,
- cachefiles_obj_put_read_req,
};
enum fscache_why_object_killed {
@@ -129,11 +125,7 @@ enum cachefiles_error_trace {
EM(cachefiles_obj_see_lookup_cookie, "SEE lookup_cookie") \
EM(cachefiles_obj_see_lookup_failed, "SEE lookup_failed") \
EM(cachefiles_obj_see_withdraw_cookie, "SEE withdraw_cookie") \
- EM(cachefiles_obj_see_withdrawal, "SEE withdrawal") \
- EM(cachefiles_obj_get_ondemand_fd, "GET ondemand_fd") \
- EM(cachefiles_obj_put_ondemand_fd, "PUT ondemand_fd") \
- EM(cachefiles_obj_get_read_req, "GET read_req") \
- E_(cachefiles_obj_put_read_req, "PUT read_req")
+ E_(cachefiles_obj_see_withdrawal, "SEE withdrawal")
#define cachefiles_coherency_traces \
EM(cachefiles_coherency_check_aux, "BAD aux ") \
@@ -687,180 +679,6 @@ TRACE_EVENT(cachefiles_io_error,
__entry->error)
);
-TRACE_EVENT(cachefiles_ondemand_open,
- TP_PROTO(struct cachefiles_object *obj, struct cachefiles_msg *msg,
- struct cachefiles_open *load),
-
- TP_ARGS(obj, msg, load),
-
- TP_STRUCT__entry(
- __field(unsigned int, obj)
- __field(unsigned int, msg_id)
- __field(unsigned int, object_id)
- __field(unsigned int, fd)
- __field(unsigned int, flags)
- ),
-
- TP_fast_assign(
- __entry->obj = obj ? obj->debug_id : 0;
- __entry->msg_id = msg->msg_id;
- __entry->object_id = msg->object_id;
- __entry->fd = load->fd;
- __entry->flags = load->flags;
- ),
-
- TP_printk("o=%08x mid=%x oid=%x fd=%d f=%x",
- __entry->obj,
- __entry->msg_id,
- __entry->object_id,
- __entry->fd,
- __entry->flags)
- );
-
-TRACE_EVENT(cachefiles_ondemand_copen,
- TP_PROTO(struct cachefiles_object *obj, unsigned int msg_id,
- long len),
-
- TP_ARGS(obj, msg_id, len),
-
- TP_STRUCT__entry(
- __field(unsigned int, obj)
- __field(unsigned int, msg_id)
- __field(long, len)
- ),
-
- TP_fast_assign(
- __entry->obj = obj ? obj->debug_id : 0;
- __entry->msg_id = msg_id;
- __entry->len = len;
- ),
-
- TP_printk("o=%08x mid=%x l=%lx",
- __entry->obj,
- __entry->msg_id,
- __entry->len)
- );
-
-TRACE_EVENT(cachefiles_ondemand_close,
- TP_PROTO(struct cachefiles_object *obj, struct cachefiles_msg *msg),
-
- TP_ARGS(obj, msg),
-
- TP_STRUCT__entry(
- __field(unsigned int, obj)
- __field(unsigned int, msg_id)
- __field(unsigned int, object_id)
- ),
-
- TP_fast_assign(
- __entry->obj = obj ? obj->debug_id : 0;
- __entry->msg_id = msg->msg_id;
- __entry->object_id = msg->object_id;
- ),
-
- TP_printk("o=%08x mid=%x oid=%x",
- __entry->obj,
- __entry->msg_id,
- __entry->object_id)
- );
-
-TRACE_EVENT(cachefiles_ondemand_read,
- TP_PROTO(struct cachefiles_object *obj, struct cachefiles_msg *msg,
- struct cachefiles_read *load),
-
- TP_ARGS(obj, msg, load),
-
- TP_STRUCT__entry(
- __field(unsigned int, obj)
- __field(unsigned int, msg_id)
- __field(unsigned int, object_id)
- __field(loff_t, start)
- __field(size_t, len)
- ),
-
- TP_fast_assign(
- __entry->obj = obj ? obj->debug_id : 0;
- __entry->msg_id = msg->msg_id;
- __entry->object_id = msg->object_id;
- __entry->start = load->off;
- __entry->len = load->len;
- ),
-
- TP_printk("o=%08x mid=%x oid=%x s=%llx l=%zx",
- __entry->obj,
- __entry->msg_id,
- __entry->object_id,
- __entry->start,
- __entry->len)
- );
-
-TRACE_EVENT(cachefiles_ondemand_cread,
- TP_PROTO(struct cachefiles_object *obj, unsigned int msg_id),
-
- TP_ARGS(obj, msg_id),
-
- TP_STRUCT__entry(
- __field(unsigned int, obj)
- __field(unsigned int, msg_id)
- ),
-
- TP_fast_assign(
- __entry->obj = obj ? obj->debug_id : 0;
- __entry->msg_id = msg_id;
- ),
-
- TP_printk("o=%08x mid=%x",
- __entry->obj,
- __entry->msg_id)
- );
-
-TRACE_EVENT(cachefiles_ondemand_fd_write,
- TP_PROTO(struct cachefiles_object *obj, struct inode *backer,
- loff_t start, size_t len),
-
- TP_ARGS(obj, backer, start, len),
-
- TP_STRUCT__entry(
- __field(unsigned int, obj)
- __field(unsigned int, backer)
- __field(loff_t, start)
- __field(size_t, len)
- ),
-
- TP_fast_assign(
- __entry->obj = obj ? obj->debug_id : 0;
- __entry->backer = backer->i_ino;
- __entry->start = start;
- __entry->len = len;
- ),
-
- TP_printk("o=%08x iB=%x s=%llx l=%zx",
- __entry->obj,
- __entry->backer,
- __entry->start,
- __entry->len)
- );
-
-TRACE_EVENT(cachefiles_ondemand_fd_release,
- TP_PROTO(struct cachefiles_object *obj, int object_id),
-
- TP_ARGS(obj, object_id),
-
- TP_STRUCT__entry(
- __field(unsigned int, obj)
- __field(unsigned int, object_id)
- ),
-
- TP_fast_assign(
- __entry->obj = obj ? obj->debug_id : 0;
- __entry->object_id = object_id;
- ),
-
- TP_printk("o=%08x oid=%x",
- __entry->obj,
- __entry->object_id)
- );
-
#endif /* _TRACE_CACHEFILES_H */
/* This part must be outside protection */
diff --git a/include/uapi/linux/cachefiles.h b/include/uapi/linux/cachefiles.h
deleted file mode 100644
index 78caa73e5343..000000000000
--- a/include/uapi/linux/cachefiles.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-#ifndef _LINUX_CACHEFILES_H
-#define _LINUX_CACHEFILES_H
-
-#include <linux/types.h>
-#include <linux/ioctl.h>
-
-/*
- * Fscache ensures that the maximum length of cookie key is 255. The volume key
- * is controlled by netfs, and generally no bigger than 255.
- */
-#define CACHEFILES_MSG_MAX_SIZE 1024
-
-enum cachefiles_opcode {
- CACHEFILES_OP_OPEN,
- CACHEFILES_OP_CLOSE,
- CACHEFILES_OP_READ,
-};
-
-/*
- * Message Header
- *
- * @msg_id a unique ID identifying this message
- * @opcode message type, CACHEFILE_OP_*
- * @len message length, including message header and following data
- * @object_id a unique ID identifying a cache file
- * @data message type specific payload
- */
-struct cachefiles_msg {
- __u32 msg_id;
- __u32 opcode;
- __u32 len;
- __u32 object_id;
- __u8 data[];
-};
-
-/*
- * @data contains the volume_key followed directly by the cookie_key. volume_key
- * is a NUL-terminated string; @volume_key_size indicates the size of the volume
- * key in bytes. cookie_key is binary data, which is netfs specific;
- * @cookie_key_size indicates the size of the cookie key in bytes.
- *
- * @fd identifies an anon_fd referring to the cache file.
- */
-struct cachefiles_open {
- __u32 volume_key_size;
- __u32 cookie_key_size;
- __u32 fd;
- __u32 flags;
- __u8 data[];
-};
-
-/*
- * @off indicates the starting offset of the requested file range
- * @len indicates the length of the requested file range
- */
-struct cachefiles_read {
- __u64 off;
- __u64 len;
-};
-
-/*
- * Reply for READ request
- * @arg for this ioctl is the @id field of READ request.
- */
-#define CACHEFILES_IOC_READ_COMPLETE _IOW(0x98, 1, int)
-
-#endif