Skip to content

Commit

Permalink
SUNRPC: fix print format for tk_pid
Browse files Browse the repository at this point in the history
The tk_pid field is an unsigned short.  The proper print format specifier for
that type is %5u, not %4d.

Also clean up some miscellaneous print formatting nits.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Feb 3, 2007
1 parent 8885cb3 commit 46121cf
Show file tree
Hide file tree
Showing 10 changed files with 228 additions and 198 deletions.
25 changes: 13 additions & 12 deletions net/sunrpc/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ rpcauth_gc_credcache(struct rpc_auth *auth, struct hlist_head *free)
struct rpc_cred *cred;
int i;

dprintk("RPC: gc'ing RPC credentials for auth %p\n", auth);
dprintk("RPC: gc'ing RPC credentials for auth %p\n", auth);
for (i = 0; i < RPC_CREDCACHE_NR; i++) {
hlist_for_each_safe(pos, next, &cache->hashtable[i]) {
cred = hlist_entry(pos, struct rpc_cred, cr_hash);
Expand Down Expand Up @@ -267,7 +267,7 @@ rpcauth_lookupcred(struct rpc_auth *auth, int flags)
};
struct rpc_cred *ret;

dprintk("RPC: looking up %s cred\n",
dprintk("RPC: looking up %s cred\n",
auth->au_ops->au_name);
get_group_info(acred.group_info);
ret = auth->au_ops->lookup_cred(auth, &acred, flags);
Expand All @@ -287,7 +287,7 @@ rpcauth_bindcred(struct rpc_task *task)
struct rpc_cred *ret;
int flags = 0;

dprintk("RPC: %4d looking up %s cred\n",
dprintk("RPC: %5u looking up %s cred\n",
task->tk_pid, task->tk_auth->au_ops->au_name);
get_group_info(acred.group_info);
if (task->tk_flags & RPC_TASK_ROOTCREDS)
Expand All @@ -304,8 +304,9 @@ rpcauth_bindcred(struct rpc_task *task)
void
rpcauth_holdcred(struct rpc_task *task)
{
dprintk("RPC: %4d holding %s cred %p\n",
task->tk_pid, task->tk_auth->au_ops->au_name, task->tk_msg.rpc_cred);
dprintk("RPC: %5u holding %s cred %p\n",
task->tk_pid, task->tk_auth->au_ops->au_name,
task->tk_msg.rpc_cred);
if (task->tk_msg.rpc_cred)
get_rpccred(task->tk_msg.rpc_cred);
}
Expand All @@ -324,7 +325,7 @@ rpcauth_unbindcred(struct rpc_task *task)
{
struct rpc_cred *cred = task->tk_msg.rpc_cred;

dprintk("RPC: %4d releasing %s cred %p\n",
dprintk("RPC: %5u releasing %s cred %p\n",
task->tk_pid, task->tk_auth->au_ops->au_name, cred);

put_rpccred(cred);
Expand All @@ -336,7 +337,7 @@ rpcauth_marshcred(struct rpc_task *task, __be32 *p)
{
struct rpc_cred *cred = task->tk_msg.rpc_cred;

dprintk("RPC: %4d marshaling %s cred %p\n",
dprintk("RPC: %5u marshaling %s cred %p\n",
task->tk_pid, task->tk_auth->au_ops->au_name, cred);

return cred->cr_ops->crmarshal(task, p);
Expand All @@ -347,7 +348,7 @@ rpcauth_checkverf(struct rpc_task *task, __be32 *p)
{
struct rpc_cred *cred = task->tk_msg.rpc_cred;

dprintk("RPC: %4d validating %s cred %p\n",
dprintk("RPC: %5u validating %s cred %p\n",
task->tk_pid, task->tk_auth->au_ops->au_name, cred);

return cred->cr_ops->crvalidate(task, p);
Expand All @@ -359,7 +360,7 @@ rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp,
{
struct rpc_cred *cred = task->tk_msg.rpc_cred;

dprintk("RPC: %4d using %s cred %p to wrap rpc data\n",
dprintk("RPC: %5u using %s cred %p to wrap rpc data\n",
task->tk_pid, cred->cr_ops->cr_name, cred);
if (cred->cr_ops->crwrap_req)
return cred->cr_ops->crwrap_req(task, encode, rqstp, data, obj);
Expand All @@ -373,7 +374,7 @@ rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp,
{
struct rpc_cred *cred = task->tk_msg.rpc_cred;

dprintk("RPC: %4d using %s cred %p to unwrap rpc data\n",
dprintk("RPC: %5u using %s cred %p to unwrap rpc data\n",
task->tk_pid, cred->cr_ops->cr_name, cred);
if (cred->cr_ops->crunwrap_resp)
return cred->cr_ops->crunwrap_resp(task, decode, rqstp,
Expand All @@ -388,7 +389,7 @@ rpcauth_refreshcred(struct rpc_task *task)
struct rpc_cred *cred = task->tk_msg.rpc_cred;
int err;

dprintk("RPC: %4d refreshing %s cred %p\n",
dprintk("RPC: %5u refreshing %s cred %p\n",
task->tk_pid, task->tk_auth->au_ops->au_name, cred);

err = cred->cr_ops->crrefresh(task);
Expand All @@ -400,7 +401,7 @@ rpcauth_refreshcred(struct rpc_task *task)
void
rpcauth_invalcred(struct rpc_task *task)
{
dprintk("RPC: %4d invalidating %s cred %p\n",
dprintk("RPC: %5u invalidating %s cred %p\n",
task->tk_pid, task->tk_auth->au_ops->au_name, task->tk_msg.rpc_cred);
spin_lock(&rpc_credcache_lock);
if (task->tk_msg.rpc_cred)
Expand Down
9 changes: 5 additions & 4 deletions net/sunrpc/auth_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ static struct rpc_credops unix_credops;
static struct rpc_auth *
unx_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
{
dprintk("RPC: creating UNIX authenticator for client %p\n", clnt);
dprintk("RPC: creating UNIX authenticator for client %p\n",
clnt);
if (atomic_inc_return(&unix_auth.au_count) == 0)
unix_cred_cache.nextgc = jiffies + (unix_cred_cache.expire >> 1);
return &unix_auth;
Expand All @@ -48,7 +49,7 @@ unx_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
static void
unx_destroy(struct rpc_auth *auth)
{
dprintk("RPC: destroying UNIX authenticator %p\n", auth);
dprintk("RPC: destroying UNIX authenticator %p\n", auth);
rpcauth_free_credcache(auth);
}

Expand All @@ -67,8 +68,8 @@ unx_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
struct unx_cred *cred;
int i;

dprintk("RPC: allocating UNIX cred for uid %d gid %d\n",
acred->uid, acred->gid);
dprintk("RPC: allocating UNIX cred for uid %d gid %d\n",
acred->uid, acred->gid);

if (!(cred = kmalloc(sizeof(*cred), GFP_KERNEL)))
return ERR_PTR(-ENOMEM);
Expand Down
3 changes: 2 additions & 1 deletion net/sunrpc/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ int cache_check(struct cache_detail *detail,
if (rv == -EAGAIN)
rv = -ENOENT;
} else if (rv == -EAGAIN || age > refresh_age/2) {
dprintk("Want update, refage=%ld, age=%ld\n", refresh_age, age);
dprintk("RPC: Want update, refage=%ld, age=%ld\n",
refresh_age, age);
if (!test_and_set_bit(CACHE_PENDING, &h->flags)) {
switch (cache_make_upcall(detail, h)) {
case -EINVAL:
Expand Down
Loading

0 comments on commit 46121cf

Please sign in to comment.