]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] remove useless MOD_{INC,DEC}_USE_COUNT from sunrpc
authorChristoph Hellwig <hch@lst.de>
Sun, 4 May 2003 04:03:06 +0000 (21:03 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sun, 4 May 2003 04:03:06 +0000 (21:03 -0700)
 - 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).

net/sunrpc/sched.c

index 1cc8c2fedd40d97ee7327c0922f0c560b75be264..98e7c57c7e2fa8156ef0ad092b178147e27d096f 100644 (file)
@@ -952,7 +952,6 @@ rpciod(void *ptr)
        wait_queue_head_t *assassin = (wait_queue_head_t*) ptr;
        int             rounds = 0;
 
-       MOD_INC_USE_COUNT;
        lock_kernel();
        /*
         * Let our maker know we're running ...
@@ -995,7 +994,6 @@ rpciod(void *ptr)
 
        dprintk("RPC: rpciod exiting\n");
        unlock_kernel();
-       MOD_DEC_USE_COUNT;
        return 0;
 }
 
@@ -1027,7 +1025,6 @@ rpciod_up(void)
 {
        int error = 0;
 
-       MOD_INC_USE_COUNT;
        down(&rpciod_sema);
        dprintk("rpciod_up: pid %d, users %d\n", rpciod_pid, rpciod_users);
        rpciod_users++;
@@ -1051,7 +1048,6 @@ rpciod_up(void)
        error = 0;
 out:
        up(&rpciod_sema);
-       MOD_DEC_USE_COUNT;
        return error;
 }
 
@@ -1060,7 +1056,6 @@ rpciod_down(void)
 {
        unsigned long flags;
 
-       MOD_INC_USE_COUNT;
        down(&rpciod_sema);
        dprintk("rpciod_down pid %d sema %d\n", rpciod_pid, rpciod_users);
        if (rpciod_users) {
@@ -1097,7 +1092,6 @@ rpciod_down(void)
        spin_unlock_irqrestore(&current->sighand->siglock, flags);
 out:
        up(&rpciod_sema);
-       MOD_DEC_USE_COUNT;
 }
 
 #ifdef RPC_DEBUG