Commit d10a0b88 authored by Alexander Aring's avatar Alexander Aring Committed by David Teigland
Browse files

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: default avatarAlexander Aring <aahringo@redhat.com>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent ac7d5d03
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ static int dlm_check_zero(unsigned int x)

static int dlm_check_buffer_size(unsigned int x)
{
	if (x < DEFAULT_BUFFER_SIZE)
	if (x < DLM_MAX_SOCKET_BUFSIZE)
		return -EINVAL;

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

struct dlm_config_info dlm_config = {
	.ci_tcp_port = DEFAULT_TCP_PORT,
	.ci_buffer_size = DEFAULT_BUFFER_SIZE,
	.ci_buffer_size = DLM_MAX_SOCKET_BUFSIZE,
	.ci_rsbtbl_size = DEFAULT_RSBTBL_SIZE,
	.ci_recover_timer = DEFAULT_RECOVER_TIMER,
	.ci_toss_secs = DEFAULT_TOSS_SECS,
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
#ifndef __CONFIG_DOT_H__
#define __CONFIG_DOT_H__

#define DEFAULT_BUFFER_SIZE     4096
#define DLM_MAX_SOCKET_BUFSIZE	4096

struct dlm_config_node {
	int nodeid;
+1 −1
Original line number Diff line number Diff line
@@ -572,7 +572,7 @@ static int new_lockspace(const char *name, const char *cluster,
	 * not having out of bounds issues. However on sending side 3.2
	 * might send less.
	 */
	ls->ls_recover_buf = kmalloc(DEFAULT_BUFFER_SIZE, GFP_NOFS);
	ls->ls_recover_buf = kmalloc(DLM_MAX_SOCKET_BUFSIZE, GFP_NOFS);
	if (!ls->ls_recover_buf)
		goto out_lkbidr;

+2 −2
Original line number Diff line number Diff line
@@ -1556,9 +1556,9 @@ struct dlm_msg *dlm_lowcomms_new_msg(int nodeid, int len, gfp_t allocation,
	struct dlm_msg *msg;
	int idx;

	if (len > DEFAULT_BUFFER_SIZE ||
	if (len > DLM_MAX_SOCKET_BUFSIZE ||
	    len < sizeof(struct dlm_header)) {
		BUILD_BUG_ON(PAGE_SIZE < DEFAULT_BUFFER_SIZE);
		BUILD_BUG_ON(PAGE_SIZE < DLM_MAX_SOCKET_BUFSIZE);
		log_print("failed to allocate a buffer of size %d", len);
		WARN_ON(1);
		return NULL;
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
#include "dlm_internal.h"

#define DLM_MIDCOMMS_OPT_LEN		sizeof(struct dlm_opts)
#define LOWCOMMS_MAX_TX_BUFFER_LEN	(DEFAULT_BUFFER_SIZE - \
#define DLM_MAX_APP_BUFSIZE		(DLM_MAX_SOCKET_BUFSIZE - \
					 DLM_MIDCOMMS_OPT_LEN)

#define CONN_HASH_SIZE 32
Loading