From: Richard Weinberger <richard@nod.at>
To: miklos@szeredi.hu
Cc: miquel.raynal@bootlin.com, vigneshr@ti.com,
boris.brezillon@collabora.com, rminnich@google.com,
sven@narfation.org, linux-kernel@vger.kernel.org,
linux-mtd@lists.infradead.org, fuse-devel@lists.sourceforge.net,
Richard Weinberger <richard@nod.at>
Subject: [PATCH 6/8] fuse: Add MUSE specific defines FUSE interface
Date: Mon, 25 Jan 2021 00:20:05 +0100 [thread overview]
Message-ID: <20210124232007.21639-7-richard@nod.at> (raw)
In-Reply-To: <20210124232007.21639-1-richard@nod.at>
Raise the FUSE API minor version to 34 and add all
MUSE specific operations and data structures.
MUSE_INIT: Initialize a new connection and installs the MTD
MUSE_ERASE: Erases a block
MUSE_READ: Reads a page with or without OOB
MUSE_WRITE: Writes a page with or without OOB
MUSE_MARKBAD: Marks a block as bad
MUSE_ISBAD: Checks whether a block is bad
MUSE_SYNC: Flushes all cached data
Signed-off-by: Richard Weinberger <richard@nod.at>
---
include/uapi/linux/fuse.h | 76 +++++++++++++++++++++++++++++++++++++++
1 file changed, 76 insertions(+)
diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h
index 98ca64d1beb6..1c8fa9e42e73 100644
--- a/include/uapi/linux/fuse.h
+++ b/include/uapi/linux/fuse.h
@@ -179,6 +179,10 @@
* 7.33
* - add FUSE_HANDLE_KILLPRIV_V2, FUSE_WRITE_KILL_SUIDGID, FATTR_KILL_SUIDGID
* - add FUSE_OPEN_KILL_SUIDGID
+ *
+ * 7.34
+ * - add support for MUSE: MUSE_INIT, MUSE_ERASE, MUSE_READ, MUSE_WRITE,
+ * MUSE_MARKBAD, MUSE_ISBAD and MUSE_SYNC
*/
#ifndef _LINUX_FUSE_H
@@ -503,6 +507,15 @@ enum fuse_opcode {
/* CUSE specific operations */
CUSE_INIT = 4096,
+ /* MUSE specific operations */
+ MUSE_INIT = 8192,
+ MUSE_ERASE = 8193,
+ MUSE_READ = 8194,
+ MUSE_WRITE = 8195,
+ MUSE_MARKBAD = 8196,
+ MUSE_ISBAD = 8197,
+ MUSE_SYNC = 8198,
+
/* Reserved opcodes: helpful to detect structure endian-ness */
CUSE_INIT_BSWAP_RESERVED = 1048576, /* CUSE_INIT << 8 */
FUSE_INIT_BSWAP_RESERVED = 436207616, /* FUSE_INIT << 24 */
@@ -956,4 +969,67 @@ struct fuse_removemapping_one {
#define FUSE_REMOVEMAPPING_MAX_ENTRY \
(PAGE_SIZE / sizeof(struct fuse_removemapping_one))
+#define MUSE_INIT_INFO_MAX 4096
+
+struct muse_init_in {
+ uint32_t fuse_major;
+ uint32_t fuse_minor;
+};
+
+struct muse_init_out {
+ uint32_t fuse_major;
+ uint32_t fuse_minor;
+ uint32_t max_read;
+ uint32_t max_write;
+};
+
+struct muse_erase_in {
+ uint64_t addr;
+ uint64_t len;
+};
+
+#define MUSE_IO_INBAND (1 << 0)
+#define MUSE_IO_OOB_AUTO (1 << 1)
+#define MUSE_IO_OOB_PLACE (1 << 2)
+#define MUSE_IO_RAW (1 << 3)
+
+struct muse_read_in {
+ uint64_t addr;
+ uint64_t len;
+ uint32_t flags;
+ uint32_t padding;
+};
+
+struct muse_read_out {
+ uint64_t len;
+ uint32_t soft_error;
+ uint32_t padding;
+};
+
+struct muse_write_in {
+ uint64_t addr;
+ uint64_t len;
+ uint32_t flags;
+ uint32_t padding;
+};
+
+struct muse_write_out {
+ uint64_t len;
+ uint32_t soft_error;
+ uint32_t padding;
+};
+
+struct muse_markbad_in {
+ uint64_t addr;
+};
+
+struct muse_isbad_in {
+ uint64_t addr;
+};
+
+struct muse_isbad_out {
+ uint32_t result;
+ uint32_t padding;
+};
+
#endif /* _LINUX_FUSE_H */
--
2.26.2
next prev parent reply other threads:[~2021-01-24 23:23 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-24 23:19 [PATCH 0/8] MUSE: Userspace backed MTD v3 Richard Weinberger
2021-01-24 23:20 ` [PATCH 1/8] fuse: Export fuse_simple_request Richard Weinberger
2021-01-24 23:20 ` [PATCH 2/8] fuse: Export IO helpers Richard Weinberger
2021-01-24 23:20 ` [PATCH 3/8] fuse: Make cuse_parse_one a common helper Richard Weinberger
2021-01-24 23:20 ` [PATCH 4/8] mtd: Add MTD_MUSE flag Richard Weinberger
2021-01-24 23:20 ` [PATCH 5/8] mtd: Allow passing a custom cmdline to cmdline line parser Richard Weinberger
2021-01-24 23:20 ` Richard Weinberger [this message]
2021-01-24 23:20 ` [PATCH 7/8] fuse: Implement MUSE - MTD in userspace Richard Weinberger
2021-01-24 23:20 ` [PATCH 8/8] MAINTAINERS: Add entry for MUSE Richard Weinberger
2021-01-28 10:30 ` [PATCH 0/8] MUSE: Userspace backed MTD v3 Miquel Raynal
2021-02-01 13:14 ` Richard Weinberger
2021-02-01 13:55 ` Miklos Szeredi
2021-02-09 14:26 ` Miklos Szeredi
2021-02-09 14:35 ` Richard Weinberger
2021-02-09 15:10 ` [fuse-devel] " Luca Risolia
2021-02-09 15:22 ` Miklos Szeredi
2021-02-09 15:41 ` Richard Weinberger
2021-02-09 15:56 ` Luca Risolia
2021-02-09 16:04 ` Richard Weinberger
2021-02-09 16:28 ` Luca Risolia
2021-02-09 16:29 ` Richard Weinberger
2021-02-09 16:42 ` Luca Risolia
2021-02-09 16:50 ` Richard Weinberger
2021-02-09 17:46 ` Luca Risolia
2021-02-09 19:42 ` Miklos Szeredi
2021-02-09 20:06 ` Richard Weinberger
2021-02-10 10:12 ` Miklos Szeredi
2021-02-10 11:12 ` Richard Weinberger
2021-02-10 11:16 ` Miklos Szeredi
2021-02-11 18:09 ` Miklos Szeredi
2021-04-13 12:59 ` Miklos Szeredi
2021-02-09 21:39 ` Richard Weinberger
2021-02-10 10:16 ` Miklos Szeredi
2021-02-10 11:00 ` Richard Weinberger
2021-02-10 11:14 ` Miquel Raynal
2021-02-10 11:23 ` Richard Weinberger
2021-02-10 20:55 ` Miquel Raynal
2021-02-10 21:11 ` Richard Weinberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210124232007.21639-7-richard@nod.at \
--to=richard@nod.at \
--cc=boris.brezillon@collabora.com \
--cc=fuse-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miklos@szeredi.hu \
--cc=miquel.raynal@bootlin.com \
--cc=rminnich@google.com \
--cc=sven@narfation.org \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).