Commit 8f998915 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

[PATCH] remove useless MOD_{INC,DEC}_USE_COUNT from sunrpc

 - both rpciod_up and rpciod_down do a gratious inc/dec of the
   use count - but we can't ever be inside those function unless
   it's called from an other module -> totally useless
 - rpciod() (the kernel thread) also bumps the refcount when starting
   and decrements it when exiting.  but as a different module must
   initiate this using rpciod_up/rpciod_down this is again not needed.
   (except when a module does rpciod_up without a matching rpciod_down -
   but that a big bug anyway and we don't need to partially handle that
   using module refcounts).
parent f09d418d
...@@ -952,7 +952,6 @@ rpciod(void *ptr) ...@@ -952,7 +952,6 @@ rpciod(void *ptr)
wait_queue_head_t *assassin = (wait_queue_head_t*) ptr; wait_queue_head_t *assassin = (wait_queue_head_t*) ptr;
int rounds = 0; int rounds = 0;
MOD_INC_USE_COUNT;
lock_kernel(); lock_kernel();
/* /*
* Let our maker know we're running ... * Let our maker know we're running ...
...@@ -995,7 +994,6 @@ rpciod(void *ptr) ...@@ -995,7 +994,6 @@ rpciod(void *ptr)
dprintk("RPC: rpciod exiting\n"); dprintk("RPC: rpciod exiting\n");
unlock_kernel(); unlock_kernel();
MOD_DEC_USE_COUNT;
return 0; return 0;
} }
...@@ -1027,7 +1025,6 @@ rpciod_up(void) ...@@ -1027,7 +1025,6 @@ rpciod_up(void)
{ {
int error = 0; int error = 0;
MOD_INC_USE_COUNT;
down(&rpciod_sema); down(&rpciod_sema);
dprintk("rpciod_up: pid %d, users %d\n", rpciod_pid, rpciod_users); dprintk("rpciod_up: pid %d, users %d\n", rpciod_pid, rpciod_users);
rpciod_users++; rpciod_users++;
...@@ -1051,7 +1048,6 @@ rpciod_up(void) ...@@ -1051,7 +1048,6 @@ rpciod_up(void)
error = 0; error = 0;
out: out:
up(&rpciod_sema); up(&rpciod_sema);
MOD_DEC_USE_COUNT;
return error; return error;
} }
...@@ -1060,7 +1056,6 @@ rpciod_down(void) ...@@ -1060,7 +1056,6 @@ rpciod_down(void)
{ {
unsigned long flags; unsigned long flags;
MOD_INC_USE_COUNT;
down(&rpciod_sema); down(&rpciod_sema);
dprintk("rpciod_down pid %d sema %d\n", rpciod_pid, rpciod_users); dprintk("rpciod_down pid %d sema %d\n", rpciod_pid, rpciod_users);
if (rpciod_users) { if (rpciod_users) {
...@@ -1097,7 +1092,6 @@ rpciod_down(void) ...@@ -1097,7 +1092,6 @@ rpciod_down(void)
spin_unlock_irqrestore(&current->sighand->siglock, flags); spin_unlock_irqrestore(&current->sighand->siglock, flags);
out: out:
up(&rpciod_sema); up(&rpciod_sema);
MOD_DEC_USE_COUNT;
} }
#ifdef RPC_DEBUG #ifdef RPC_DEBUG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment