Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/linux
File: nbd.h
/* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */
[0] Fix | Delete
/*
[1] Fix | Delete
* 1999 Copyright (C) Pavel Machek, pavel@ucw.cz. This code is GPL.
[2] Fix | Delete
* 1999/11/04 Copyright (C) 1999 VMware, Inc. (Regis "HPReg" Duchesne)
[3] Fix | Delete
* Made nbd_end_request() use the io_request_lock
[4] Fix | Delete
* 2001 Copyright (C) Steven Whitehouse
[5] Fix | Delete
* New nbd_end_request() for compatibility with new linux block
[6] Fix | Delete
* layer code.
[7] Fix | Delete
* 2003/06/24 Louis D. Langholtz <ldl@aros.net>
[8] Fix | Delete
* Removed unneeded blksize_bits field from nbd_device struct.
[9] Fix | Delete
* Cleanup PARANOIA usage & code.
[10] Fix | Delete
* 2004/02/19 Paul Clements
[11] Fix | Delete
* Removed PARANOIA, plus various cleanup and comments
[12] Fix | Delete
*/
[13] Fix | Delete
[14] Fix | Delete
#ifndef LINUX_NBD_H
[15] Fix | Delete
#define LINUX_NBD_H
[16] Fix | Delete
[17] Fix | Delete
#include <linux/types.h>
[18] Fix | Delete
[19] Fix | Delete
#define NBD_SET_SOCK _IO( 0xab, 0 )
[20] Fix | Delete
#define NBD_SET_BLKSIZE _IO( 0xab, 1 )
[21] Fix | Delete
#define NBD_SET_SIZE _IO( 0xab, 2 )
[22] Fix | Delete
#define NBD_DO_IT _IO( 0xab, 3 )
[23] Fix | Delete
#define NBD_CLEAR_SOCK _IO( 0xab, 4 )
[24] Fix | Delete
#define NBD_CLEAR_QUE _IO( 0xab, 5 )
[25] Fix | Delete
#define NBD_PRINT_DEBUG _IO( 0xab, 6 )
[26] Fix | Delete
#define NBD_SET_SIZE_BLOCKS _IO( 0xab, 7 )
[27] Fix | Delete
#define NBD_DISCONNECT _IO( 0xab, 8 )
[28] Fix | Delete
#define NBD_SET_TIMEOUT _IO( 0xab, 9 )
[29] Fix | Delete
#define NBD_SET_FLAGS _IO( 0xab, 10)
[30] Fix | Delete
[31] Fix | Delete
enum {
[32] Fix | Delete
NBD_CMD_READ = 0,
[33] Fix | Delete
NBD_CMD_WRITE = 1,
[34] Fix | Delete
NBD_CMD_DISC = 2,
[35] Fix | Delete
NBD_CMD_FLUSH = 3,
[36] Fix | Delete
NBD_CMD_TRIM = 4
[37] Fix | Delete
};
[38] Fix | Delete
[39] Fix | Delete
/* values for flags field, these are server interaction specific. */
[40] Fix | Delete
#define NBD_FLAG_HAS_FLAGS (1 << 0) /* nbd-server supports flags */
[41] Fix | Delete
#define NBD_FLAG_READ_ONLY (1 << 1) /* device is read-only */
[42] Fix | Delete
#define NBD_FLAG_SEND_FLUSH (1 << 2) /* can flush writeback cache */
[43] Fix | Delete
#define NBD_FLAG_SEND_FUA (1 << 3) /* send FUA (forced unit access) */
[44] Fix | Delete
/* there is a gap here to match userspace */
[45] Fix | Delete
#define NBD_FLAG_SEND_TRIM (1 << 5) /* send trim/discard */
[46] Fix | Delete
#define NBD_FLAG_CAN_MULTI_CONN (1 << 8) /* Server supports multiple connections per export. */
[47] Fix | Delete
[48] Fix | Delete
/* values for cmd flags in the upper 16 bits of request type */
[49] Fix | Delete
#define NBD_CMD_FLAG_FUA (1 << 16) /* FUA (forced unit access) op */
[50] Fix | Delete
[51] Fix | Delete
/* These are client behavior specific flags. */
[52] Fix | Delete
#define NBD_CFLAG_DESTROY_ON_DISCONNECT (1 << 0) /* delete the nbd device on
[53] Fix | Delete
disconnect. */
[54] Fix | Delete
#define NBD_CFLAG_DISCONNECT_ON_CLOSE (1 << 1) /* disconnect the nbd device on
[55] Fix | Delete
* close by last opener.
[56] Fix | Delete
*/
[57] Fix | Delete
[58] Fix | Delete
/* userspace doesn't need the nbd_device structure */
[59] Fix | Delete
[60] Fix | Delete
/* These are sent over the network in the request/reply magic fields */
[61] Fix | Delete
[62] Fix | Delete
#define NBD_REQUEST_MAGIC 0x25609513
[63] Fix | Delete
#define NBD_REPLY_MAGIC 0x67446698
[64] Fix | Delete
/* Do *not* use magics: 0x12560953 0x96744668. */
[65] Fix | Delete
[66] Fix | Delete
/*
[67] Fix | Delete
* This is the packet used for communication between client and
[68] Fix | Delete
* server. All data are in network byte order.
[69] Fix | Delete
*/
[70] Fix | Delete
struct nbd_request {
[71] Fix | Delete
__be32 magic;
[72] Fix | Delete
__be32 type; /* == READ || == WRITE */
[73] Fix | Delete
char handle[8];
[74] Fix | Delete
__be64 from;
[75] Fix | Delete
__be32 len;
[76] Fix | Delete
} __attribute__((packed));
[77] Fix | Delete
[78] Fix | Delete
/*
[79] Fix | Delete
* This is the reply packet that nbd-server sends back to the client after
[80] Fix | Delete
* it has completed an I/O request (or an error occurs).
[81] Fix | Delete
*/
[82] Fix | Delete
struct nbd_reply {
[83] Fix | Delete
__be32 magic;
[84] Fix | Delete
__be32 error; /* 0 = ok, else error */
[85] Fix | Delete
char handle[8]; /* handle you got from request */
[86] Fix | Delete
};
[87] Fix | Delete
#endif /* LINUX_NBD_H */
[88] Fix | Delete
[89] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function