diff options
Diffstat (limited to 'fs/lockd/svclock.c')
-rw-r--r-- | fs/lockd/svclock.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index ef5659b211e9..6e31695d046f 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c | |||
@@ -46,6 +46,7 @@ static void nlmsvc_remove_block(struct nlm_block *block); | |||
46 | static int nlmsvc_setgrantargs(struct nlm_rqst *call, struct nlm_lock *lock); | 46 | static int nlmsvc_setgrantargs(struct nlm_rqst *call, struct nlm_lock *lock); |
47 | static void nlmsvc_freegrantargs(struct nlm_rqst *call); | 47 | static void nlmsvc_freegrantargs(struct nlm_rqst *call); |
48 | static const struct rpc_call_ops nlmsvc_grant_ops; | 48 | static const struct rpc_call_ops nlmsvc_grant_ops; |
49 | static const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie); | ||
49 | 50 | ||
50 | /* | 51 | /* |
51 | * The list of blocked locks to retry | 52 | * The list of blocked locks to retry |
@@ -233,7 +234,7 @@ nlmsvc_create_block(struct svc_rqst *rqstp, struct nlm_host *host, | |||
233 | failed_free: | 234 | failed_free: |
234 | kfree(block); | 235 | kfree(block); |
235 | failed: | 236 | failed: |
236 | nlm_release_call(call); | 237 | nlmsvc_release_call(call); |
237 | return NULL; | 238 | return NULL; |
238 | } | 239 | } |
239 | 240 | ||
@@ -266,7 +267,7 @@ static void nlmsvc_free_block(struct kref *kref) | |||
266 | mutex_unlock(&file->f_mutex); | 267 | mutex_unlock(&file->f_mutex); |
267 | 268 | ||
268 | nlmsvc_freegrantargs(block->b_call); | 269 | nlmsvc_freegrantargs(block->b_call); |
269 | nlm_release_call(block->b_call); | 270 | nlmsvc_release_call(block->b_call); |
270 | nlm_release_file(block->b_file); | 271 | nlm_release_file(block->b_file); |
271 | kfree(block->b_fl); | 272 | kfree(block->b_fl); |
272 | kfree(block); | 273 | kfree(block); |
@@ -934,3 +935,32 @@ nlmsvc_retry_blocked(void) | |||
934 | 935 | ||
935 | return timeout; | 936 | return timeout; |
936 | } | 937 | } |
938 | |||
939 | #ifdef RPC_DEBUG | ||
940 | static const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie) | ||
941 | { | ||
942 | /* | ||
943 | * We can get away with a static buffer because we're only | ||
944 | * called with BKL held. | ||
945 | */ | ||
946 | static char buf[2*NLM_MAXCOOKIELEN+1]; | ||
947 | unsigned int i, len = sizeof(buf); | ||
948 | char *p = buf; | ||
949 | |||
950 | len--; /* allow for trailing \0 */ | ||
951 | if (len < 3) | ||
952 | return "???"; | ||
953 | for (i = 0 ; i < cookie->len ; i++) { | ||
954 | if (len < 2) { | ||
955 | strcpy(p-3, "..."); | ||
956 | break; | ||
957 | } | ||
958 | sprintf(p, "%02x", cookie->data[i]); | ||
959 | p += 2; | ||
960 | len -= 2; | ||
961 | } | ||
962 | *p = '\0'; | ||
963 | |||
964 | return buf; | ||
965 | } | ||
966 | #endif | ||