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
11 * Cleanup PARANOIA usage & code.11 * Cleanup PARANOIA usage & code.
12 * 2004/02/19 Paul Clements12 * 2004/02/19 Paul Clements
13 * Removed PARANOIA, plus various cleanup and comments13 * Removed PARANOIA, plus various cleanup and comments
14 * 2023 Copyright Red Hat
15 * Link to userspace extensions, favor cookie over handle.
14 */16 */
15 17
16#ifndef _UAPILINUX_NBD_H18#ifndef _UAPILINUX_NBD_H
@@ -30,12 +32,18 @@ · 13 unmodified lines
30#define NBD_SET_TIMEOUT _IO( 0xab, 9 )32#define NBD_SET_TIMEOUT _IO( 0xab, 9 )
31#define NBD_SET_FLAGS _IO( 0xab, 10)33#define NBD_SET_FLAGS _IO( 0xab, 10)
32 34
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
33enum {40enum {
34 NBD_CMD_READ = 0,41 NBD_CMD_READ = 0,
35 NBD_CMD_WRITE = 1,42 NBD_CMD_WRITE = 1,
36 NBD_CMD_DISC = 2,43 NBD_CMD_DISC = 2,
37 NBD_CMD_FLUSH = 3,44 NBD_CMD_FLUSH = 3,
38 NBD_CMD_TRIM = 445 NBD_CMD_TRIM = 4
46 /* userspace defines additional extension commands */
39};47};
40 48
41/* values for flags field, these are server interaction specific. */49/* values for flags field, these are server interaction specific. */
@@ -64,15 +72,19 @@ enum { · 22 unmodified lines
64#define NBD_REQUEST_MAGIC 0x2560951372#define NBD_REQUEST_MAGIC 0x25609513
65#define NBD_REPLY_MAGIC 0x6744669873#define NBD_REPLY_MAGIC 0x67446698
66/* Do *not* use magics: 0x12560953 0x96744668. */74/* Do *not* use magics: 0x12560953 0x96744668. */
75/* magic 0x668e33ef for structured reply not supported by kernel yet */
67 76
68/*77/*
69 * This is the packet used for communication between client and78 * This is the packet used for communication between client and
70 * server. All data are in network byte order.79 * server. All data are in network byte order.
71 */80 */
72struct nbd_request {81struct nbd_request {
73 __be32 magic;82 __be32 magic; /* NBD_REQUEST_MAGIC */
74 __be32 type; /* == READ || == WRITE */83 __be32 type; /* See NBD_CMD_* */
75 char handle[8];84 union {
85 __be64 cookie; /* Opaque identifier for request */
86 char handle[8]; /* older spelling of cookie */
87 };
76 __be64 from;88 __be64 from;
77 __be32 len;89 __be32 len;
78} __attribute__((packed));90} __attribute__((packed));
@@ -82,8 +94,11 @@ struct nbd_request { · 3 unmodified lines
82 * it has completed an I/O request (or an error occurs).94 * it has completed an I/O request (or an error occurs).
83 */95 */
84struct nbd_reply {96struct nbd_reply {
85 __be32 magic;97 __be32 magic; /* NBD_REPLY_MAGIC */
86 __be32 error; /* 0 = ok, else error */98 __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 };
88};103};
89#endif /* _UAPILINUX_NBD_H */104#endif /* _UAPILINUX_NBD_H */