Commit d8763023 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Philipp Reisner

drbd: Rename "enum drbd_packets" to "enum drbd_packet"

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent f2ad9063
......@@ -159,7 +159,7 @@ extern struct drbd_conf **minor_table;
extern struct ratelimit_state drbd_ratelimit_state;
/* on the wire */
enum drbd_packets {
enum drbd_packet {
/* receiver (data socket) */
P_DATA = 0x00,
P_DATA_REPLY = 0x01, /* Response to P_DATA_REQUEST */
......@@ -221,7 +221,7 @@ enum drbd_packets {
P_HAND_SHAKE = 0xfffe /* FIXED for the next century! */
};
extern const char *cmdname(enum drbd_packets cmd);
extern const char *cmdname(enum drbd_packet cmd);
/* for sending/receiving the bitmap,
* possibly in some encoding scheme */
......@@ -1189,36 +1189,34 @@ extern int drbd_send_sizes(struct drbd_conf *mdev, int trigger_reply, enum dds_f
extern int _drbd_send_state(struct drbd_conf *mdev);
extern int drbd_send_state(struct drbd_conf *mdev);
extern int _drbd_send_cmd(struct drbd_conf *mdev, struct socket *sock,
enum drbd_packets cmd, struct p_header *h,
size_t size, unsigned msg_flags);
enum drbd_packet cmd, struct p_header *h,
size_t size, unsigned msg_flags);
#define USE_DATA_SOCKET 1
#define USE_META_SOCKET 0
extern int drbd_send_cmd(struct drbd_conf *mdev, int use_data_socket,
enum drbd_packets cmd, struct p_header *h,
size_t size);
extern int drbd_send_cmd2(struct drbd_conf *mdev, enum drbd_packets cmd,
char *data, size_t size);
enum drbd_packet cmd, struct p_header *h, size_t size);
extern int drbd_send_cmd2(struct drbd_conf *mdev, enum drbd_packet cmd,
char *data, size_t size);
extern int drbd_send_sync_param(struct drbd_conf *mdev, struct syncer_conf *sc);
extern int drbd_send_b_ack(struct drbd_conf *mdev, u32 barrier_nr,
u32 set_size);
extern int drbd_send_ack(struct drbd_conf *mdev, enum drbd_packets cmd,
struct drbd_epoch_entry *e);
extern int drbd_send_ack_rp(struct drbd_conf *mdev, enum drbd_packets cmd,
struct p_block_req *rp);
extern int drbd_send_ack_dp(struct drbd_conf *mdev, enum drbd_packets cmd,
struct p_data *dp, int data_size);
extern int drbd_send_ack_ex(struct drbd_conf *mdev, enum drbd_packets cmd,
extern int drbd_send_ack(struct drbd_conf *mdev, enum drbd_packet cmd,
struct drbd_epoch_entry *e);
extern int drbd_send_ack_rp(struct drbd_conf *mdev, enum drbd_packet cmd,
struct p_block_req *rp);
extern int drbd_send_ack_dp(struct drbd_conf *mdev, enum drbd_packet cmd,
struct p_data *dp, int data_size);
extern int drbd_send_ack_ex(struct drbd_conf *mdev, enum drbd_packet cmd,
sector_t sector, int blksize, u64 block_id);
extern int drbd_send_oos(struct drbd_conf *mdev, struct drbd_request *req);
extern int drbd_send_block(struct drbd_conf *mdev, enum drbd_packets cmd,
extern int drbd_send_block(struct drbd_conf *mdev, enum drbd_packet cmd,
struct drbd_epoch_entry *e);
extern int drbd_send_dblock(struct drbd_conf *mdev, struct drbd_request *req);
extern int drbd_send_drequest(struct drbd_conf *mdev, int cmd,
sector_t sector, int size, u64 block_id);
extern int drbd_send_drequest_csum(struct drbd_conf *mdev,
sector_t sector,int size,
void *digest, int digest_size,
enum drbd_packets cmd);
extern int drbd_send_drequest_csum(struct drbd_conf *mdev, sector_t sector,
int size, void *digest, int digest_size,
enum drbd_packet cmd);
extern int drbd_send_ov_request(struct drbd_conf *mdev,sector_t sector,int size);
extern int drbd_send_bitmap(struct drbd_conf *mdev);
......@@ -1961,7 +1959,7 @@ static inline void request_ping(struct drbd_conf *mdev)
}
static inline int drbd_send_short_cmd(struct drbd_conf *mdev,
enum drbd_packets cmd)
enum drbd_packet cmd)
{
struct p_header h;
return drbd_send_cmd(mdev, USE_DATA_SOCKET, cmd, &h, sizeof(h));
......
......@@ -1821,7 +1821,7 @@ void drbd_thread_current_set_cpu(struct drbd_conf *mdev)
#endif
static void prepare_header80(struct drbd_conf *mdev, struct p_header80 *h,
enum drbd_packets cmd, int size)
enum drbd_packet cmd, int size)
{
h->magic = cpu_to_be32(DRBD_MAGIC);
h->command = cpu_to_be16(cmd);
......@@ -1829,7 +1829,7 @@ static void prepare_header80(struct drbd_conf *mdev, struct p_header80 *h,
}
static void prepare_header95(struct drbd_conf *mdev, struct p_header95 *h,
enum drbd_packets cmd, int size)
enum drbd_packet cmd, int size)
{
h->magic = cpu_to_be16(DRBD_MAGIC_BIG);
h->command = cpu_to_be16(cmd);
......@@ -1837,7 +1837,7 @@ static void prepare_header95(struct drbd_conf *mdev, struct p_header95 *h,
}
static void prepare_header(struct drbd_conf *mdev, struct p_header *h,
enum drbd_packets cmd, int size)
enum drbd_packet cmd, int size)
{
if (mdev->tconn->agreed_pro_version >= 100 || size > DRBD_MAX_SIZE_H80_PACKET)
prepare_header95(mdev, &h->h95, cmd, size);
......@@ -1847,8 +1847,8 @@ static void prepare_header(struct drbd_conf *mdev, struct p_header *h,
/* the appropriate socket mutex must be held already */
int _drbd_send_cmd(struct drbd_conf *mdev, struct socket *sock,
enum drbd_packets cmd, struct p_header *h,
size_t size, unsigned msg_flags)
enum drbd_packet cmd, struct p_header *h, size_t size,
unsigned msg_flags)
{
int sent, ok;
......@@ -1872,7 +1872,7 @@ int _drbd_send_cmd(struct drbd_conf *mdev, struct socket *sock,
* when we hold the appropriate socket mutex.
*/
int drbd_send_cmd(struct drbd_conf *mdev, int use_data_socket,
enum drbd_packets cmd, struct p_header *h, size_t size)
enum drbd_packet cmd, struct p_header *h, size_t size)
{
int ok = 0;
struct socket *sock;
......@@ -1897,7 +1897,7 @@ int drbd_send_cmd(struct drbd_conf *mdev, int use_data_socket,
return ok;
}
int drbd_send_cmd2(struct drbd_conf *mdev, enum drbd_packets cmd, char *data,
int drbd_send_cmd2(struct drbd_conf *mdev, enum drbd_packet cmd, char *data,
size_t size)
{
struct p_header h;
......@@ -1938,7 +1938,8 @@ int drbd_send_sync_param(struct drbd_conf *mdev, struct syncer_conf *sc)
sock = mdev->tconn->data.socket;
if (likely(sock != NULL)) {
enum drbd_packets cmd = apv >= 89 ? P_SYNC_PARAM89 : P_SYNC_PARAM;
enum drbd_packet cmd =
apv >= 89 ? P_SYNC_PARAM89 : P_SYNC_PARAM;
p = &mdev->tconn->data.sbuf.rs_param_95;
......@@ -2391,10 +2392,8 @@ int drbd_send_b_ack(struct drbd_conf *mdev, u32 barrier_nr, u32 set_size)
* @blksize: size in byte, needs to be in big endian byte order
* @block_id: Id, big endian byte order
*/
static int _drbd_send_ack(struct drbd_conf *mdev, enum drbd_packets cmd,
u64 sector,
u32 blksize,
u64 block_id)
static int _drbd_send_ack(struct drbd_conf *mdev, enum drbd_packet cmd,
u64 sector, u32 blksize, u64 block_id)
{
int ok;
struct p_block_ack p;
......@@ -2413,7 +2412,7 @@ static int _drbd_send_ack(struct drbd_conf *mdev, enum drbd_packets cmd,
/* dp->sector and dp->block_id already/still in network byte order,
* data_size is payload size according to dp->head,
* and may need to be corrected for digest size. */
int drbd_send_ack_dp(struct drbd_conf *mdev, enum drbd_packets cmd,
int drbd_send_ack_dp(struct drbd_conf *mdev, enum drbd_packet cmd,
struct p_data *dp, int data_size)
{
data_size -= (mdev->tconn->agreed_pro_version >= 87 && mdev->tconn->integrity_r_tfm) ?
......@@ -2422,7 +2421,7 @@ int drbd_send_ack_dp(struct drbd_conf *mdev, enum drbd_packets cmd,
dp->block_id);
}
int drbd_send_ack_rp(struct drbd_conf *mdev, enum drbd_packets cmd,
int drbd_send_ack_rp(struct drbd_conf *mdev, enum drbd_packet cmd,
struct p_block_req *rp)
{
return _drbd_send_ack(mdev, cmd, rp->sector, rp->blksize, rp->block_id);
......@@ -2434,8 +2433,8 @@ int drbd_send_ack_rp(struct drbd_conf *mdev, enum drbd_packets cmd,
* @cmd: Packet command code.
* @e: Epoch entry.
*/
int drbd_send_ack(struct drbd_conf *mdev,
enum drbd_packets cmd, struct drbd_epoch_entry *e)
int drbd_send_ack(struct drbd_conf *mdev, enum drbd_packet cmd,
struct drbd_epoch_entry *e)
{
return _drbd_send_ack(mdev, cmd,
cpu_to_be64(e->i.sector),
......@@ -2445,7 +2444,7 @@ int drbd_send_ack(struct drbd_conf *mdev,
/* This function misuses the block_id field to signal if the blocks
* are is sync or not. */
int drbd_send_ack_ex(struct drbd_conf *mdev, enum drbd_packets cmd,
int drbd_send_ack_ex(struct drbd_conf *mdev, enum drbd_packet cmd,
sector_t sector, int blksize, u64 block_id)
{
return _drbd_send_ack(mdev, cmd,
......@@ -2468,10 +2467,8 @@ int drbd_send_drequest(struct drbd_conf *mdev, int cmd,
return ok;
}
int drbd_send_drequest_csum(struct drbd_conf *mdev,
sector_t sector, int size,
void *digest, int digest_size,
enum drbd_packets cmd)
int drbd_send_drequest_csum(struct drbd_conf *mdev, sector_t sector, int size,
void *digest, int digest_size, enum drbd_packet cmd)
{
int ok;
struct p_block_req p;
......@@ -2742,7 +2739,7 @@ int drbd_send_dblock(struct drbd_conf *mdev, struct drbd_request *req)
* Peer -> (diskless) R_PRIMARY (P_DATA_REPLY)
* C_SYNC_SOURCE -> C_SYNC_TARGET (P_RS_DATA_REPLY)
*/
int drbd_send_block(struct drbd_conf *mdev, enum drbd_packets cmd,
int drbd_send_block(struct drbd_conf *mdev, enum drbd_packet cmd,
struct drbd_epoch_entry *e)
{
int ok;
......@@ -4101,7 +4098,7 @@ static int w_md_sync(struct drbd_conf *mdev, struct drbd_work *w, int unused)
return 1;
}
const char *cmdname(enum drbd_packets cmd)
const char *cmdname(enum drbd_packet cmd)
{
/* THINK may need to become several global tables
* when we want to support more than
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment