Skip to content

Commit d10a0b8

Browse files
Alexander Aringteigland
authored andcommitted
fs: dlm: rename socket and app buffer defines
This patch renames DEFAULT_BUFFER_SIZE to DLM_MAX_SOCKET_BUFSIZE and LOWCOMMS_MAX_TX_BUFFER_LEN to DLM_MAX_APP_BUFSIZE as they are proper names to define what's behind those values. The DLM_MAX_SOCKET_BUFSIZE defines the maximum size of buffer which can be handled on socket layer, the DLM_MAX_APP_BUFSIZE defines the maximum size of buffer which can be handled by the DLM application layer. Signed-off-by: Alexander Aring <[email protected]> Signed-off-by: David Teigland <[email protected]>
1 parent ac7d5d0 commit d10a0b8

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

fs/dlm/config.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ static int dlm_check_zero(unsigned int x)
208208

209209
static int dlm_check_buffer_size(unsigned int x)
210210
{
211-
if (x < DEFAULT_BUFFER_SIZE)
211+
if (x < DLM_MAX_SOCKET_BUFSIZE)
212212
return -EINVAL;
213213

214214
return 0;
@@ -962,7 +962,7 @@ int dlm_our_addr(struct sockaddr_storage *addr, int num)
962962

963963
struct dlm_config_info dlm_config = {
964964
.ci_tcp_port = DEFAULT_TCP_PORT,
965-
.ci_buffer_size = DEFAULT_BUFFER_SIZE,
965+
.ci_buffer_size = DLM_MAX_SOCKET_BUFSIZE,
966966
.ci_rsbtbl_size = DEFAULT_RSBTBL_SIZE,
967967
.ci_recover_timer = DEFAULT_RECOVER_TIMER,
968968
.ci_toss_secs = DEFAULT_TOSS_SECS,

fs/dlm/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#ifndef __CONFIG_DOT_H__
1313
#define __CONFIG_DOT_H__
1414

15-
#define DEFAULT_BUFFER_SIZE 4096
15+
#define DLM_MAX_SOCKET_BUFSIZE 4096
1616

1717
struct dlm_config_node {
1818
int nodeid;

fs/dlm/lockspace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ static int new_lockspace(const char *name, const char *cluster,
572572
* not having out of bounds issues. However on sending side 3.2
573573
* might send less.
574574
*/
575-
ls->ls_recover_buf = kmalloc(DEFAULT_BUFFER_SIZE, GFP_NOFS);
575+
ls->ls_recover_buf = kmalloc(DLM_MAX_SOCKET_BUFSIZE, GFP_NOFS);
576576
if (!ls->ls_recover_buf)
577577
goto out_lkbidr;
578578

fs/dlm/lowcomms.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,9 +1556,9 @@ struct dlm_msg *dlm_lowcomms_new_msg(int nodeid, int len, gfp_t allocation,
15561556
struct dlm_msg *msg;
15571557
int idx;
15581558

1559-
if (len > DEFAULT_BUFFER_SIZE ||
1559+
if (len > DLM_MAX_SOCKET_BUFSIZE ||
15601560
len < sizeof(struct dlm_header)) {
1561-
BUILD_BUG_ON(PAGE_SIZE < DEFAULT_BUFFER_SIZE);
1561+
BUILD_BUG_ON(PAGE_SIZE < DLM_MAX_SOCKET_BUFSIZE);
15621562
log_print("failed to allocate a buffer of size %d", len);
15631563
WARN_ON(1);
15641564
return NULL;

fs/dlm/lowcomms.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "dlm_internal.h"
1616

1717
#define DLM_MIDCOMMS_OPT_LEN sizeof(struct dlm_opts)
18-
#define LOWCOMMS_MAX_TX_BUFFER_LEN (DEFAULT_BUFFER_SIZE - \
18+
#define DLM_MAX_APP_BUFSIZE (DLM_MAX_SOCKET_BUFSIZE - \
1919
DLM_MIDCOMMS_OPT_LEN)
2020

2121
#define CONN_HASH_SIZE 32

fs/dlm/member.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ int dlm_slots_assign(struct dlm_ls *ls, int *num_slots, int *slots_size,
271271

272272
log_slots(ls, gen, num, NULL, array, array_size);
273273

274-
max_slots = (LOWCOMMS_MAX_TX_BUFFER_LEN - sizeof(struct dlm_rcom) -
274+
max_slots = (DLM_MAX_APP_BUFSIZE - sizeof(struct dlm_rcom) -
275275
sizeof(struct rcom_config)) / sizeof(struct rcom_slot);
276276

277277
if (num > max_slots) {

fs/dlm/midcomms.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ int dlm_process_incoming_buffer(int nodeid, unsigned char *buf, int len)
865865
while (len >= sizeof(struct dlm_header)) {
866866
hd = (struct dlm_header *)ptr;
867867

868-
/* no message should be more than DEFAULT_BUFFER_SIZE or
868+
/* no message should be more than DLM_MAX_SOCKET_BUFSIZE or
869869
* less than dlm_header size.
870870
*
871871
* Some messages does not have a 8 byte length boundary yet
@@ -877,7 +877,7 @@ int dlm_process_incoming_buffer(int nodeid, unsigned char *buf, int len)
877877
* the next major version bump.
878878
*/
879879
msglen = le16_to_cpu(hd->h_length);
880-
if (msglen > DEFAULT_BUFFER_SIZE ||
880+
if (msglen > DLM_MAX_SOCKET_BUFSIZE ||
881881
msglen < sizeof(struct dlm_header)) {
882882
log_print("received invalid length header: %u from node %d, will abort message parsing",
883883
msglen, nodeid);

fs/dlm/rcom.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ int dlm_rcom_status(struct dlm_ls *ls, int nodeid, uint32_t status_flags)
202202
set_rcom_status(ls, (struct rcom_status *)rc->rc_buf, status_flags);
203203

204204
allow_sync_reply(ls, &rc->rc_id);
205-
memset(ls->ls_recover_buf, 0, DEFAULT_BUFFER_SIZE);
205+
memset(ls->ls_recover_buf, 0, DLM_MAX_SOCKET_BUFSIZE);
206206

207207
send_rcom_stateless(ls, msg, rc);
208208

@@ -325,7 +325,7 @@ int dlm_rcom_names(struct dlm_ls *ls, int nodeid, char *last_name, int last_len)
325325
memcpy(rc->rc_buf, last_name, last_len);
326326

327327
allow_sync_reply(ls, &rc->rc_id);
328-
memset(ls->ls_recover_buf, 0, DEFAULT_BUFFER_SIZE);
328+
memset(ls->ls_recover_buf, 0, DLM_MAX_SOCKET_BUFSIZE);
329329

330330
send_rcom_stateless(ls, msg, rc);
331331

@@ -345,7 +345,7 @@ static void receive_rcom_names(struct dlm_ls *ls, struct dlm_rcom *rc_in)
345345

346346
nodeid = rc_in->rc_header.h_nodeid;
347347
inlen = rc_in->rc_header.h_length - sizeof(struct dlm_rcom);
348-
outlen = LOWCOMMS_MAX_TX_BUFFER_LEN - sizeof(struct dlm_rcom);
348+
outlen = DLM_MAX_APP_BUFSIZE - sizeof(struct dlm_rcom);
349349

350350
error = create_rcom_stateless(ls, nodeid, DLM_RCOM_NAMES_REPLY, outlen,
351351
&rc, &msg);

0 commit comments

Comments
 (0)