aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/coda.h
diff options
context:
space:
mode:
authorPedro Cuadra <pjcuadra@gmail.com>2019-07-16 19:29:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-16 22:23:23 -0400
commita9fba24c6ac9b66c09dfc2a0e845ecace187e89c (patch)
treec0985325e935868b52697d0e0167e0023a0e5d9b /include/uapi/linux/coda.h
parent5bb44810f47a00b608ed2cb9f892ae7ce37b02bd (diff)
coda: add hinting support for partial file caching
This adds support for partial file caching in Coda. Every read, write and mmap informs the userspace cache manager about what part of a file is about to be accessed so that the cache manager can ensure the relevant parts are available before the operation is allowed to proceed. When a read or write operation completes, this is also reported to allow the cache manager to track when partially cached content can be released. If the cache manager does not support partial file caching, or when the entire file has been fetched into the local cache, the cache manager may return an EOPNOTSUPP error to indicate that intent upcalls are no longer necessary until the file is closed. [akpm@linux-foundation.org: little whitespace fixup] Link: http://lkml.kernel.org/r/20190618181301.6960-1-jaharkes@cs.cmu.edu Signed-off-by: Pedro Cuadra <pjcuadra@gmail.com> Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/uapi/linux/coda.h')
-rw-r--r--include/uapi/linux/coda.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/include/uapi/linux/coda.h b/include/uapi/linux/coda.h
index 5dba636b6e11..aa34c2dcae8d 100644
--- a/include/uapi/linux/coda.h
+++ b/include/uapi/linux/coda.h
@@ -271,7 +271,8 @@ struct coda_statfs {
271#define CODA_STATFS 34 271#define CODA_STATFS 34
272#define CODA_STORE 35 272#define CODA_STORE 35
273#define CODA_RELEASE 36 273#define CODA_RELEASE 36
274#define CODA_NCALLS 37 274#define CODA_ACCESS_INTENT 37
275#define CODA_NCALLS 38
275 276
276#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID) 277#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
277 278
@@ -281,8 +282,12 @@ struct coda_statfs {
281 282
282#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t) 283#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
283 284
285// CODA_KERNEL_VERSION 0 /* don't care about kernel version number */
286// CODA_KERNEL_VERSION 1 /* The old venus 4.6 compatible interface */
287// CODA_KERNEL_VERSION 2 /* venus_lookup gets an extra parameter */
284// CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */ 288// CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
285#define CODA_KERNEL_VERSION 4 /* 64-bit timespec */ 289// CODA_KERNEL_VERSION 4 /* 64-bit timespec */
290#define CODA_KERNEL_VERSION 5 /* access intent support */
286 291
287/* 292/*
288 * Venus <-> Coda RPC arguments 293 * Venus <-> Coda RPC arguments
@@ -637,6 +642,25 @@ struct coda_statfs_out {
637 struct coda_statfs stat; 642 struct coda_statfs stat;
638}; 643};
639 644
645#define CODA_ACCESS_TYPE_READ 1
646#define CODA_ACCESS_TYPE_WRITE 2
647#define CODA_ACCESS_TYPE_MMAP 3
648#define CODA_ACCESS_TYPE_READ_FINISH 4
649#define CODA_ACCESS_TYPE_WRITE_FINISH 5
650
651/* coda_access_intent: NO_OUT */
652struct coda_access_intent_in {
653 struct coda_in_hdr ih;
654 struct CodaFid VFid;
655 int count;
656 int pos;
657 int type;
658};
659
660struct coda_access_intent_out {
661 struct coda_out_hdr out;
662};
663
640/* 664/*
641 * Occasionally, we don't cache the fid returned by CODA_LOOKUP. 665 * Occasionally, we don't cache the fid returned by CODA_LOOKUP.
642 * For instance, if the fid is inconsistent. 666 * For instance, if the fid is inconsistent.
@@ -668,6 +692,7 @@ union inputArgs {
668 struct coda_open_by_fd_in coda_open_by_fd; 692 struct coda_open_by_fd_in coda_open_by_fd;
669 struct coda_open_by_path_in coda_open_by_path; 693 struct coda_open_by_path_in coda_open_by_path;
670 struct coda_statfs_in coda_statfs; 694 struct coda_statfs_in coda_statfs;
695 struct coda_access_intent_in coda_access_intent;
671}; 696};
672 697
673union outputArgs { 698union outputArgs {