The sb_info structure only contains a single pointer to the character device,
there is no need for the added indirection.
Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/* remove all acl caches */
void coda_cache_clear_all(struct super_block *sb)
{
/* remove all acl caches */
void coda_cache_clear_all(struct super_block *sb)
{
- struct coda_sb_info *sbi;
-
- sbi = coda_sbp(sb);
- BUG_ON(!sbi);
-
atomic_inc(&permission_epoch);
}
atomic_inc(&permission_epoch);
}
static int coda_fill_super(struct super_block *sb, void *data, int silent)
{
static int coda_fill_super(struct super_block *sb, void *data, int silent)
{
- struct inode *root = NULL;
- struct coda_sb_info *sbi = NULL;
+ struct inode *root = NULL;
struct venus_comm *vc = NULL;
struct CodaFid fid;
struct venus_comm *vc = NULL;
struct CodaFid fid;
int idx;
idx = get_device_index((struct coda_mount_data *) data);
int idx;
idx = get_device_index((struct coda_mount_data *) data);
- sbi = kmalloc(sizeof(struct coda_sb_info), GFP_KERNEL);
- if(!sbi) {
- return -ENOMEM;
- }
-
- sbi->sbi_vcomm = vc;
-
- sb->s_fs_info = sbi;
sb->s_flags |= MS_NOATIME;
sb->s_blocksize = 4096; /* XXXXX what do we put here?? */
sb->s_blocksize_bits = 12;
sb->s_flags |= MS_NOATIME;
sb->s_blocksize = 4096; /* XXXXX what do we put here?? */
sb->s_blocksize_bits = 12;
- if (sbi) {
- kfree(sbi);
- if(vc)
- vc->vc_sb = NULL;
- }
+ iput(root);
+ if (vc)
+ vc->vc_sb = NULL;
}
static void coda_put_super(struct super_block *sb)
{
}
static void coda_put_super(struct super_block *sb)
{
- struct coda_sb_info *sbi;
-
- sbi = coda_sbp(sb);
- sbi->sbi_vcomm->vc_sb = NULL;
+ coda_vcp(sb)->vc_sb = NULL;
+ sb->s_fs_info = NULL;
printk("Coda: Bye bye.\n");
printk("Coda: Bye bye.\n");
}
static void coda_clear_inode(struct inode *inode)
}
static void coda_clear_inode(struct inode *inode)
#include <linux/coda_cache.h>
#include <linux/coda_proc.h>
#include <linux/coda_cache.h>
#include <linux/coda_proc.h>
-static int coda_upcall(struct coda_sb_info *mntinfo, int inSize, int *outSize,
+static int coda_upcall(struct venus_comm *vc, int inSize, int *outSize,
union inputArgs *buffer);
static void *alloc_upcall(int opcode, int size)
union inputArgs *buffer);
static void *alloc_upcall(int opcode, int size)
insize = SIZE(root);
UPARG(CODA_ROOT);
insize = SIZE(root);
UPARG(CODA_ROOT);
- error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
if (!error)
*fidp = outp->coda_root.VFid;
if (!error)
*fidp = outp->coda_root.VFid;
UPARG(CODA_GETATTR);
inp->coda_getattr.VFid = *fid;
UPARG(CODA_GETATTR);
inp->coda_getattr.VFid = *fid;
- error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
if (!error)
*attr = outp->coda_getattr.attr;
if (!error)
*attr = outp->coda_getattr.attr;
inp->coda_setattr.VFid = *fid;
inp->coda_setattr.attr = *vattr;
inp->coda_setattr.VFid = *fid;
inp->coda_setattr.attr = *vattr;
- error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
CODA_FREE(inp, insize);
return error;
CODA_FREE(inp, insize);
return error;
memcpy((char *)(inp) + offset, name, length);
*((char *)inp + offset + length) = '\0';
memcpy((char *)(inp) + offset, name, length);
*((char *)inp + offset + length) = '\0';
- error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
if (!error) {
*resfid = outp->coda_lookup.VFid;
*type = outp->coda_lookup.vtype;
if (!error) {
*resfid = outp->coda_lookup.VFid;
*type = outp->coda_lookup.vtype;
inp->coda_store.VFid = *fid;
inp->coda_store.flags = flags;
inp->coda_store.VFid = *fid;
inp->coda_store.flags = flags;
- error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
CODA_FREE(inp, insize);
return error;
CODA_FREE(inp, insize);
return error;
inp->coda_release.VFid = *fid;
inp->coda_release.flags = flags;
inp->coda_release.VFid = *fid;
inp->coda_release.flags = flags;
- error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
CODA_FREE(inp, insize);
return error;
CODA_FREE(inp, insize);
return error;
inp->coda_close.VFid = *fid;
inp->coda_close.flags = flags;
inp->coda_close.VFid = *fid;
inp->coda_close.flags = flags;
- error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
CODA_FREE(inp, insize);
return error;
CODA_FREE(inp, insize);
return error;
inp->coda_open_by_fd.VFid = *fid;
inp->coda_open_by_fd.flags = flags;
inp->coda_open_by_fd.VFid = *fid;
inp->coda_open_by_fd.flags = flags;
- error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
if (!error)
*fh = outp->coda_open_by_fd.fh;
if (!error)
*fh = outp->coda_open_by_fd.fh;
memcpy((char *)(inp) + offset, name, length);
*((char *)inp + offset + length) = '\0';
memcpy((char *)(inp) + offset, name, length);
*((char *)inp + offset + length) = '\0';
- error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
if (!error) {
*attrs = outp->coda_mkdir.attr;
*newfid = outp->coda_mkdir.VFid;
if (!error) {
*attrs = outp->coda_mkdir.attr;
*newfid = outp->coda_mkdir.VFid;
memcpy((char *)(inp) + offset, new_name, new_length);
*((char *)inp + offset + new_length) = '\0';
memcpy((char *)(inp) + offset, new_name, new_length);
*((char *)inp + offset + new_length) = '\0';
- error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
CODA_FREE(inp, insize);
return error;
CODA_FREE(inp, insize);
return error;
memcpy((char *)(inp) + offset, name, length);
*((char *)inp + offset + length) = '\0';
memcpy((char *)(inp) + offset, name, length);
*((char *)inp + offset + length) = '\0';
- error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
if (!error) {
*attrs = outp->coda_create.attr;
*newfid = outp->coda_create.VFid;
if (!error) {
*attrs = outp->coda_create.attr;
*newfid = outp->coda_create.VFid;
inp->coda_rmdir.name = offset;
memcpy((char *)(inp) + offset, name, length);
*((char *)inp + offset + length) = '\0';
inp->coda_rmdir.name = offset;
memcpy((char *)(inp) + offset, name, length);
*((char *)inp + offset + length) = '\0';
-
- error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+
+ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
CODA_FREE(inp, insize);
return error;
CODA_FREE(inp, insize);
return error;
inp->coda_remove.name = offset;
memcpy((char *)(inp) + offset, name, length);
*((char *)inp + offset + length) = '\0';
inp->coda_remove.name = offset;
memcpy((char *)(inp) + offset, name, length);
*((char *)inp + offset + length) = '\0';
-
- error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+
+ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
CODA_FREE(inp, insize);
return error;
CODA_FREE(inp, insize);
return error;
inp->coda_readlink.VFid = *fid;
inp->coda_readlink.VFid = *fid;
- error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
if (!error) {
retlen = outp->coda_readlink.count;
if ( retlen > *length )
if (!error) {
retlen = outp->coda_readlink.count;
if ( retlen > *length )
/* make sure strings are null terminated */
memcpy((char *)(inp) + offset, name, len);
*((char *)inp + offset + len) = '\0';
/* make sure strings are null terminated */
memcpy((char *)(inp) + offset, name, len);
*((char *)inp + offset + len) = '\0';
-
- error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+
+ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
CODA_FREE(inp, insize);
return error;
CODA_FREE(inp, insize);
return error;
memcpy((char *)(inp) + offset, name, len);
*((char *)inp + offset + len) = '\0';
memcpy((char *)(inp) + offset, name, len);
*((char *)inp + offset + len) = '\0';
- error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
CODA_FREE(inp, insize);
return error;
CODA_FREE(inp, insize);
return error;
insize=SIZE(fsync);
UPARG(CODA_FSYNC);
insize=SIZE(fsync);
UPARG(CODA_FSYNC);
- inp->coda_fsync.VFid = *fid;
- error = coda_upcall(coda_sbp(sb), sizeof(union inputArgs),
- &outsize, inp);
+ inp->coda_fsync.VFid = *fid;
+ error = coda_upcall(coda_vcp(sb), sizeof(union inputArgs),
+ &outsize, inp);
CODA_FREE(inp, insize);
return error;
CODA_FREE(inp, insize);
return error;
inp->coda_access.VFid = *fid;
inp->coda_access.flags = mask;
inp->coda_access.VFid = *fid;
inp->coda_access.flags = mask;
- error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
CODA_FREE(inp, insize);
return error;
CODA_FREE(inp, insize);
return error;
- error = coda_upcall(coda_sbp(sb), SIZE(ioctl) + data->vi.in_size,
- &outsize, inp);
-
+ error = coda_upcall(coda_vcp(sb), SIZE(ioctl) + data->vi.in_size,
+ &outsize, inp);
+
if (error) {
printk("coda_pioctl: Venus returns: %d for %s\n",
error, coda_f2s(fid));
if (error) {
printk("coda_pioctl: Venus returns: %d for %s\n",
error, coda_f2s(fid));
insize = max_t(unsigned int, INSIZE(statfs), OUTSIZE(statfs));
UPARG(CODA_STATFS);
insize = max_t(unsigned int, INSIZE(statfs), OUTSIZE(statfs));
UPARG(CODA_STATFS);
- error = coda_upcall(coda_sbp(dentry->d_sb), insize, &outsize, inp);
+ error = coda_upcall(coda_vcp(dentry->d_sb), insize, &outsize, inp);
if (!error) {
sfs->f_blocks = outp->coda_statfs.stat.f_blocks;
sfs->f_bfree = outp->coda_statfs.stat.f_bfree;
if (!error) {
sfs->f_blocks = outp->coda_statfs.stat.f_blocks;
sfs->f_bfree = outp->coda_statfs.stat.f_bfree;
-/*
- * coda_upcall will return an error in the case of
+/*
+ * coda_upcall will return an error in the case of
* failed communication with Venus _or_ will peek at Venus
* reply and return Venus' error.
*
* As venus has 2 types of errors, normal errors (positive) and internal
* errors (negative), normal errors are negated, while internal errors
* are all mapped to -EINTR, while showing a nice warning message. (jh)
* failed communication with Venus _or_ will peek at Venus
* reply and return Venus' error.
*
* As venus has 2 types of errors, normal errors (positive) and internal
* errors (negative), normal errors are negated, while internal errors
* are all mapped to -EINTR, while showing a nice warning message. (jh)
-static int coda_upcall(struct coda_sb_info *sbi,
+static int coda_upcall(struct venus_comm *vcp,
int inSize, int *outSize,
union inputArgs *buffer)
{
int inSize, int *outSize,
union inputArgs *buffer)
{
- struct venus_comm *vcommp;
union outputArgs *out;
union inputArgs *sig_inputArgs;
struct upc_req *req, *sig_req;
int error = 0;
union outputArgs *out;
union inputArgs *sig_inputArgs;
struct upc_req *req, *sig_req;
int error = 0;
- vcommp = sbi->sbi_vcomm;
- if (!vcommp->vc_inuse) {
printk(KERN_NOTICE "coda: Venus dead, not sending upcall\n");
return -ENXIO;
}
printk(KERN_NOTICE "coda: Venus dead, not sending upcall\n");
return -ENXIO;
}
req->uc_inSize = inSize;
req->uc_outSize = *outSize ? *outSize : inSize;
req->uc_opcode = ((union inputArgs *)buffer)->ih.opcode;
req->uc_inSize = inSize;
req->uc_outSize = *outSize ? *outSize : inSize;
req->uc_opcode = ((union inputArgs *)buffer)->ih.opcode;
- req->uc_unique = ++vcommp->vc_seq;
+ req->uc_unique = ++vcp->vc_seq;
init_waitqueue_head(&req->uc_sleep);
/* Fill in the common input args. */
((union inputArgs *)buffer)->ih.unique = req->uc_unique;
/* Append msg to pending queue and poke Venus. */
init_waitqueue_head(&req->uc_sleep);
/* Fill in the common input args. */
((union inputArgs *)buffer)->ih.unique = req->uc_unique;
/* Append msg to pending queue and poke Venus. */
- list_add_tail(&req->uc_chain, &vcommp->vc_pending);
+ list_add_tail(&req->uc_chain, &vcp->vc_pending);
- wake_up_interruptible(&vcommp->vc_waitq);
+ wake_up_interruptible(&vcp->vc_waitq);
/* We can be interrupted while we wait for Venus to process
* our request. If the interrupt occurs before Venus has read
* the request, we dequeue and return. If it occurs after the
/* We can be interrupted while we wait for Venus to process
* our request. If the interrupt occurs before Venus has read
* the request, we dequeue and return. If it occurs after the
goto exit;
/* Venus saw the upcall, make sure we can send interrupt signal */
goto exit;
/* Venus saw the upcall, make sure we can send interrupt signal */
- if (!vcommp->vc_inuse) {
printk(KERN_INFO "coda: Venus dead, not sending signal.\n");
goto exit;
}
printk(KERN_INFO "coda: Venus dead, not sending signal.\n");
goto exit;
}
sig_req->uc_outSize = sizeof(struct coda_in_hdr);
/* insert at head of queue! */
sig_req->uc_outSize = sizeof(struct coda_in_hdr);
/* insert at head of queue! */
- list_add(&(sig_req->uc_chain), &vcommp->vc_pending);
- wake_up_interruptible(&vcommp->vc_waitq);
+ list_add(&(sig_req->uc_chain), &vcp->vc_pending);
+ wake_up_interruptible(&vcp->vc_waitq);
-struct coda_sb_info
-{
- struct venus_comm *sbi_vcomm;
-};
-
/* communication pending/processing queues */
struct venus_comm {
u_long vc_seq;
/* communication pending/processing queues */
struct venus_comm {
u_long vc_seq;
-static inline struct coda_sb_info *coda_sbp(struct super_block *sb)
+static inline struct venus_comm *coda_vcp(struct super_block *sb)
- return ((struct coda_sb_info *)((sb)->s_fs_info));
+ return (struct venus_comm *)((sb)->s_fs_info);