Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46285
b: refs/heads/master
c: 68c817a
h: refs/heads/master
i:
  46283: b1948fc
v: v3
  • Loading branch information
David Teigland authored and Steven Whitehouse committed Feb 5, 2007
1 parent 38ce3c6 commit fce4241
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 38 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ec6886748443bec53ce9b9bf50cec92bc417a1b
refs/heads/master: 68c817a1c4e21b893672ac73d8a498e6647453aa
16 changes: 8 additions & 8 deletions trunk/fs/dlm/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,13 +777,13 @@ int dlm_our_addr(struct sockaddr_storage *addr, int num)
#define DEFAULT_SCAN_SECS 5

struct dlm_config_info dlm_config = {
.tcp_port = DEFAULT_TCP_PORT,
.buffer_size = DEFAULT_BUFFER_SIZE,
.rsbtbl_size = DEFAULT_RSBTBL_SIZE,
.lkbtbl_size = DEFAULT_LKBTBL_SIZE,
.dirtbl_size = DEFAULT_DIRTBL_SIZE,
.recover_timer = DEFAULT_RECOVER_TIMER,
.toss_secs = DEFAULT_TOSS_SECS,
.scan_secs = DEFAULT_SCAN_SECS
.ci_tcp_port = DEFAULT_TCP_PORT,
.ci_buffer_size = DEFAULT_BUFFER_SIZE,
.ci_rsbtbl_size = DEFAULT_RSBTBL_SIZE,
.ci_lkbtbl_size = DEFAULT_LKBTBL_SIZE,
.ci_dirtbl_size = DEFAULT_DIRTBL_SIZE,
.ci_recover_timer = DEFAULT_RECOVER_TIMER,
.ci_toss_secs = DEFAULT_TOSS_SECS,
.ci_scan_secs = DEFAULT_SCAN_SECS
};

16 changes: 8 additions & 8 deletions trunk/fs/dlm/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
#define DLM_MAX_ADDR_COUNT 3

struct dlm_config_info {
int tcp_port;
int buffer_size;
int rsbtbl_size;
int lkbtbl_size;
int dirtbl_size;
int recover_timer;
int toss_secs;
int scan_secs;
int ci_tcp_port;
int ci_buffer_size;
int ci_rsbtbl_size;
int ci_lkbtbl_size;
int ci_dirtbl_size;
int ci_recover_timer;
int ci_toss_secs;
int ci_scan_secs;
};

extern struct dlm_config_info dlm_config;
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/dlm/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ static int shrink_bucket(struct dlm_ls *ls, int b)
list_for_each_entry_reverse(r, &ls->ls_rsbtbl[b].toss,
res_hashchain) {
if (!time_after_eq(jiffies, r->res_toss_time +
dlm_config.toss_secs * HZ))
dlm_config.ci_toss_secs * HZ))
continue;
found = 1;
break;
Expand Down
10 changes: 5 additions & 5 deletions trunk/fs/dlm/lockspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static int dlm_scand(void *data)
while (!kthread_should_stop()) {
list_for_each_entry(ls, &lslist, ls_list)
dlm_scan_rsbs(ls);
schedule_timeout_interruptible(dlm_config.scan_secs * HZ);
schedule_timeout_interruptible(dlm_config.ci_scan_secs * HZ);
}
return 0;
}
Expand Down Expand Up @@ -422,7 +422,7 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
ls->ls_count = 0;
ls->ls_flags = 0;

size = dlm_config.rsbtbl_size;
size = dlm_config.ci_rsbtbl_size;
ls->ls_rsbtbl_size = size;

ls->ls_rsbtbl = kmalloc(sizeof(struct dlm_rsbtable) * size, GFP_KERNEL);
Expand All @@ -434,7 +434,7 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
rwlock_init(&ls->ls_rsbtbl[i].lock);
}

size = dlm_config.lkbtbl_size;
size = dlm_config.ci_lkbtbl_size;
ls->ls_lkbtbl_size = size;

ls->ls_lkbtbl = kmalloc(sizeof(struct dlm_lkbtable) * size, GFP_KERNEL);
Expand All @@ -446,7 +446,7 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
ls->ls_lkbtbl[i].counter = 1;
}

size = dlm_config.dirtbl_size;
size = dlm_config.ci_dirtbl_size;
ls->ls_dirtbl_size = size;

ls->ls_dirtbl = kmalloc(sizeof(struct dlm_dirtable) * size, GFP_KERNEL);
Expand Down Expand Up @@ -489,7 +489,7 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
mutex_init(&ls->ls_requestqueue_mutex);
mutex_init(&ls->ls_clear_proc_locks);

ls->ls_recover_buf = kmalloc(dlm_config.buffer_size, GFP_KERNEL);
ls->ls_recover_buf = kmalloc(dlm_config.ci_buffer_size, GFP_KERNEL);
if (!ls->ls_recover_buf)
goto out_dirfree;

Expand Down
6 changes: 3 additions & 3 deletions trunk/fs/dlm/lowcomms-sctp.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ static int add_bind_addr(struct sockaddr_storage *addr, int addr_len, int num)

if (result < 0)
log_print("Can't bind to port %d addr number %d",
dlm_config.tcp_port, num);
dlm_config.ci_tcp_port, num);

return result;
}
Expand Down Expand Up @@ -711,7 +711,7 @@ static int init_sock(void)
/* Bind to all interfaces. */
for (i = 0; i < dlm_local_count; i++) {
memcpy(&localaddr, dlm_local_addr[i], sizeof(localaddr));
make_sockaddr(&localaddr, dlm_config.tcp_port, &addr_len);
make_sockaddr(&localaddr, dlm_config.ci_tcp_port, &addr_len);

result = add_bind_addr(&localaddr, addr_len, num);
if (result)
Expand Down Expand Up @@ -863,7 +863,7 @@ static void initiate_association(int nodeid)
return;
}

