Skip to content

Commit

Permalink
coda: replace upc_alloc/upc_free with kmalloc/kfree
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Harkes <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
jaharkes authored and Linus Torvalds committed Jul 19, 2007
1 parent 9787525 commit 37461e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
6 changes: 2 additions & 4 deletions fs/coda/psdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@

#include "coda_int.h"

#define upc_free(r) kfree(r)

/* statistics */
int coda_hard; /* allows signals during upcalls */
unsigned long coda_timeout = 30; /* .. secs, then signals will dequeue */
Expand Down Expand Up @@ -264,7 +262,7 @@ static ssize_t coda_psdev_read(struct file * file, char __user * buf,
}

CODA_FREE(req->uc_data, sizeof(struct coda_in_hdr));
upc_free(req);
kfree(req);
out:
unlock_kernel();
return (count ? count : retval);
Expand Down Expand Up @@ -320,7 +318,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file)
/* Async requests need to be freed here */
if (req->uc_flags & REQ_ASYNC) {
CODA_FREE(req->uc_data, sizeof(struct coda_in_hdr));
upc_free(req);
kfree(req);
continue;
}
req->uc_flags |= REQ_ABORT;
Expand Down
11 changes: 4 additions & 7 deletions fs/coda/upcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
#include <linux/coda_cache.h>
#include <linux/coda_proc.h>

#define upc_alloc() kmalloc(sizeof(struct upc_req), GFP_KERNEL)
#define upc_free(r) kfree(r)

static int coda_upcall(struct coda_sb_info *mntinfo, int inSize, int *outSize,
union inputArgs *buffer);

Expand Down Expand Up @@ -745,7 +742,7 @@ static int coda_upcall(struct coda_sb_info *sbi,
}

/* Format the request message. */
req = upc_alloc();
req = kmalloc(sizeof(struct upc_req), GFP_KERNEL);
if (!req)
return -ENOMEM;

Expand Down Expand Up @@ -802,12 +799,12 @@ static int coda_upcall(struct coda_sb_info *sbi,
}

error = -ENOMEM;
sig_req = upc_alloc();
sig_req = kmalloc(sizeof(struct upc_req), GFP_KERNEL);
if (!sig_req) goto exit;

CODA_ALLOC((sig_req->uc_data), char *, sizeof(struct coda_in_hdr));
if (!sig_req->uc_data) {
upc_free(sig_req);
kfree(sig_req);
goto exit;
}

Expand All @@ -827,7 +824,7 @@ static int coda_upcall(struct coda_sb_info *sbi,
wake_up_interruptible(&vcommp->vc_waitq);

exit:
upc_free(req);
kfree(req);
return error;
}

Expand Down

0 comments on commit 37461e1

Please sign in to comment.