diff options
author | Sage Weil <sage@inktank.com> | 2012-06-21 15:49:23 -0400 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2012-06-22 09:13:45 -0400 |
commit | d59315ca8c0de00df9b363f94a2641a30961ca1c (patch) | |
tree | b2e8a2fe8633d6ac194d41e08a8c854719a6fb23 /net/ceph/messenger.c | |
parent | 36eb71aa57e6a33d61fd90a2fd87f00c6844bc86 (diff) |
libceph: drop ceph_con_get/put helpers and nref member
These are no longer used. Every ceph_connection instance is embedded in
another structure, and refcounts manipulated via the get/put ops.
Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph/messenger.c')
-rw-r--r-- | net/ceph/messenger.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index fc0cee7c9aa2..ab690e2e1206 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -501,30 +501,6 @@ bool ceph_con_opened(struct ceph_connection *con) | |||
501 | } | 501 | } |
502 | 502 | ||
503 | /* | 503 | /* |
504 | * generic get/put | ||
505 | */ | ||
506 | struct ceph_connection *ceph_con_get(struct ceph_connection *con) | ||
507 | { | ||
508 | int nref = __atomic_add_unless(&con->nref, 1, 0); | ||
509 | |||
510 | dout("con_get %p nref = %d -> %d\n", con, nref, nref + 1); | ||
511 | |||
512 | return nref ? con : NULL; | ||
513 | } | ||
514 | |||
515 | void ceph_con_put(struct ceph_connection *con) | ||
516 | { | ||
517 | int nref = atomic_dec_return(&con->nref); | ||
518 | |||
519 | BUG_ON(nref < 0); | ||
520 | if (nref == 0) { | ||
521 | BUG_ON(con->sock); | ||
522 | kfree(con); | ||
523 | } | ||
524 | dout("con_put %p nref = %d -> %d\n", con, nref + 1, nref); | ||
525 | } | ||
526 | |||
527 | /* | ||
528 | * initialize a new connection. | 504 | * initialize a new connection. |
529 | */ | 505 | */ |
530 | void ceph_con_init(struct ceph_connection *con, void *private, | 506 | void ceph_con_init(struct ceph_connection *con, void *private, |
@@ -535,7 +511,6 @@ void ceph_con_init(struct ceph_connection *con, void *private, | |||
535 | memset(con, 0, sizeof(*con)); | 511 | memset(con, 0, sizeof(*con)); |
536 | con->private = private; | 512 | con->private = private; |
537 | con->ops = ops; | 513 | con->ops = ops; |
538 | atomic_set(&con->nref, 1); | ||
539 | con->msgr = msgr; | 514 | con->msgr = msgr; |
540 | 515 | ||
541 | con_sock_state_init(con); | 516 | con_sock_state_init(con); |
@@ -1951,8 +1926,7 @@ static int try_write(struct ceph_connection *con) | |||
1951 | { | 1926 | { |
1952 | int ret = 1; | 1927 | int ret = 1; |
1953 | 1928 | ||
1954 | dout("try_write start %p state %lu nref %d\n", con, con->state, | 1929 | dout("try_write start %p state %lu\n", con, con->state); |
1955 | atomic_read(&con->nref)); | ||
1956 | 1930 | ||
1957 | more: | 1931 | more: |
1958 | dout("try_write out_kvec_bytes %d\n", con->out_kvec_bytes); | 1932 | dout("try_write out_kvec_bytes %d\n", con->out_kvec_bytes); |