make_sockaddr(&rem_addr, dlm_config.tcp_port, &addrlen);
make_sockaddr(&rem_addr, dlm_config.ci_tcp_port, &addrlen);

outmessage.msg_name = &rem_addr;
outmessage.msg_namelen = addrlen;
Expand Down
9 changes: 5 additions & 4 deletions trunk/fs/dlm/lowcomms-tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ static void connect_to_sock(struct connection *con)
sock->sk->sk_user_data = con;
con->rx_action = receive_from_sock;

make_sockaddr(&saddr, dlm_config.tcp_port, &addr_len);
make_sockaddr(&saddr, dlm_config.ci_tcp_port, &addr_len);

add_sock(sock, con);

Expand Down Expand Up @@ -616,10 +616,10 @@ static struct socket *create_listen_sock(struct connection *con,
con->sock = sock;

/* Bind to our port */
make_sockaddr(saddr, dlm_config.tcp_port, &addr_len);
make_sockaddr(saddr, dlm_config.ci_tcp_port, &addr_len);
result = sock->ops->bind(sock, (struct sockaddr *) saddr, addr_len);
if (result < 0) {
printk("dlm: Can't bind to port %d\n", dlm_config.tcp_port);
printk("dlm: Can't bind to port %d\n", dlm_config.ci_tcp_port);
sock_release(sock);
sock = NULL;
con->sock = NULL;
Expand All @@ -638,7 +638,8 @@ static struct socket *create_listen_sock(struct connection *con,

result = sock->ops->listen(sock, 5);
if (result < 0) {
printk("dlm: Can't listen on port %d\n", dlm_config.tcp_port);
printk("dlm: Can't listen on port %d\n",
dlm_config.ci_tcp_port);
sock_release(sock);
sock = NULL;
goto create_out;
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/dlm/midcomms.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ int dlm_process_incoming_buffer(int nodeid, const void *base,
if (msglen < sizeof(struct dlm_header))
break;
err = -E2BIG;
if (msglen > dlm_config.buffer_size) {
if (msglen > dlm_config.ci_buffer_size) {
log_print("message size %d from %d too big, buf len %d",
msglen, nodeid, len);
break;
Expand All @@ -103,7 +103,7 @@ int dlm_process_incoming_buffer(int nodeid, const void *base,

if (msglen > sizeof(__tmp) &&
msg == (struct dlm_header *) __tmp) {
msg = kmalloc(dlm_config.buffer_size, GFP_KERNEL);
msg = kmalloc(dlm_config.ci_buffer_size, GFP_KERNEL);
if (msg == NULL)
return ret;
}
Expand Down
8 changes: 4 additions & 4 deletions trunk/fs/dlm/rcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ int dlm_rcom_status(struct dlm_ls *ls, int nodeid)
goto out;

allow_sync_reply(ls, &rc->rc_id);
memset(ls->ls_recover_buf, 0, dlm_config.buffer_size);
memset(ls->ls_recover_buf, 0, dlm_config.ci_buffer_size);

send_rcom(ls, mh, rc);

Expand Down Expand Up @@ -213,7 +213,7 @@ int dlm_rcom_names(struct dlm_ls *ls, int nodeid, char *last_name, int last_len)
if (nodeid == dlm_our_nodeid()) {
dlm_copy_master_names(ls, last_name, last_len,
ls->ls_recover_buf + len,
dlm_config.buffer_size - len, nodeid);
dlm_config.ci_buffer_size - len, nodeid);
goto out;
}

Expand All @@ -223,7 +223,7 @@ int dlm_rcom_names(struct dlm_ls *ls, int nodeid, char *last_name, int last_len)
memcpy(rc->rc_buf, last_name, last_len);

allow_sync_reply(ls, &rc->rc_id);
memset(ls->ls_recover_buf, 0, dlm_config.buffer_size);
memset(ls->ls_recover_buf, 0, dlm_config.ci_buffer_size);

send_rcom(ls, mh, rc);

Expand All @@ -241,7 +241,7 @@ static void receive_rcom_names(struct dlm_ls *ls, struct dlm_rcom *rc_in)

nodeid = rc_in->rc_header.h_nodeid;
inlen = rc_in->rc_header.h_length - sizeof(struct dlm_rcom);
outlen = dlm_config.buffer_size - sizeof(struct dlm_rcom);
outlen = dlm_config.ci_buffer_size - sizeof(struct dlm_rcom);

error = create_rcom(ls, nodeid, DLM_RCOM_NAMES_REPLY, outlen, &rc, &mh);
if (error)
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/dlm/recover.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
static void dlm_wait_timer_fn(unsigned long data)
{
struct dlm_ls *ls = (struct dlm_ls *) data;
mod_timer(&ls->ls_timer, jiffies + (dlm_config.recover_timer * HZ));
mod_timer(&ls->ls_timer, jiffies + (dlm_config.ci_recover_timer * HZ));
wake_up(&ls->ls_wait_general);
}

Expand All @@ -55,7 +55,7 @@ int dlm_wait_function(struct dlm_ls *ls, int (*testfn) (struct dlm_ls *ls))
init_timer(&ls->ls_timer);
ls->ls_timer.function = dlm_wait_timer_fn;
ls->ls_timer.data = (long) ls;
ls->ls_timer.expires = jiffies + (dlm_config.recover_timer * HZ);
ls->ls_timer.expires = jiffies + (dlm_config.ci_recover_timer * HZ);
add_timer(&ls->ls_timer);

wait_event(ls->ls_wait_general, testfn(ls) || dlm_recovery_stopped(ls));
Expand Down

0 comments on commit fce4241

Please sign in to comment.