Commit 50a02d70 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/davem/sparc-2.5

into laptop.osdl.org:/home/torvalds/v2.5/linux
parents 793ca9b7 d7d65a95
...@@ -1562,6 +1562,20 @@ config CODA_FS ...@@ -1562,6 +1562,20 @@ config CODA_FS
whenever you want), say M here and read whenever you want), say M here and read
<file:Documentation/modules.txt>. The module will be called coda. <file:Documentation/modules.txt>. The module will be called coda.
config CODA_FS_OLD_API
bool "Use 96-bit Coda file identifiers"
depends on CODA_FS
help
A new kernel-userspace API had to be introduced for Coda v6.0
to support larger 128-bit file identifiers as needed by the
new realms implementation.
However this new API is not backward compatible with older
clients. If you really need to run the old Coda userspace
cache manager then say Y.
For most cases you probably want to say N.
config INTERMEZZO_FS config INTERMEZZO_FS
tristate "InterMezzo file system support (replicating fs) (EXPERIMENTAL)" tristate "InterMezzo file system support (replicating fs) (EXPERIMENTAL)"
depends on INET && EXPERIMENTAL depends on INET && EXPERIMENTAL
......
...@@ -23,13 +23,16 @@ ...@@ -23,13 +23,16 @@
#include <linux/coda_fs_i.h> #include <linux/coda_fs_i.h>
#include <linux/coda_cache.h> #include <linux/coda_cache.h>
static atomic_t permission_epoch = ATOMIC_INIT(0);
/* replace or extend an acl cache hit */ /* replace or extend an acl cache hit */
void coda_cache_enter(struct inode *inode, int mask) void coda_cache_enter(struct inode *inode, int mask)
{ {
struct coda_inode_info *cii = ITOC(inode); struct coda_inode_info *cii = ITOC(inode);
if ( !coda_cred_ok(&cii->c_cached_cred) ) { cii->c_cached_epoch = atomic_read(&permission_epoch);
coda_load_creds(&cii->c_cached_cred); if (cii->c_uid != current->fsuid) {
cii->c_uid = current->fsuid;
cii->c_cached_perm = mask; cii->c_cached_perm = mask;
} else } else
cii->c_cached_perm |= mask; cii->c_cached_perm |= mask;
...@@ -42,22 +45,15 @@ void coda_cache_clear_inode(struct inode *inode) ...@@ -42,22 +45,15 @@ void coda_cache_clear_inode(struct inode *inode)
cii->c_cached_perm = 0; cii->c_cached_perm = 0;
} }
/* remove all acl caches for a principal (or all principals when cred == NULL)*/ /* remove all acl caches */
void coda_cache_clear_all(struct super_block *sb, struct coda_cred *cred) void coda_cache_clear_all(struct super_block *sb)
{ {
struct coda_sb_info *sbi; struct coda_sb_info *sbi;
struct coda_inode_info *cii;
struct list_head *tmp;
sbi = coda_sbp(sb); sbi = coda_sbp(sb);
if (!sbi) BUG(); if (!sbi) BUG();
list_for_each(tmp, &sbi->sbi_cihead) atomic_inc(&permission_epoch);
{
cii = list_entry(tmp, struct coda_inode_info, c_cilist);
if (!cred || coda_cred_eq(cred, &cii->c_cached_cred))
cii->c_cached_perm = 0;
}
} }
...@@ -67,8 +63,9 @@ int coda_cache_check(struct inode *inode, int mask) ...@@ -67,8 +63,9 @@ int coda_cache_check(struct inode *inode, int mask)
struct coda_inode_info *cii = ITOC(inode); struct coda_inode_info *cii = ITOC(inode);
int hit; int hit;
hit = ((mask & cii->c_cached_perm) == mask) && hit = (mask & cii->c_cached_perm) == mask &&
coda_cred_ok(&cii->c_cached_cred); cii->c_uid == current->fsuid &&
cii->c_cached_epoch == atomic_read(&permission_epoch);
return hit; return hit;
} }
......
...@@ -11,18 +11,9 @@ ...@@ -11,18 +11,9 @@
#include <linux/coda_fs_i.h> #include <linux/coda_fs_i.h>
#include <linux/coda_psdev.h> #include <linux/coda_psdev.h>
inline int coda_fideq(ViceFid *fid1, ViceFid *fid2) inline int coda_fideq(struct CodaFid *fid1, struct CodaFid *fid2)
{ {
if (fid1->Vnode != fid2->Vnode) return 0; return memcmp(fid1, fid2, sizeof(*fid1)) == 0;
if (fid1->Volume != fid2->Volume) return 0;
if (fid1->Unique != fid2->Unique) return 0;
return 1;
}
inline int coda_isnullfid(ViceFid *fid)
{
if (fid->Vnode || fid->Volume || fid->Unique) return 0;
return 1;
} }
static struct inode_operations coda_symlink_inode_operations = { static struct inode_operations coda_symlink_inode_operations = {
...@@ -52,13 +43,13 @@ static void coda_fill_inode(struct inode *inode, struct coda_vattr *attr) ...@@ -52,13 +43,13 @@ static void coda_fill_inode(struct inode *inode, struct coda_vattr *attr)
static int coda_test_inode(struct inode *inode, void *data) static int coda_test_inode(struct inode *inode, void *data)
{ {
ViceFid *fid = (ViceFid *)data; struct CodaFid *fid = (struct CodaFid *)data;
return coda_fideq(&(ITOC(inode)->c_fid), fid); return coda_fideq(&(ITOC(inode)->c_fid), fid);
} }
static int coda_set_inode(struct inode *inode, void *data) static int coda_set_inode(struct inode *inode, void *data)
{ {
ViceFid *fid = (ViceFid *)data; struct CodaFid *fid = (struct CodaFid *)data;
ITOC(inode)->c_fid = *fid; ITOC(inode)->c_fid = *fid;
return 0; return 0;
} }
...@@ -68,12 +59,11 @@ static int coda_fail_inode(struct inode *inode, void *data) ...@@ -68,12 +59,11 @@ static int coda_fail_inode(struct inode *inode, void *data)
return -1; return -1;
} }
struct inode * coda_iget(struct super_block * sb, ViceFid * fid, struct inode * coda_iget(struct super_block * sb, struct CodaFid * fid,
struct coda_vattr * attr) struct coda_vattr * attr)
{ {
struct inode *inode; struct inode *inode;
struct coda_inode_info *cii; struct coda_inode_info *cii;
struct coda_sb_info *sbi = coda_sbp(sb);
unsigned long hash = coda_f2i(fid); unsigned long hash = coda_f2i(fid);
inode = iget5_locked(sb, hash, coda_test_inode, coda_set_inode, fid); inode = iget5_locked(sb, hash, coda_test_inode, coda_set_inode, fid);
...@@ -86,7 +76,6 @@ struct inode * coda_iget(struct super_block * sb, ViceFid * fid, ...@@ -86,7 +76,6 @@ struct inode * coda_iget(struct super_block * sb, ViceFid * fid,
/* we still need to set i_ino for things like stat(2) */ /* we still need to set i_ino for things like stat(2) */
inode->i_ino = hash; inode->i_ino = hash;
cii->c_mapcount = 0; cii->c_mapcount = 0;
list_add(&cii->c_cilist, &sbi->sbi_cihead);
unlock_new_inode(inode); unlock_new_inode(inode);
} }
...@@ -101,7 +90,7 @@ struct inode * coda_iget(struct super_block * sb, ViceFid * fid, ...@@ -101,7 +90,7 @@ struct inode * coda_iget(struct super_block * sb, ViceFid * fid,
- link the two up if this is needed - link the two up if this is needed
- fill in the attributes - fill in the attributes
*/ */
int coda_cnode_make(struct inode **inode, ViceFid *fid, struct super_block *sb) int coda_cnode_make(struct inode **inode, struct CodaFid *fid, struct super_block *sb)
{ {
struct coda_vattr attr; struct coda_vattr attr;
int error; int error;
...@@ -122,8 +111,8 @@ int coda_cnode_make(struct inode **inode, ViceFid *fid, struct super_block *sb) ...@@ -122,8 +111,8 @@ int coda_cnode_make(struct inode **inode, ViceFid *fid, struct super_block *sb)
} }
void coda_replace_fid(struct inode *inode, struct ViceFid *oldfid, void coda_replace_fid(struct inode *inode, struct CodaFid *oldfid,
struct ViceFid *newfid) struct CodaFid *newfid)
{ {
struct coda_inode_info *cii; struct coda_inode_info *cii;
unsigned long hash = coda_f2i(newfid); unsigned long hash = coda_f2i(newfid);
...@@ -142,7 +131,7 @@ void coda_replace_fid(struct inode *inode, struct ViceFid *oldfid, ...@@ -142,7 +131,7 @@ void coda_replace_fid(struct inode *inode, struct ViceFid *oldfid,
} }
/* convert a fid to an inode. */ /* convert a fid to an inode. */
struct inode *coda_fid_to_inode(ViceFid *fid, struct super_block *sb) struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb)
{ {
struct inode *inode; struct inode *inode;
unsigned long hash = coda_f2i(fid); unsigned long hash = coda_f2i(fid);
......
...@@ -25,10 +25,14 @@ ...@@ -25,10 +25,14 @@
int coda_fake_statfs; int coda_fake_statfs;
/* print a fid */ /* print a fid */
char * coda_f2s(ViceFid *f) char * coda_f2s(struct CodaFid *f)
{ {
static char s[60]; static char s[60];
sprintf(s, "(%-#lx.%-#lx.%-#lx)", f->Volume, f->Vnode, f->Unique); #ifdef CODA_FS_OLD_API
sprintf(s, "(%08x.%08x.%08x)", f->opaque[0], f->opaque[1], f->opaque[2]);
#else
sprintf(s, "(%08x.%08x.%08x.%08x)", f->opaque[0], f->opaque[1], f->opaque[2], f->opaque[3]);
#endif
return s; return s;
} }
...@@ -45,30 +49,6 @@ int coda_isroot(struct inode *i) ...@@ -45,30 +49,6 @@ int coda_isroot(struct inode *i)
return ( i->i_sb->s_root->d_inode == i ); return ( i->i_sb->s_root->d_inode == i );
} }
/* put the current process credentials in the cred */
void coda_load_creds(struct coda_cred *cred)
{
cred->cr_uid = (vuid_t) current->uid;
cred->cr_euid = (vuid_t) current->euid;
cred->cr_suid = (vuid_t) current->suid;
cred->cr_fsuid = (vuid_t) current->fsuid;
cred->cr_groupid = (vgid_t) current->gid;
cred->cr_egid = (vgid_t) current->egid;
cred->cr_sgid = (vgid_t) current->sgid;
cred->cr_fsgid = (vgid_t) current->fsgid;
}
int coda_cred_ok(struct coda_cred *cred)
{
return(current->fsuid == cred->cr_fsuid);
}
int coda_cred_eq(struct coda_cred *cred1, struct coda_cred *cred2)
{
return (cred1->cr_fsuid == cred2->cr_fsuid);
}
unsigned short coda_flags_to_cflags(unsigned short flags) unsigned short coda_flags_to_cflags(unsigned short flags)
{ {
unsigned short coda_flags = 0; unsigned short coda_flags = 0;
...@@ -215,58 +195,3 @@ void coda_iattr_to_vattr(struct iattr *iattr, struct coda_vattr *vattr) ...@@ -215,58 +195,3 @@ void coda_iattr_to_vattr(struct iattr *iattr, struct coda_vattr *vattr)
} }
} }
void print_vattr(struct coda_vattr *attr)
{
char *typestr;
switch (attr->va_type) {
case C_VNON:
typestr = "C_VNON";
break;
case C_VREG:
typestr = "C_VREG";
break;
case C_VDIR:
typestr = "C_VDIR";
break;
case C_VBLK:
typestr = "C_VBLK";
break;
case C_VCHR:
typestr = "C_VCHR";
break;
case C_VLNK:
typestr = "C_VLNK";
break;
case C_VSOCK:
typestr = "C_VSCK";
break;
case C_VFIFO:
typestr = "C_VFFO";
break;
case C_VBAD:
typestr = "C_VBAD";
break;
default:
typestr = "????";
break;
}
printk("attr: type %s (%o) mode %o uid %d gid %d rdev %d\n",
typestr, (int)attr->va_type, (int)attr->va_mode,
(int)attr->va_uid, (int)attr->va_gid, (int)attr->va_rdev);
printk(" fileid %d nlink %d size %d blocksize %d bytes %d\n",
(int)attr->va_fileid, (int)attr->va_nlink,
(int)attr->va_size,
(int)attr->va_blocksize,(int)attr->va_bytes);
printk(" gen %ld flags %ld\n",
attr->va_gen, attr->va_flags);
printk(" atime sec %d nsec %d\n",
(int)attr->va_atime.tv_sec, (int)attr->va_atime.tv_nsec);
printk(" mtime sec %d nsec %d\n",
(int)attr->va_mtime.tv_sec, (int)attr->va_mtime.tv_nsec);
printk(" ctime sec %d nsec %d\n",
(int)attr->va_ctime.tv_sec, (int)attr->va_ctime.tv_nsec);
}
...@@ -93,7 +93,7 @@ struct file_operations coda_dir_operations = { ...@@ -93,7 +93,7 @@ struct file_operations coda_dir_operations = {
static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, struct nameidata *nd) static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, struct nameidata *nd)
{ {
struct inode *res_inode = NULL; struct inode *res_inode = NULL;
struct ViceFid resfid = {0,0,0}; struct CodaFid resfid = { { 0, } };
int dropme = 0; /* to indicate entry should not be cached */ int dropme = 0; /* to indicate entry should not be cached */
int type = 0; int type = 0;
int error = 0; int error = 0;
...@@ -196,7 +196,7 @@ static int coda_create(struct inode *dir, struct dentry *de, int mode, struct na ...@@ -196,7 +196,7 @@ static int coda_create(struct inode *dir, struct dentry *de, int mode, struct na
const char *name=de->d_name.name; const char *name=de->d_name.name;
int length=de->d_name.len; int length=de->d_name.len;
struct inode *inode; struct inode *inode;
struct ViceFid newfid; struct CodaFid newfid;
struct coda_vattr attrs; struct coda_vattr attrs;
lock_kernel(); lock_kernel();
...@@ -236,7 +236,7 @@ static int coda_mknod(struct inode *dir, struct dentry *de, int mode, dev_t rdev ...@@ -236,7 +236,7 @@ static int coda_mknod(struct inode *dir, struct dentry *de, int mode, dev_t rdev
const char *name=de->d_name.name; const char *name=de->d_name.name;
int length=de->d_name.len; int length=de->d_name.len;
struct inode *inode; struct inode *inode;
struct ViceFid newfid; struct CodaFid newfid;
struct coda_vattr attrs; struct coda_vattr attrs;
if ( coda_hasmknod == 0 ) if ( coda_hasmknod == 0 )
...@@ -283,7 +283,7 @@ static int coda_mkdir(struct inode *dir, struct dentry *de, int mode) ...@@ -283,7 +283,7 @@ static int coda_mkdir(struct inode *dir, struct dentry *de, int mode)
const char *name = de->d_name.name; const char *name = de->d_name.name;
int len = de->d_name.len; int len = de->d_name.len;
int error; int error;
struct ViceFid newfid; struct CodaFid newfid;
lock_kernel(); lock_kernel();
coda_vfs_stat.mkdir++; coda_vfs_stat.mkdir++;
...@@ -588,8 +588,7 @@ static int coda_venus_readdir(struct file *filp, filldir_t filldir, ...@@ -588,8 +588,7 @@ static int coda_venus_readdir(struct file *filp, filldir_t filldir,
break; break;
} }
/* validate whether the directory file actually makes sense */ /* validate whether the directory file actually makes sense */
if (vdir->d_reclen < vdir_size + vdir->d_namlen || if (vdir->d_reclen < vdir_size + vdir->d_namlen) {
vdir->d_namlen > CODA_MAXNAMLEN) {
printk("coda_venus_readdir: Invalid dir: %ld\n", printk("coda_venus_readdir: Invalid dir: %ld\n",
filp->f_dentry->d_inode->i_ino); filp->f_dentry->d_inode->i_ino);
ret = -EBADF; ret = -EBADF;
......
...@@ -136,7 +136,6 @@ int coda_open(struct inode *coda_inode, struct file *coda_file) ...@@ -136,7 +136,6 @@ int coda_open(struct inode *coda_inode, struct file *coda_file)
cfi->cfi_magic = CODA_MAGIC; cfi->cfi_magic = CODA_MAGIC;
cfi->cfi_mapcount = 0; cfi->cfi_mapcount = 0;
cfi->cfi_container = host_file; cfi->cfi_container = host_file;
coda_load_creds(&cfi->cfi_cred);
BUG_ON(coda_file->private_data != NULL); BUG_ON(coda_file->private_data != NULL);
coda_file->private_data = cfi; coda_file->private_data = cfi;
...@@ -176,7 +175,7 @@ int coda_flush(struct file *coda_file) ...@@ -176,7 +175,7 @@ int coda_flush(struct file *coda_file)
coda_inode = coda_file->f_dentry->d_inode; coda_inode = coda_file->f_dentry->d_inode;
err = venus_store(coda_inode->i_sb, coda_i2f(coda_inode), coda_flags, err = venus_store(coda_inode->i_sb, coda_i2f(coda_inode), coda_flags,
&cfi->cfi_cred); coda_file->f_uid);
if (err == -EOPNOTSUPP) { if (err == -EOPNOTSUPP) {
use_coda_close = 1; use_coda_close = 1;
...@@ -214,7 +213,7 @@ int coda_release(struct inode *coda_inode, struct file *coda_file) ...@@ -214,7 +213,7 @@ int coda_release(struct inode *coda_inode, struct file *coda_file)
if (use_coda_close) if (use_coda_close)
err = venus_close(coda_inode->i_sb, coda_i2f(coda_inode), err = venus_close(coda_inode->i_sb, coda_i2f(coda_inode),
coda_flags, &cfi->cfi_cred); coda_flags, coda_file->f_uid);
host_inode = cfi->cfi_container->f_dentry->d_inode; host_inode = cfi->cfi_container->f_dentry->d_inode;
cii = ITOC(coda_inode); cii = ITOC(coda_inode);
......
...@@ -44,10 +44,9 @@ static struct inode *coda_alloc_inode(struct super_block *sb) ...@@ -44,10 +44,9 @@ static struct inode *coda_alloc_inode(struct super_block *sb)
ei = (struct coda_inode_info *)kmem_cache_alloc(coda_inode_cachep, SLAB_KERNEL); ei = (struct coda_inode_info *)kmem_cache_alloc(coda_inode_cachep, SLAB_KERNEL);
if (!ei) if (!ei)
return NULL; return NULL;
memset(&ei->c_fid, 0, sizeof(struct ViceFid)); memset(&ei->c_fid, 0, sizeof(struct CodaFid));
ei->c_flags = 0; ei->c_flags = 0;
INIT_LIST_HEAD(&ei->c_cilist); ei->c_uid = 0;
memset(&ei->c_cached_cred, 0, sizeof(struct coda_cred));
ei->c_cached_perm = 0; ei->c_cached_perm = 0;
return &ei->vfs_inode; return &ei->vfs_inode;
} }
...@@ -139,7 +138,7 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent) ...@@ -139,7 +138,7 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
struct inode *root = 0; struct inode *root = 0;
struct coda_sb_info *sbi = NULL; struct coda_sb_info *sbi = NULL;
struct venus_comm *vc = NULL; struct venus_comm *vc = NULL;
ViceFid fid; struct CodaFid fid;
int error; int error;
int idx; int idx;
...@@ -169,9 +168,7 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent) ...@@ -169,9 +168,7 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
vc->vc_sb = sb; vc->vc_sb = sb;
sbi->sbi_sb = sb;
sbi->sbi_vcomm = vc; sbi->sbi_vcomm = vc;
INIT_LIST_HEAD(&sbi->sbi_cihead);
sb->s_fs_info = sbi; sb->s_fs_info = sbi;
sb->s_blocksize = 1024; /* XXXXX what do we put here?? */ sb->s_blocksize = 1024; /* XXXXX what do we put here?? */
...@@ -218,7 +215,6 @@ static void coda_put_super(struct super_block *sb) ...@@ -218,7 +215,6 @@ static void coda_put_super(struct super_block *sb)
sbi = coda_sbp(sb); sbi = coda_sbp(sb);
sbi->sbi_vcomm->vc_sb = NULL; sbi->sbi_vcomm->vc_sb = NULL;
list_del_init(&sbi->sbi_cihead);
printk("Coda: Bye bye.\n"); printk("Coda: Bye bye.\n");
kfree(sbi); kfree(sbi);
...@@ -226,9 +222,6 @@ static void coda_put_super(struct super_block *sb) ...@@ -226,9 +222,6 @@ static void coda_put_super(struct super_block *sb)
static void coda_clear_inode(struct inode *inode) static void coda_clear_inode(struct inode *inode)
{ {
struct coda_inode_info *cii = ITOC(inode);
list_del_init(&cii->c_cilist);
coda_cache_clear_inode(inode); coda_cache_clear_inode(inode);
} }
......
...@@ -61,7 +61,6 @@ unsigned long coda_timeout = 30; /* .. secs, then signals will dequeue */ ...@@ -61,7 +61,6 @@ unsigned long coda_timeout = 30; /* .. secs, then signals will dequeue */
struct venus_comm coda_comms[MAX_CODADEVS]; struct venus_comm coda_comms[MAX_CODADEVS];
kmem_cache_t *cii_cache, *cred_cache, *upc_cache;
/* /*
* Device operations * Device operations
...@@ -126,13 +125,13 @@ static ssize_t coda_psdev_write(struct file *file, const char *buf, ...@@ -126,13 +125,13 @@ static ssize_t coda_psdev_write(struct file *file, const char *buf,
} }
if ( nbytes < sizeof(struct coda_out_hdr) ) { if ( nbytes < sizeof(struct coda_out_hdr) ) {
printk("coda_downcall opc %ld uniq %ld, not enough!\n", printk("coda_downcall opc %d uniq %d, not enough!\n",
hdr.opcode, hdr.unique); hdr.opcode, hdr.unique);
count = nbytes; count = nbytes;
goto out; goto out;
} }
if ( nbytes > size ) { if ( nbytes > size ) {
printk("Coda: downcall opc %ld, uniq %ld, too much!", printk("Coda: downcall opc %d, uniq %d, too much!",
hdr.opcode, hdr.unique); hdr.opcode, hdr.unique);
nbytes = size; nbytes = size;
} }
...@@ -171,7 +170,7 @@ static ssize_t coda_psdev_write(struct file *file, const char *buf, ...@@ -171,7 +170,7 @@ static ssize_t coda_psdev_write(struct file *file, const char *buf,
unlock_kernel(); unlock_kernel();
if (!req) { if (!req) {
printk("psdev_write: msg (%ld, %ld) not found\n", printk("psdev_write: msg (%d, %d) not found\n",
hdr.opcode, hdr.unique); hdr.opcode, hdr.unique);
retval = -ESRCH; retval = -ESRCH;
goto out; goto out;
...@@ -179,7 +178,7 @@ static ssize_t coda_psdev_write(struct file *file, const char *buf, ...@@ -179,7 +178,7 @@ static ssize_t coda_psdev_write(struct file *file, const char *buf,
/* move data into response buffer. */ /* move data into response buffer. */
if (req->uc_outSize < nbytes) { if (req->uc_outSize < nbytes) {
printk("psdev_write: too much cnt: %d, cnt: %ld, opc: %ld, uniq: %ld.\n", printk("psdev_write: too much cnt: %d, cnt: %ld, opc: %d, uniq: %d.\n",
req->uc_outSize, (long)nbytes, hdr.opcode, hdr.unique); req->uc_outSize, (long)nbytes, hdr.opcode, hdr.unique);
nbytes = req->uc_outSize; /* don't have more space! */ nbytes = req->uc_outSize; /* don't have more space! */
} }
...@@ -325,10 +324,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file) ...@@ -325,10 +324,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file)
} }
/* Wakeup clients so they can return. */ /* Wakeup clients so they can return. */
lh = vcp->vc_pending.next; list_for_each_safe(lh, next, &vcp->vc_pending) {
next = lh;
while ( (lh = next) != &vcp->vc_pending) {
next = lh->next;
req = list_entry(lh, struct upc_req, uc_chain); req = list_entry(lh, struct upc_req, uc_chain);
/* Async requests need to be freed here */ /* Async requests need to be freed here */
if (req->uc_flags & REQ_ASYNC) { if (req->uc_flags & REQ_ASYNC) {
...@@ -340,9 +336,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file) ...@@ -340,9 +336,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file)
wake_up(&req->uc_sleep); wake_up(&req->uc_sleep);
} }
lh = &vcp->vc_processing; list_for_each_entry(req, &vcp->vc_processing, uc_chain) {
while ( (lh = lh->next) != &vcp->vc_processing) {
req = list_entry(lh, struct upc_req, uc_chain);
req->uc_flags |= REQ_ABORT; req->uc_flags |= REQ_ABORT;
wake_up(&req->uc_sleep); wake_up(&req->uc_sleep);
} }
...@@ -390,7 +384,13 @@ static int __init init_coda(void) ...@@ -390,7 +384,13 @@ static int __init init_coda(void)
{ {
int status; int status;
int i; int i;
printk(KERN_INFO "Coda Kernel/Venus communications, v5.3.15, coda@cs.cmu.edu\n"); printk(KERN_INFO "Coda Kernel/Venus communications, "
#ifdef CODA_FS_OLD_API
"v5.3.20"
#else
"v6.0.0"
#endif
", coda@cs.cmu.edu\n");
status = coda_init_inodecache(); status = coda_init_inodecache();
if (status) if (status)
......
This diff is collapsed.
This diff is collapsed.
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/* credential cache */ /* credential cache */
void coda_cache_enter(struct inode *inode, int mask); void coda_cache_enter(struct inode *inode, int mask);
void coda_cache_clear_inode(struct inode *); void coda_cache_clear_inode(struct inode *);
void coda_cache_clear_all(struct super_block *sb, struct coda_cred *cred); void coda_cache_clear_all(struct super_block *sb);
int coda_cache_check(struct inode *inode, int mask); int coda_cache_check(struct inode *inode, int mask);
/* for downcalls and attributes and lookups */ /* for downcalls and attributes and lookups */
......
...@@ -17,11 +17,12 @@ ...@@ -17,11 +17,12 @@
* coda fs inode data * coda fs inode data
*/ */
struct coda_inode_info { struct coda_inode_info {
struct ViceFid c_fid; /* Coda identifier */ struct CodaFid c_fid; /* Coda identifier */
u_short c_flags; /* flags (see below) */ u_short c_flags; /* flags (see below) */
struct list_head c_cilist; /* list of all coda inodes */ struct list_head c_cilist; /* list of all coda inodes */
unsigned int c_mapcount; /* nr of times this inode is mapped */ unsigned int c_mapcount; /* nr of times this inode is mapped */
struct coda_cred c_cached_cred; /* credentials of cached perms */ unsigned int c_cached_epoch; /* epoch for cached permissions */
vuid_t c_uid; /* fsuid for cached permissions */
unsigned int c_cached_perm; /* cached access permissions */ unsigned int c_cached_perm; /* cached access permissions */
struct inode vfs_inode; struct inode vfs_inode;
}; };
...@@ -34,7 +35,6 @@ struct coda_file_info { ...@@ -34,7 +35,6 @@ struct coda_file_info {
int cfi_magic; /* magic number */ int cfi_magic; /* magic number */
struct file *cfi_container; /* container file for this cnode */ struct file *cfi_container; /* container file for this cnode */
unsigned int cfi_mapcount; /* nr of times this file is mapped */ unsigned int cfi_mapcount; /* nr of times this file is mapped */
struct coda_cred cfi_cred; /* credentials of opener */
}; };
#define CODA_FTOC(file) ((struct coda_file_info *)((file)->private_data)) #define CODA_FTOC(file) ((struct coda_file_info *)((file)->private_data))
...@@ -45,11 +45,11 @@ struct coda_file_info { ...@@ -45,11 +45,11 @@ struct coda_file_info {
#define C_DYING 0x4 /* from venus (which died) */ #define C_DYING 0x4 /* from venus (which died) */
#define C_PURGE 0x8 #define C_PURGE 0x8
int coda_cnode_make(struct inode **, struct ViceFid *, struct super_block *); int coda_cnode_make(struct inode **, struct CodaFid *, struct super_block *);
struct inode *coda_iget(struct super_block *sb, struct ViceFid *fid, struct coda_vattr *attr); struct inode *coda_iget(struct super_block *sb, struct CodaFid *fid, struct coda_vattr *attr);
int coda_cnode_makectl(struct inode **inode, struct super_block *sb); int coda_cnode_makectl(struct inode **inode, struct super_block *sb);
struct inode *coda_fid_to_inode(ViceFid *fid, struct super_block *sb); struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb);
void coda_replace_fid(struct inode *, ViceFid *, ViceFid *); void coda_replace_fid(struct inode *, struct CodaFid *, struct CodaFid *);
#endif #endif
#endif #endif
...@@ -42,26 +42,21 @@ int coda_permission(struct inode *inode, int mask, struct nameidata *nd); ...@@ -42,26 +42,21 @@ int coda_permission(struct inode *inode, int mask, struct nameidata *nd);
int coda_revalidate_inode(struct dentry *); int coda_revalidate_inode(struct dentry *);
int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *);
int coda_setattr(struct dentry *, struct iattr *); int coda_setattr(struct dentry *, struct iattr *);
int coda_isnullfid(ViceFid *fid);
/* global variables */ /* global variables */
extern int coda_fake_statfs; extern int coda_fake_statfs;
/* this file: heloers */ /* this file: heloers */
static __inline__ struct ViceFid *coda_i2f(struct inode *); static __inline__ struct CodaFid *coda_i2f(struct inode *);
static __inline__ char *coda_i2s(struct inode *); static __inline__ char *coda_i2s(struct inode *);
static __inline__ void coda_flag_inode(struct inode *, int flag); static __inline__ void coda_flag_inode(struct inode *, int flag);
char *coda_f2s(ViceFid *f); char *coda_f2s(struct CodaFid *f);
int coda_isroot(struct inode *i); int coda_isroot(struct inode *i);
int coda_iscontrol(const char *name, size_t length); int coda_iscontrol(const char *name, size_t length);
void coda_load_creds(struct coda_cred *cred);
void coda_vattr_to_iattr(struct inode *, struct coda_vattr *); void coda_vattr_to_iattr(struct inode *, struct coda_vattr *);
void coda_iattr_to_vattr(struct iattr *, struct coda_vattr *); void coda_iattr_to_vattr(struct iattr *, struct coda_vattr *);
unsigned short coda_flags_to_cflags(unsigned short); unsigned short coda_flags_to_cflags(unsigned short);
void print_vattr( struct coda_vattr *attr );
int coda_cred_ok(struct coda_cred *cred);
int coda_cred_eq(struct coda_cred *cred1, struct coda_cred *cred2);
/* sysctl.h */ /* sysctl.h */
void coda_sysctl_init(void); void coda_sysctl_init(void);
...@@ -88,7 +83,7 @@ static inline struct coda_inode_info *ITOC(struct inode *inode) ...@@ -88,7 +83,7 @@ static inline struct coda_inode_info *ITOC(struct inode *inode)
return list_entry(inode, struct coda_inode_info, vfs_inode); return list_entry(inode, struct coda_inode_info, vfs_inode);
} }
static __inline__ struct ViceFid *coda_i2f(struct inode *inode) static __inline__ struct CodaFid *coda_i2f(struct inode *inode)
{ {
return &(ITOC(inode)->c_fid); return &(ITOC(inode)->c_fid);
} }
......
...@@ -6,13 +6,11 @@ ...@@ -6,13 +6,11 @@
#define CODA_SUPER_MAGIC 0x73757245 #define CODA_SUPER_MAGIC 0x73757245
struct statfs; struct kstatfs;
struct coda_sb_info struct coda_sb_info
{ {
struct venus_comm * sbi_vcomm; struct venus_comm *sbi_vcomm;
struct super_block *sbi_sb;
struct list_head sbi_cihead;
}; };
/* communication pending/processing queues */ /* communication pending/processing queues */
...@@ -33,46 +31,45 @@ static inline struct coda_sb_info *coda_sbp(struct super_block *sb) ...@@ -33,46 +31,45 @@ static inline struct coda_sb_info *coda_sbp(struct super_block *sb)
/* upcalls */ /* upcalls */
int venus_rootfid(struct super_block *sb, ViceFid *fidp); int venus_rootfid(struct super_block *sb, struct CodaFid *fidp);
int venus_getattr(struct super_block *sb, struct ViceFid *fid, int venus_getattr(struct super_block *sb, struct CodaFid *fid,
struct coda_vattr *attr); struct coda_vattr *attr);
int venus_setattr(struct super_block *, struct ViceFid *, int venus_setattr(struct super_block *, struct CodaFid *, struct coda_vattr *);
struct coda_vattr *); int venus_lookup(struct super_block *sb, struct CodaFid *fid,
int venus_lookup(struct super_block *sb, struct ViceFid *fid, const char *name, int length, int *type,
const char *name, int length, int *type, struct CodaFid *resfid);
struct ViceFid *resfid); int venus_store(struct super_block *sb, struct CodaFid *fid, int flags,
int venus_store(struct super_block *sb, struct ViceFid *fid, int flags, vuid_t uid);
struct coda_cred *); int venus_release(struct super_block *sb, struct CodaFid *fid, int flags);
int venus_release(struct super_block *sb, struct ViceFid *fid, int flags); int venus_close(struct super_block *sb, struct CodaFid *fid, int flags,
int venus_close(struct super_block *sb, struct ViceFid *fid, int flags, vuid_t uid);
struct coda_cred *); int venus_open(struct super_block *sb, struct CodaFid *fid, int flags,
int venus_open(struct super_block *sb, struct ViceFid *fid, struct file **f);
int flags, struct file **f); int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid,
int venus_mkdir(struct super_block *sb, struct ViceFid *dirfid,
const char *name, int length, const char *name, int length,
struct ViceFid *newfid, struct coda_vattr *attrs); struct CodaFid *newfid, struct coda_vattr *attrs);
int venus_create(struct super_block *sb, struct ViceFid *dirfid, int venus_create(struct super_block *sb, struct CodaFid *dirfid,
const char *name, int length, int excl, int mode, dev_t rdev, const char *name, int length, int excl, int mode, dev_t rdev,
struct ViceFid *newfid, struct coda_vattr *attrs) ; struct CodaFid *newfid, struct coda_vattr *attrs) ;
int venus_rmdir(struct super_block *sb, struct ViceFid *dirfid, int venus_rmdir(struct super_block *sb, struct CodaFid *dirfid,
const char *name, int length); const char *name, int length);
int venus_remove(struct super_block *sb, struct ViceFid *dirfid, int venus_remove(struct super_block *sb, struct CodaFid *dirfid,
const char *name, int length); const char *name, int length);
int venus_readlink(struct super_block *sb, struct ViceFid *fid, int venus_readlink(struct super_block *sb, struct CodaFid *fid,
char *buffer, int *length); char *buffer, int *length);
int venus_rename(struct super_block *, struct ViceFid *new_fid, int venus_rename(struct super_block *, struct CodaFid *new_fid,
struct ViceFid *old_fid, size_t old_length, struct CodaFid *old_fid, size_t old_length,
size_t new_length, const char *old_name, size_t new_length, const char *old_name,
const char *new_name); const char *new_name);
int venus_link(struct super_block *sb, struct ViceFid *fid, int venus_link(struct super_block *sb, struct CodaFid *fid,
struct ViceFid *dirfid, const char *name, int len ); struct CodaFid *dirfid, const char *name, int len );
int venus_symlink(struct super_block *sb, struct ViceFid *fid, int venus_symlink(struct super_block *sb, struct CodaFid *fid,
const char *name, int len, const char *symname, int symlen); const char *name, int len, const char *symname, int symlen);
int venus_access(struct super_block *sb, struct ViceFid *fid, int mask); int venus_access(struct super_block *sb, struct CodaFid *fid, int mask);
int venus_pioctl(struct super_block *sb, struct ViceFid *fid, int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
unsigned int cmd, struct PioctlData *data); unsigned int cmd, struct PioctlData *data);
int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb); int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb);
int venus_fsync(struct super_block *sb, struct ViceFid *fid); int venus_fsync(struct super_block *sb, struct CodaFid *fid);
int venus_statfs(struct super_block *sb, struct kstatfs *sfs); int venus_statfs(struct super_block *sb, struct kstatfs *sfs);
......
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