Fix configfs leak
[safe/jmp/linux-2.6] / fs / coda / upcall.c
index e4e766e..c274d94 100644 (file)
@@ -51,13 +51,9 @@ static void *alloc_upcall(int opcode, int size)
 
         inp->ih.opcode = opcode;
        inp->ih.pid = current->pid;
-       inp->ih.pgid = process_group(current);
-#ifdef CONFIG_CODA_FS_OLD_API
-       memset(&inp->ih.cred, 0, sizeof(struct coda_cred));
-       inp->ih.cred.cr_fsuid = current->fsuid;
-#else
-       inp->ih.uid = current->fsuid;
-#endif
+       inp->ih.pgid = task_pgrp_nr(current);
+       inp->ih.uid = current_fsuid();
+
        return (void*)inp;
 }
 
@@ -160,73 +156,17 @@ int venus_lookup(struct super_block *sb, struct CodaFid *fid,
        return error;
 }
 
-int venus_store(struct super_block *sb, struct CodaFid *fid, int flags,
-                vuid_t uid)
-{
-        union inputArgs *inp;
-        union outputArgs *outp;
-        int insize, outsize, error;
-#ifdef CONFIG_CODA_FS_OLD_API
-       struct coda_cred cred = { 0, };
-       cred.cr_fsuid = uid;
-#endif
-       
-       insize = SIZE(store);
-       UPARG(CODA_STORE);
-       
-#ifdef CONFIG_CODA_FS_OLD_API
-       memcpy(&(inp->ih.cred), &cred, sizeof(cred));
-#else
-       inp->ih.uid = uid;
-#endif
-       
-        inp->coda_store.VFid = *fid;
-        inp->coda_store.flags = flags;
-
-       error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
-
-       CODA_FREE(inp, insize);
-        return error;
-}
-
-int venus_release(struct super_block *sb, struct CodaFid *fid, int flags)
-{
-        union inputArgs *inp;
-        union outputArgs *outp;
-        int insize, outsize, error;
-       
-       insize = SIZE(release);
-       UPARG(CODA_RELEASE);
-       
-       inp->coda_release.VFid = *fid;
-       inp->coda_release.flags = flags;
-
-       error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
-
-       CODA_FREE(inp, insize);
-       return error;
-}
-
 int venus_close(struct super_block *sb, struct CodaFid *fid, int flags,
-                vuid_t uid)
+               vuid_t uid)
 {
        union inputArgs *inp;
        union outputArgs *outp;
        int insize, outsize, error;
-#ifdef CONFIG_CODA_FS_OLD_API
-       struct coda_cred cred = { 0, };
-       cred.cr_fsuid = uid;
-#endif
        
        insize = SIZE(release);
        UPARG(CODA_CLOSE);
        
-#ifdef CONFIG_CODA_FS_OLD_API
-       memcpy(&(inp->ih.cred), &cred, sizeof(cred));
-#else
        inp->ih.uid = uid;
-#endif
-       
         inp->coda_close.VFid = *fid;
         inp->coda_close.flags = flags;
 
@@ -632,7 +572,7 @@ int venus_statfs(struct dentry *dentry, struct kstatfs *sfs)
 /*
  * coda_upcall and coda_downcall routines.
  */
-static void block_signals(sigset_t *old)
+static void coda_block_signals(sigset_t *old)
 {
        spin_lock_irq(&current->sighand->siglock);
        *old = current->blocked;
@@ -646,7 +586,7 @@ static void block_signals(sigset_t *old)
        spin_unlock_irq(&current->sighand->siglock);
 }
 
-static void unblock_signals(sigset_t *old)
+static void coda_unblock_signals(sigset_t *old)
 {
        spin_lock_irq(&current->sighand->siglock);
        current->blocked = *old;
@@ -672,7 +612,7 @@ static inline void coda_waitfor_upcall(struct upc_req *req)
        sigset_t old;
        int blocked;
 
-       block_signals(&old);
+       coda_block_signals(&old);
        blocked = 1;
 
        add_wait_queue(&req->uc_sleep, &wait);
@@ -689,7 +629,7 @@ static inline void coda_waitfor_upcall(struct upc_req *req)
                if (blocked && time_after(jiffies, timeout) &&
                    CODA_INTERRUPTIBLE(req))
                {
-                       unblock_signals(&old);
+                       coda_unblock_signals(&old);
                        blocked = 0;
                }
 
@@ -704,7 +644,7 @@ static inline void coda_waitfor_upcall(struct upc_req *req)
                        schedule();
        }
        if (blocked)
-               unblock_signals(&old);
+               coda_unblock_signals(&old);
 
        remove_wait_queue(&req->uc_sleep, &wait);
        set_current_state(TASK_RUNNING);