History

Merge tag 'for-6.4/block-2023-05-06' of git://git.kernel.dk/linux

Pull more block updates from Jens Axboe: - MD pull request via Song: - Improve raid5 sequential IO performance on spinning disks, which fixes a regression since v6.0 (Jan Kara) - Fix bitmap offset types, which fixes an issue introduced in this merge window (Jonathan Derrick) - Cleanup of hweight type used for cgroup writeback (Maxim) - Fix a regression with the "has_submit_bio" changes across partitions (Ming) - Cleanup of QUEUE_FLAG_ADD_RANDOM clearing. We used to set this flag on queues non blk-mq queues, and hence some drivers clear it unconditionally. Since all of these have since been converted to true blk-mq drivers, drop the useless clear as the bit is not set (Chaitanya) - Fix the flags being set in a bio for a flush for drbd (Christoph) - Cleanup and deduplication of the code handling setting block device capacity (Damien) - Fix for ublk handling IO timeouts (Ming) - Fix for a regression in blk-cgroup teardown (Tao) - NBD documentation and code fixes (Eric) - Convert blk-integrity to using device_attributes rather than a second kobject to manage lifetimes (Thomas) * tag 'for-6.4/block-2023-05-06' of git://git.kernel.dk/linux: ublk: add timeout handler drbd: correctly submit flush bio on barrier mailmap: add mailmap entries for Jens Axboe block: Skip destroyed blkg when restart in blkg_destroy_all() writeback: fix call of incorrect macro md: Fix bitmap offset type in sb writer md/raid5: Improve performance for sequential IO docs nbd: userspace NBD now favors github over sourceforge block nbd: use req.cookie instead of req.handle uapi nbd: add cookie alias to handle uapi nbd: improve doc links to userspace spec blk-integrity: register sysfs attributes on struct device blk-integrity: convert to struct device_attribute blk-integrity: use sysfs_emit block/drivers: remove dead clear of random flag block: sync part's ->bd_has_submit_bio with disk's block: Cleanup set_capacity()/bdev_set_nr_sectors()

Linus Torvalds committed 3 years ago

Commit a3b111b2 parents 7644c82 c0b79b020 files · +192 −170Browse files

Showing the changes to include/uapi/linux (1 of 20 files). Show all

Unified · Split

include/uapi/linux/nbd.h+20−5
@@ -11,6 +11,8 @@ · 10 unmodified lines
1111 * Cleanup PARANOIA usage & code.
1212 * 2004/02/19 Paul Clements
1313 * Removed PARANOIA, plus various cleanup and comments
14+ * 2023 Copyright Red Hat
15+ * Link to userspace extensions, favor cookie over handle.
1416 */
1517
1618 #ifndef _UAPILINUX_NBD_H
@@ -30,12 +32,18 @@ · 13 unmodified lines
3032 #define NBD_SET_TIMEOUT _IO( 0xab, 9 )
3133 #define NBD_SET_FLAGS _IO( 0xab, 10)
3234
35+/*
36+ * See also https://github.com/NetworkBlockDevice/nbd/blob/master/doc/proto.md
37+ * for additional userspace extensions not yet utilized in the kernel module.
38+ */
39+
3340 enum {
3441 NBD_CMD_READ = 0,
3542 NBD_CMD_WRITE = 1,
3643 NBD_CMD_DISC = 2,
3744 NBD_CMD_FLUSH = 3,
3845 NBD_CMD_TRIM = 4
46+ /* userspace defines additional extension commands */
3947 };
4048
4149 /* values for flags field, these are server interaction specific. */
@@ -64,15 +72,19 @@ enum { · 22 unmodified lines
6472 #define NBD_REQUEST_MAGIC 0x25609513
6573 #define NBD_REPLY_MAGIC 0x67446698
6674 /* Do *not* use magics: 0x12560953 0x96744668. */
75+/* magic 0x668e33ef for structured reply not supported by kernel yet */
6776
6877 /*
6978 * This is the packet used for communication between client and
7079 * server. All data are in network byte order.
7180 */
7281 struct nbd_request {
73− __be32 magic;
74− __be32 type; /* == READ || == WRITE */
75− char handle[8];
82+ __be32 magic; /* NBD_REQUEST_MAGIC */
83+ __be32 type; /* See NBD_CMD_* */
84+ union {
85+ __be64 cookie; /* Opaque identifier for request */
86+ char handle[8]; /* older spelling of cookie */
87+ };
7688 __be64 from;
7789 __be32 len;
7890 } __attribute__((packed));
@@ -82,8 +94,11 @@ struct nbd_request { · 3 unmodified lines
8294 * it has completed an I/O request (or an error occurs).
8395 */
8496 struct nbd_reply {
85− __be32 magic;
97+ __be32 magic; /* NBD_REPLY_MAGIC */
8698 __be32 error; /* 0 = ok, else error */
87− char handle[8]; /* handle you got from request */
99+ union {
100+ __be64 cookie; /* Opaque identifier from request */
101+ char handle[8]; /* older spelling of cookie */
102+ };
88103 };
89104 #endif /* _UAPILINUX_NBD_H */