Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
50a02d70
Commit
50a02d70
authored
Sep 16, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/davem/sparc-2.5
into laptop.osdl.org:/home/torvalds/v2.5/linux
parents
793ca9b7
d7d65a95
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
255 additions
and
349 deletions
+255
-349
fs/Kconfig
fs/Kconfig
+14
-0
fs/coda/cache.c
fs/coda/cache.c
+11
-14
fs/coda/cnode.c
fs/coda/cnode.c
+9
-20
fs/coda/coda_linux.c
fs/coda/coda_linux.c
+6
-81
fs/coda/dir.c
fs/coda/dir.c
+5
-6
fs/coda/file.c
fs/coda/file.c
+2
-3
fs/coda/inode.c
fs/coda/inode.c
+3
-10
fs/coda/psdev.c
fs/coda/psdev.c
+13
-13
fs/coda/upcall.c
fs/coda/upcall.c
+59
-44
include/linux/coda.h
include/linux/coda.h
+91
-108
include/linux/coda_cache.h
include/linux/coda_cache.h
+1
-1
include/linux/coda_fs_i.h
include/linux/coda_fs_i.h
+7
-7
include/linux/coda_linux.h
include/linux/coda_linux.h
+3
-8
include/linux/coda_psdev.h
include/linux/coda_psdev.h
+31
-34
No files found.
fs/Kconfig
View file @
50a02d70
...
...
@@ -1562,6 +1562,20 @@ config CODA_FS
whenever you want), say M here and read
<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
tristate "InterMezzo file system support (replicating fs) (EXPERIMENTAL)"
depends on INET && EXPERIMENTAL
...
...
fs/coda/cache.c
View file @
50a02d70
...
...
@@ -23,13 +23,16 @@
#include <linux/coda_fs_i.h>
#include <linux/coda_cache.h>
static
atomic_t
permission_epoch
=
ATOMIC_INIT
(
0
);
/* replace or extend an acl cache hit */
void
coda_cache_enter
(
struct
inode
*
inode
,
int
mask
)
{
struct
coda_inode_info
*
cii
=
ITOC
(
inode
);
if
(
!
coda_cred_ok
(
&
cii
->
c_cached_cred
)
)
{
coda_load_creds
(
&
cii
->
c_cached_cred
);
cii
->
c_cached_epoch
=
atomic_read
(
&
permission_epoch
);
if
(
cii
->
c_uid
!=
current
->
fsuid
)
{
cii
->
c_uid
=
current
->
fsuid
;
cii
->
c_cached_perm
=
mask
;
}
else
cii
->
c_cached_perm
|=
mask
;
...
...
@@ -42,22 +45,15 @@ void coda_cache_clear_inode(struct inode *inode)
cii
->
c_cached_perm
=
0
;
}
/* remove all acl caches
for a principal (or all principals when cred == NULL)
*/
void
coda_cache_clear_all
(
struct
super_block
*
sb
,
struct
coda_cred
*
cred
)
/* remove all acl caches */
void
coda_cache_clear_all
(
struct
super_block
*
sb
)
{
struct
coda_sb_info
*
sbi
;
struct
coda_inode_info
*
cii
;
struct
list_head
*
tmp
;
sbi
=
coda_sbp
(
sb
);
if
(
!
sbi
)
BUG
();
list_for_each
(
tmp
,
&
sbi
->
sbi_cihead
)
{
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
;
}
atomic_inc
(
&
permission_epoch
);
}
...
...
@@ -67,8 +63,9 @@ int coda_cache_check(struct inode *inode, int mask)
struct
coda_inode_info
*
cii
=
ITOC
(
inode
);
int
hit
;
hit
=
((
mask
&
cii
->
c_cached_perm
)
==
mask
)
&&
coda_cred_ok
(
&
cii
->
c_cached_cred
);
hit
=
(
mask
&
cii
->
c_cached_perm
)
==
mask
&&
cii
->
c_uid
==
current
->
fsuid
&&
cii
->
c_cached_epoch
==
atomic_read
(
&
permission_epoch
);
return
hit
;
}
...
...
fs/coda/cnode.c
View file @
50a02d70
...
...
@@ -11,18 +11,9 @@
#include <linux/coda_fs_i.h>
#include <linux/coda_psdev.h>
inline
int
coda_fideq
(
ViceFid
*
fid1
,
Vice
Fid
*
fid2
)
inline
int
coda_fideq
(
struct
CodaFid
*
fid1
,
struct
Coda
Fid
*
fid2
)
{
if
(
fid1
->
Vnode
!=
fid2
->
Vnode
)
return
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
;
return
memcmp
(
fid1
,
fid2
,
sizeof
(
*
fid1
))
==
0
;
}
static
struct
inode_operations
coda_symlink_inode_operations
=
{
...
...
@@ -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
)
{
ViceFid
*
fid
=
(
Vice
Fid
*
)
data
;
struct
CodaFid
*
fid
=
(
struct
Coda
Fid
*
)
data
;
return
coda_fideq
(
&
(
ITOC
(
inode
)
->
c_fid
),
fid
);
}
static
int
coda_set_inode
(
struct
inode
*
inode
,
void
*
data
)
{
ViceFid
*
fid
=
(
Vice
Fid
*
)
data
;
struct
CodaFid
*
fid
=
(
struct
Coda
Fid
*
)
data
;
ITOC
(
inode
)
->
c_fid
=
*
fid
;
return
0
;
}
...
...
@@ -68,12 +59,11 @@ static int coda_fail_inode(struct inode *inode, void *data)
return
-
1
;
}
struct
inode
*
coda_iget
(
struct
super_block
*
sb
,
Vice
Fid
*
fid
,
struct
inode
*
coda_iget
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
struct
coda_vattr
*
attr
)
{
struct
inode
*
inode
;
struct
coda_inode_info
*
cii
;
struct
coda_sb_info
*
sbi
=
coda_sbp
(
sb
);
unsigned
long
hash
=
coda_f2i
(
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,
/* we still need to set i_ino for things like stat(2) */
inode
->
i_ino
=
hash
;
cii
->
c_mapcount
=
0
;
list_add
(
&
cii
->
c_cilist
,
&
sbi
->
sbi_cihead
);
unlock_new_inode
(
inode
);
}
...
...
@@ -101,7 +90,7 @@ struct inode * coda_iget(struct super_block * sb, ViceFid * fid,
- link the two up if this is needed
- fill in the attributes
*/
int
coda_cnode_make
(
struct
inode
**
inode
,
Vice
Fid
*
fid
,
struct
super_block
*
sb
)
int
coda_cnode_make
(
struct
inode
**
inode
,
struct
Coda
Fid
*
fid
,
struct
super_block
*
sb
)
{
struct
coda_vattr
attr
;
int
error
;
...
...
@@ -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
Vice
Fid
*
oldfid
,
struct
Vice
Fid
*
newfid
)
void
coda_replace_fid
(
struct
inode
*
inode
,
struct
Coda
Fid
*
oldfid
,
struct
Coda
Fid
*
newfid
)
{
struct
coda_inode_info
*
cii
;
unsigned
long
hash
=
coda_f2i
(
newfid
);
...
...
@@ -142,7 +131,7 @@ void coda_replace_fid(struct inode *inode, struct ViceFid *oldfid,
}
/* convert a fid to an inode. */
struct
inode
*
coda_fid_to_inode
(
Vice
Fid
*
fid
,
struct
super_block
*
sb
)
struct
inode
*
coda_fid_to_inode
(
struct
Coda
Fid
*
fid
,
struct
super_block
*
sb
)
{
struct
inode
*
inode
;
unsigned
long
hash
=
coda_f2i
(
fid
);
...
...
fs/coda/coda_linux.c
View file @
50a02d70
...
...
@@ -25,10 +25,14 @@
int
coda_fake_statfs
;
/* print a fid */
char
*
coda_f2s
(
Vice
Fid
*
f
)
char
*
coda_f2s
(
struct
Coda
Fid
*
f
)
{
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
;
}
...
...
@@ -45,30 +49,6 @@ int coda_isroot(struct 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
=
0
;
...
...
@@ -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
);
}
fs/coda/dir.c
View file @
50a02d70
...
...
@@ -93,7 +93,7 @@ struct file_operations coda_dir_operations = {
static
struct
dentry
*
coda_lookup
(
struct
inode
*
dir
,
struct
dentry
*
entry
,
struct
nameidata
*
nd
)
{
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
type
=
0
;
int
error
=
0
;
...
...
@@ -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
;
int
length
=
de
->
d_name
.
len
;
struct
inode
*
inode
;
struct
Vice
Fid
newfid
;
struct
Coda
Fid
newfid
;
struct
coda_vattr
attrs
;
lock_kernel
();
...
...
@@ -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
;
int
length
=
de
->
d_name
.
len
;
struct
inode
*
inode
;
struct
Vice
Fid
newfid
;
struct
Coda
Fid
newfid
;
struct
coda_vattr
attrs
;
if
(
coda_hasmknod
==
0
)
...
...
@@ -283,7 +283,7 @@ static int coda_mkdir(struct inode *dir, struct dentry *de, int mode)
const
char
*
name
=
de
->
d_name
.
name
;
int
len
=
de
->
d_name
.
len
;
int
error
;
struct
Vice
Fid
newfid
;
struct
Coda
Fid
newfid
;
lock_kernel
();
coda_vfs_stat
.
mkdir
++
;
...
...
@@ -588,8 +588,7 @@ static int coda_venus_readdir(struct file *filp, filldir_t filldir,
break
;
}
/* validate whether the directory file actually makes sense */
if
(
vdir
->
d_reclen
<
vdir_size
+
vdir
->
d_namlen
||
vdir
->
d_namlen
>
CODA_MAXNAMLEN
)
{
if
(
vdir
->
d_reclen
<
vdir_size
+
vdir
->
d_namlen
)
{
printk
(
"coda_venus_readdir: Invalid dir: %ld
\n
"
,
filp
->
f_dentry
->
d_inode
->
i_ino
);
ret
=
-
EBADF
;
...
...
fs/coda/file.c
View file @
50a02d70
...
...
@@ -136,7 +136,6 @@ int coda_open(struct inode *coda_inode, struct file *coda_file)
cfi
->
cfi_magic
=
CODA_MAGIC
;
cfi
->
cfi_mapcount
=
0
;
cfi
->
cfi_container
=
host_file
;
coda_load_creds
(
&
cfi
->
cfi_cred
);
BUG_ON
(
coda_file
->
private_data
!=
NULL
);
coda_file
->
private_data
=
cfi
;
...
...
@@ -176,7 +175,7 @@ int coda_flush(struct file *coda_file)
coda_inode
=
coda_file
->
f_dentry
->
d_inode
;
err
=
venus_store
(
coda_inode
->
i_sb
,
coda_i2f
(
coda_inode
),
coda_flags
,
&
cfi
->
cfi_cre
d
);
coda_file
->
f_ui
d
);
if
(
err
==
-
EOPNOTSUPP
)
{
use_coda_close
=
1
;
...
...
@@ -214,7 +213,7 @@ int coda_release(struct inode *coda_inode, struct file *coda_file)
if
(
use_coda_close
)
err
=
venus_close
(
coda_inode
->
i_sb
,
coda_i2f
(
coda_inode
),
coda_flags
,
&
cfi
->
cfi_cre
d
);
coda_flags
,
coda_file
->
f_ui
d
);
host_inode
=
cfi
->
cfi_container
->
f_dentry
->
d_inode
;
cii
=
ITOC
(
coda_inode
);
...
...
fs/coda/inode.c
View file @
50a02d70
...
...
@@ -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
);
if
(
!
ei
)
return
NULL
;
memset
(
&
ei
->
c_fid
,
0
,
sizeof
(
struct
Vice
Fid
));
memset
(
&
ei
->
c_fid
,
0
,
sizeof
(
struct
Coda
Fid
));
ei
->
c_flags
=
0
;
INIT_LIST_HEAD
(
&
ei
->
c_cilist
);
memset
(
&
ei
->
c_cached_cred
,
0
,
sizeof
(
struct
coda_cred
));
ei
->
c_uid
=
0
;
ei
->
c_cached_perm
=
0
;
return
&
ei
->
vfs_inode
;
}
...
...
@@ -139,7 +138,7 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
struct
inode
*
root
=
0
;
struct
coda_sb_info
*
sbi
=
NULL
;
struct
venus_comm
*
vc
=
NULL
;
Vice
Fid
fid
;
struct
Coda
Fid
fid
;
int
error
;
int
idx
;
...
...
@@ -169,9 +168,7 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
vc
->
vc_sb
=
sb
;
sbi
->
sbi_sb
=
sb
;
sbi
->
sbi_vcomm
=
vc
;
INIT_LIST_HEAD
(
&
sbi
->
sbi_cihead
);
sb
->
s_fs_info
=
sbi
;
sb
->
s_blocksize
=
1024
;
/* XXXXX what do we put here?? */
...
...
@@ -218,7 +215,6 @@ static void coda_put_super(struct super_block *sb)
sbi
=
coda_sbp
(
sb
);
sbi
->
sbi_vcomm
->
vc_sb
=
NULL
;
list_del_init
(
&
sbi
->
sbi_cihead
);
printk
(
"Coda: Bye bye.
\n
"
);
kfree
(
sbi
);
...
...
@@ -226,9 +222,6 @@ static void coda_put_super(struct super_block *sb)
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
);
}
...
...
fs/coda/psdev.c
View file @
50a02d70
...
...
@@ -61,7 +61,6 @@ unsigned long coda_timeout = 30; /* .. secs, then signals will dequeue */
struct
venus_comm
coda_comms
[
MAX_CODADEVS
];
kmem_cache_t
*
cii_cache
,
*
cred_cache
,
*
upc_cache
;
/*
* Device operations
...
...
@@ -126,13 +125,13 @@ static ssize_t coda_psdev_write(struct file *file, const char *buf,
}
if
(
nbytes
<
sizeof
(
struct
coda_out_hdr
)
)
{
printk
(
"coda_downcall opc %
ld uniq %l
d, not enough!
\n
"
,
printk
(
"coda_downcall opc %
d uniq %
d, not enough!
\n
"
,
hdr
.
opcode
,
hdr
.
unique
);
count
=
nbytes
;
goto
out
;
}
if
(
nbytes
>
size
)
{
printk
(
"Coda: downcall opc %
ld, uniq %l
d, too much!"
,
printk
(
"Coda: downcall opc %
d, uniq %
d, too much!"
,
hdr
.
opcode
,
hdr
.
unique
);
nbytes
=
size
;
}
...
...
@@ -171,7 +170,7 @@ static ssize_t coda_psdev_write(struct file *file, const char *buf,
unlock_kernel
();
if
(
!
req
)
{
printk
(
"psdev_write: msg (%
ld, %l
d) not found
\n
"
,
printk
(
"psdev_write: msg (%
d, %
d) not found
\n
"
,
hdr
.
opcode
,
hdr
.
unique
);
retval
=
-
ESRCH
;
goto
out
;
...
...
@@ -179,7 +178,7 @@ static ssize_t coda_psdev_write(struct file *file, const char *buf,
/* move data into response buffer. */
if
(
req
->
uc_outSize
<
nbytes
)
{
printk
(
"psdev_write: too much cnt: %d, cnt: %ld, opc: %
ld, uniq: %l
d.
\n
"
,
printk
(
"psdev_write: too much cnt: %d, cnt: %ld, opc: %
d, uniq: %
d.
\n
"
,
req
->
uc_outSize
,
(
long
)
nbytes
,
hdr
.
opcode
,
hdr
.
unique
);
nbytes
=
req
->
uc_outSize
;
/* don't have more space! */
}
...
...
@@ -325,10 +324,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file)
}
/* Wakeup clients so they can return. */
lh
=
vcp
->
vc_pending
.
next
;
next
=
lh
;
while
(
(
lh
=
next
)
!=
&
vcp
->
vc_pending
)
{
next
=
lh
->
next
;
list_for_each_safe
(
lh
,
next
,
&
vcp
->
vc_pending
)
{
req
=
list_entry
(
lh
,
struct
upc_req
,
uc_chain
);
/* Async requests need to be freed here */
if
(
req
->
uc_flags
&
REQ_ASYNC
)
{
...
...
@@ -340,9 +336,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file)
wake_up
(
&
req
->
uc_sleep
);
}
lh
=
&
vcp
->
vc_processing
;
while
(
(
lh
=
lh
->
next
)
!=
&
vcp
->
vc_processing
)
{
req
=
list_entry
(
lh
,
struct
upc_req
,
uc_chain
);
list_for_each_entry
(
req
,
&
vcp
->
vc_processing
,
uc_chain
)
{
req
->
uc_flags
|=
REQ_ABORT
;
wake_up
(
&
req
->
uc_sleep
);
}
...
...
@@ -390,7 +384,13 @@ static int __init init_coda(void)
{
int
status
;
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
();
if
(
status
)
...
...
fs/coda/upcall.c
View file @
50a02d70
...
...
@@ -55,8 +55,12 @@ static void *alloc_upcall(int opcode, int size)
inp
->
ih
.
opcode
=
opcode
;
inp
->
ih
.
pid
=
current
->
pid
;
inp
->
ih
.
pgid
=
current
->
pgrp
;
coda_load_creds
(
&
(
inp
->
ih
.
cred
));
#ifdef 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
return
(
void
*
)
inp
;
}
...
...
@@ -74,7 +78,7 @@ do {\
/* the upcalls */
int
venus_rootfid
(
struct
super_block
*
sb
,
Vice
Fid
*
fidp
)
int
venus_rootfid
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fidp
)
{
union
inputArgs
*
inp
;
union
outputArgs
*
outp
;
...
...
@@ -88,14 +92,14 @@ int venus_rootfid(struct super_block *sb, ViceFid *fidp)
if
(
error
)
{
printk
(
"coda_get_rootfid: error %d
\n
"
,
error
);
}
else
{
*
fidp
=
(
ViceFid
)
outp
->
coda_root
.
VFid
;
*
fidp
=
outp
->
coda_root
.
VFid
;
}
CODA_FREE
(
inp
,
insize
);
return
error
;
}
int
venus_getattr
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
venus_getattr
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
struct
coda_vattr
*
attr
)
{
union
inputArgs
*
inp
;
...
...
@@ -114,7 +118,7 @@ int venus_getattr(struct super_block *sb, struct ViceFid *fid,
return
error
;
}
int
venus_setattr
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
venus_setattr
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
struct
coda_vattr
*
vattr
)
{
union
inputArgs
*
inp
;
...
...
@@ -133,9 +137,9 @@ int venus_setattr(struct super_block *sb, struct ViceFid *fid,
return
error
;
}
int
venus_lookup
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
venus_lookup
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
const
char
*
name
,
int
length
,
int
*
type
,
struct
Vice
Fid
*
resfid
)
struct
Coda
Fid
*
resfid
)
{
union
inputArgs
*
inp
;
union
outputArgs
*
outp
;
...
...
@@ -162,17 +166,25 @@ int venus_lookup(struct super_block *sb, struct ViceFid *fid,
return
error
;
}
int
venus_store
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
flags
,
struct
coda_cred
*
cre
d
)
int
venus_store
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
int
flags
,
vuid_t
ui
d
)
{
union
inputArgs
*
inp
;
union
outputArgs
*
outp
;
int
insize
,
outsize
,
error
;
#ifdef CODA_FS_OLD_API
struct
coda_cred
cred
=
{
0
,
};
cred
.
cr_fsuid
=
uid
;
#endif
insize
=
SIZE
(
store
);
UPARG
(
CODA_STORE
);
memcpy
(
&
(
inp
->
ih
.
cred
),
cred
,
sizeof
(
*
cred
));
#ifdef 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
;
...
...
@@ -183,7 +195,7 @@ int venus_store(struct super_block *sb, struct ViceFid *fid, int flags,
return
error
;
}
int
venus_release
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
flags
)
int
venus_release
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
int
flags
)
{
union
inputArgs
*
inp
;
union
outputArgs
*
outp
;
...
...
@@ -201,17 +213,25 @@ int venus_release(struct super_block *sb, struct ViceFid *fid, int flags)
return
error
;
}
int
venus_close
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
flags
,
struct
coda_cred
*
cre
d
)
int
venus_close
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
int
flags
,
vuid_t
ui
d
)
{
union
inputArgs
*
inp
;
union
outputArgs
*
outp
;
int
insize
,
outsize
,
error
;
#ifdef CODA_FS_OLD_API
struct
coda_cred
cred
=
{
0
,
};
cred
.
cr_fsuid
=
uid
;
#endif
insize
=
SIZE
(
release
);
UPARG
(
CODA_CLOSE
);
memcpy
(
&
(
inp
->
ih
.
cred
),
cred
,
sizeof
(
*
cred
));
#ifdef 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
;
...
...
@@ -222,7 +242,7 @@ int venus_close(struct super_block *sb, struct ViceFid *fid, int flags,
return
error
;
}
int
venus_open
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
venus_open
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
int
flags
,
struct
file
**
fh
)
{
union
inputArgs
*
inp
;
...
...
@@ -243,9 +263,9 @@ int venus_open(struct super_block *sb, struct ViceFid *fid,
return
error
;
}
int
venus_mkdir
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
dirfid
,
int
venus_mkdir
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
dirfid
,
const
char
*
name
,
int
length
,
struct
Vice
Fid
*
newfid
,
struct
coda_vattr
*
attrs
)
struct
Coda
Fid
*
newfid
,
struct
coda_vattr
*
attrs
)
{
union
inputArgs
*
inp
;
union
outputArgs
*
outp
;
...
...
@@ -273,8 +293,8 @@ int venus_mkdir(struct super_block *sb, struct ViceFid *dirfid,
}
int
venus_rename
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
old_fid
,
struct
Vice
Fid
*
new_fid
,
size_t
old_length
,
int
venus_rename
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
old_fid
,
struct
Coda
Fid
*
new_fid
,
size_t
old_length
,
size_t
new_length
,
const
char
*
old_name
,
const
char
*
new_name
)
{
...
...
@@ -310,9 +330,9 @@ int venus_rename(struct super_block *sb, struct ViceFid *old_fid,
return
error
;
}
int
venus_create
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
dirfid
,
int
venus_create
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
dirfid
,
const
char
*
name
,
int
length
,
int
excl
,
int
mode
,
dev_t
rdev
,
struct
Vice
Fid
*
newfid
,
struct
coda_vattr
*
attrs
)
struct
Coda
Fid
*
newfid
,
struct
coda_vattr
*
attrs
)
{
union
inputArgs
*
inp
;
union
outputArgs
*
outp
;
...
...
@@ -343,7 +363,7 @@ int venus_create(struct super_block *sb, struct ViceFid *dirfid,
return
error
;
}
int
venus_rmdir
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
dirfid
,
int
venus_rmdir
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
dirfid
,
const
char
*
name
,
int
length
)
{
union
inputArgs
*
inp
;
...
...
@@ -366,7 +386,7 @@ int venus_rmdir(struct super_block *sb, struct ViceFid *dirfid,
return
error
;
}
int
venus_remove
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
dirfid
,
int
venus_remove
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
dirfid
,
const
char
*
name
,
int
length
)
{
union
inputArgs
*
inp
;
...
...
@@ -388,7 +408,7 @@ int venus_remove(struct super_block *sb, struct ViceFid *dirfid,
return
error
;
}
int
venus_readlink
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
venus_readlink
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
char
*
buffer
,
int
*
length
)
{
union
inputArgs
*
inp
;
...
...
@@ -421,8 +441,8 @@ int venus_readlink(struct super_block *sb, struct ViceFid *fid,
int
venus_link
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
struct
Vice
Fid
*
dirfid
,
const
char
*
name
,
int
len
)
int
venus_link
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
struct
Coda
Fid
*
dirfid
,
const
char
*
name
,
int
len
)
{
union
inputArgs
*
inp
;
union
outputArgs
*
outp
;
...
...
@@ -447,7 +467,7 @@ int venus_link(struct super_block *sb, struct ViceFid *fid,
return
error
;
}
int
venus_symlink
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
venus_symlink
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
const
char
*
name
,
int
len
,
const
char
*
symname
,
int
symlen
)
{
...
...
@@ -482,7 +502,7 @@ int venus_symlink(struct super_block *sb, struct ViceFid *fid,
return
error
;
}
int
venus_fsync
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
)
int
venus_fsync
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
)
{
union
inputArgs
*
inp
;
union
outputArgs
*
outp
;
...
...
@@ -499,7 +519,7 @@ int venus_fsync(struct super_block *sb, struct ViceFid *fid)
return
error
;
}
int
venus_access
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
mask
)
int
venus_access
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
int
mask
)
{
union
inputArgs
*
inp
;
union
outputArgs
*
outp
;
...
...
@@ -518,7 +538,7 @@ int venus_access(struct super_block *sb, struct ViceFid *fid, int mask)
}
int
venus_pioctl
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
venus_pioctl
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
unsigned
int
cmd
,
struct
PioctlData
*
data
)
{
union
inputArgs
*
inp
;
...
...
@@ -808,7 +828,7 @@ static int coda_upcall(struct coda_sb_info *sbi,
* The last allows Venus to replace local fids with global ones
* during reintegration.
*
* CODA_REPLACE -- replace one
Vice
Fid with another throughout the name cache */
* CODA_REPLACE -- replace one
Coda
Fid with another throughout the name cache */
int
coda_downcall
(
int
opcode
,
union
outputArgs
*
out
,
struct
super_block
*
sb
)
{
...
...
@@ -819,25 +839,20 @@ int coda_downcall(int opcode, union outputArgs * out, struct super_block *sb)
switch
(
opcode
)
{
case
CODA_FLUSH
:
{
coda_cache_clear_all
(
sb
,
NULL
);
coda_cache_clear_all
(
sb
);
shrink_dcache_sb
(
sb
);
coda_flag_inode
(
sb
->
s_root
->
d_inode
,
C_FLUSH
);
return
(
0
);
}
case
CODA_PURGEUSER
:
{
struct
coda_cred
*
cred
=
&
out
->
coda_purgeuser
.
cred
;
if
(
!
cred
)
{
printk
(
"PURGEUSER: null cred!
\n
"
);
return
0
;
}
coda_cache_clear_all
(
sb
,
cred
);
coda_cache_clear_all
(
sb
);
return
(
0
);
}
case
CODA_ZAPDIR
:
{
struct
inode
*
inode
;
Vice
Fid
*
fid
=
&
out
->
coda_zapdir
.
CodaFid
;
struct
Coda
Fid
*
fid
=
&
out
->
coda_zapdir
.
CodaFid
;
inode
=
coda_fid_to_inode
(
fid
,
sb
);
if
(
inode
)
{
...
...
@@ -851,7 +866,7 @@ int coda_downcall(int opcode, union outputArgs * out, struct super_block *sb)
case
CODA_ZAPFILE
:
{
struct
inode
*
inode
;
struct
Vice
Fid
*
fid
=
&
out
->
coda_zapfile
.
CodaFid
;
struct
Coda
Fid
*
fid
=
&
out
->
coda_zapfile
.
CodaFid
;
inode
=
coda_fid_to_inode
(
fid
,
sb
);
if
(
inode
)
{
coda_flag_inode
(
inode
,
C_VATTR
);
...
...
@@ -862,7 +877,7 @@ int coda_downcall(int opcode, union outputArgs * out, struct super_block *sb)
case
CODA_PURGEFID
:
{
struct
inode
*
inode
;
Vice
Fid
*
fid
=
&
out
->
coda_purgefid
.
CodaFid
;
struct
Coda
Fid
*
fid
=
&
out
->
coda_purgefid
.
CodaFid
;
inode
=
coda_fid_to_inode
(
fid
,
sb
);
if
(
inode
)
{
coda_flag_inode_children
(
inode
,
C_PURGE
);
...
...
@@ -878,8 +893,8 @@ int coda_downcall(int opcode, union outputArgs * out, struct super_block *sb)
case
CODA_REPLACE
:
{
struct
inode
*
inode
;
Vice
Fid
*
oldfid
=
&
out
->
coda_replace
.
OldFid
;
Vice
Fid
*
newfid
=
&
out
->
coda_replace
.
NewFid
;
struct
Coda
Fid
*
oldfid
=
&
out
->
coda_replace
.
OldFid
;
struct
Coda
Fid
*
newfid
=
&
out
->
coda_replace
.
NewFid
;
inode
=
coda_fid_to_inode
(
oldfid
,
sb
);
if
(
inode
)
{
coda_replace_fid
(
inode
,
oldfid
,
newfid
);
...
...
include/linux/coda.h
View file @
50a02d70
...
...
@@ -59,7 +59,7 @@ Mellon the rights to redistribute these changes without encumbrance.
#ifndef _CODA_HEADER_
#define _CODA_HEADER_
#include <linux/config.h>
/* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */
#if defined(__NetBSD__) || \
...
...
@@ -163,10 +163,10 @@ typedef unsigned int u_int32_t;
#ifndef _VENUS_DIRENT_T_
#define _VENUS_DIRENT_T_ 1
struct
venus_dirent
{
u
nsigned
long
d_fileno
;
/* file number of entry */
u
nsigned
short
d_reclen
;
/* length of this record */
u
nsigned
char
d_type
;
/* file type, see below */
u
nsigned
char
d_namlen
;
/* length of string in d_name */
u
_int32_t
d_fileno
;
/* file number of entry */
u
_int16_t
d_reclen
;
/* length of this record */
u
_int8_t
d_type
;
/* file type, see below */
u
_int8_t
d_namlen
;
/* length of string in d_name */
char
d_name
[
CODA_MAXNAMLEN
+
1
];
/* name must be no longer than this */
};
#undef DIRSIZ
...
...
@@ -194,53 +194,41 @@ struct venus_dirent {
#endif
#ifndef _FID_T_
#define _FID_T_ 1
typedef
u_long
VolumeId
;
typedef
u_long
VnodeId
;
typedef
u_long
Unique_t
;
typedef
u_long
FileVersion
;
#endif
#ifndef _VICEFID_T_
#define _VICEFID_T_ 1
typedef
struct
ViceFid
{
VolumeId
Volume
;
VnodeId
Vnode
;
Unique_t
Unique
;
}
ViceFid
;
#endif
/* VICEFID */
#ifndef _VUID_T_
#define _VUID_T_
typedef
u_int32_t
vuid_t
;
typedef
u_int32_t
vgid_t
;
#endif
/*_VUID_T_ */
#ifdef CODA_FS_OLD_API
struct
CodaFid
{
u_int32_t
opaque
[
3
];
};
#ifdef __linux__
static
__inline__
ino_t
coda_f2i
(
struct
ViceFid
*
fid
)
static
__inline__
ino_t
coda_f2i
(
struct
CodaFid
*
fid
)
{
if
(
!
fid
)
return
0
;
if
(
fid
->
Vnode
==
0xfffffffe
||
fid
->
Vnode
==
0xffffffff
)
return
((
fid
->
Volume
<<
20
)
|
(
fid
->
Unique
&
0xfffff
));
if
(
fid
->
opaque
[
1
]
==
0xfffffffe
||
fid
->
opaque
[
1
]
==
0xffffffff
)
return
((
fid
->
opaque
[
0
]
<<
20
)
|
(
fid
->
opaque
[
2
]
&
0xfffff
));
else
return
(
fid
->
Unique
+
(
fid
->
Vnode
<<
10
)
+
(
fid
->
Volume
<<
20
));
return
(
fid
->
opaque
[
2
]
+
(
fid
->
opaque
[
1
]
<<
10
)
+
(
fid
->
opaque
[
0
]
<<
20
));
}
#else
#define coda_f2i(fid)\
((fid) ? ((fid)->Unique + ((fid)->Vnode<<10) + ((fid)->Volume<<20)) : 0)
#endif
#ifndef _VUID_T_
#define _VUID_T_
typedef
u_int32_t
vuid_t
;
typedef
u_int32_t
vgid_t
;
#endif
/*_VUID_T_ */
#ifndef _CODACRED_T_
#define _CODACRED_T_
struct
coda_cred
{
vuid_t
cr_uid
,
cr_euid
,
cr_suid
,
cr_fsuid
;
/* Real, efftve, set, fs uid*/
vgid_t
cr_groupid
,
cr_egid
,
cr_sgid
,
cr_fsgid
;
/* same for groups */
};
#else
/* not defined(CODA_FS_OLD_API) */
struct
CodaFid
{
u_int32_t
opaque
[
4
];
};
#define coda_f2i(fid)\
(fid ? (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]) : 0)
#endif
#ifndef _VENUS_VATTR_T_
...
...
@@ -330,31 +318,41 @@ struct coda_statfs {
#define CODA_KERNEL_VERSION 0 /* don't care about kernel version number */
#define CODA_KERNEL_VERSION 1 /* The old venus 4.6 compatible interface */
#endif
#define CODA_KERNEL_VERSION 2
/* venus_lookup gets an extra parameter */
#ifdef CODA_FS_OLD_API
#define CODA_KERNEL_VERSION 2
/* venus_lookup got an extra parameter */
#else
#define CODA_KERNEL_VERSION 3
/* 128-bit file identifiers */
#endif
/*
* Venus <-> Coda RPC arguments
*/
struct
coda_in_hdr
{
unsigned
long
opcode
;
unsigned
long
unique
;
/* Keep multiple outstanding msgs distinct */
u_short
pid
;
/* Common to all */
u_short
pgid
;
/* Common to all */
u_short
sid
;
/* Common to all */
u_int32_t
opcode
;
u_int32_t
unique
;
/* Keep multiple outstanding msgs distinct */
#ifdef CODA_FS_OLD_API
u_int16_t
pid
;
/* Common to all */
u_int16_t
pgid
;
/* Common to all */
u_int16_t
sid
;
/* Common to all */
struct
coda_cred
cred
;
/* Common to all */
#else
pid_t
pid
;
pid_t
pgid
;
vuid_t
uid
;
#endif
};
/* Really important that opcode and unique are 1st two fields! */
struct
coda_out_hdr
{
u
nsigned
long
opcode
;
u
nsigned
long
unique
;
u
nsigned
long
result
;
u
_int32_t
opcode
;
u
_int32_t
unique
;
u
_int32_t
result
;
};
/* coda_root: NO_IN */
struct
coda_root_out
{
struct
coda_out_hdr
oh
;
Vice
Fid
VFid
;
struct
Coda
Fid
VFid
;
};
struct
coda_root_in
{
...
...
@@ -364,7 +362,7 @@ struct coda_root_in {
/* coda_open: */
struct
coda_open_in
{
struct
coda_in_hdr
ih
;
ViceFid
VFid
;
struct
CodaFid
VFid
;
int
flags
;
};
...
...
@@ -378,7 +376,7 @@ struct coda_open_out {
/* coda_store: */
struct
coda_store_in
{
struct
coda_in_hdr
ih
;
ViceFid
VFid
;
struct
CodaFid
VFid
;
int
flags
;
};
...
...
@@ -389,7 +387,7 @@ struct coda_store_out {
/* coda_release: */
struct
coda_release_in
{
struct
coda_in_hdr
ih
;
ViceFid
VFid
;
struct
CodaFid
VFid
;
int
flags
;
};
...
...
@@ -400,7 +398,7 @@ struct coda_release_out {
/* coda_close: */
struct
coda_close_in
{
struct
coda_in_hdr
ih
;
ViceFid
VFid
;
struct
CodaFid
VFid
;
int
flags
;
};
...
...
@@ -411,7 +409,7 @@ struct coda_close_out {
/* coda_ioctl: */
struct
coda_ioctl_in
{
struct
coda_in_hdr
ih
;
Vice
Fid
VFid
;
struct
Coda
Fid
VFid
;
int
cmd
;
int
len
;
int
rwflag
;
...
...
@@ -428,7 +426,7 @@ struct coda_ioctl_out {
/* coda_getattr: */
struct
coda_getattr_in
{
struct
coda_in_hdr
ih
;
Vice
Fid
VFid
;
struct
Coda
Fid
VFid
;
};
struct
coda_getattr_out
{
...
...
@@ -440,7 +438,7 @@ struct coda_getattr_out {
/* coda_setattr: NO_OUT */
struct
coda_setattr_in
{
struct
coda_in_hdr
ih
;
Vice
Fid
VFid
;
struct
Coda
Fid
VFid
;
struct
coda_vattr
attr
;
};
...
...
@@ -451,7 +449,7 @@ struct coda_setattr_out {
/* coda_access: NO_OUT */
struct
coda_access_in
{
struct
coda_in_hdr
ih
;
ViceFid
VFid
;
struct
CodaFid
VFid
;
int
flags
;
};
...
...
@@ -467,14 +465,14 @@ struct coda_access_out {
/* coda_lookup: */
struct
coda_lookup_in
{
struct
coda_in_hdr
ih
;
ViceFid
VFid
;
struct
CodaFid
VFid
;
int
name
;
/* Place holder for data. */
int
flags
;
};
struct
coda_lookup_out
{
struct
coda_out_hdr
oh
;
Vice
Fid
VFid
;
struct
Coda
Fid
VFid
;
int
vtype
;
};
...
...
@@ -482,7 +480,7 @@ struct coda_lookup_out {
/* coda_create: */
struct
coda_create_in
{
struct
coda_in_hdr
ih
;
Vice
Fid
VFid
;
struct
Coda
Fid
VFid
;
struct
coda_vattr
attr
;
int
excl
;
int
mode
;
...
...
@@ -491,7 +489,7 @@ struct coda_create_in {
struct
coda_create_out
{
struct
coda_out_hdr
oh
;
Vice
Fid
VFid
;
struct
Coda
Fid
VFid
;
struct
coda_vattr
attr
;
};
...
...
@@ -499,7 +497,7 @@ struct coda_create_out {
/* coda_remove: NO_OUT */
struct
coda_remove_in
{
struct
coda_in_hdr
ih
;
ViceFid
VFid
;
struct
CodaFid
VFid
;
int
name
;
/* Place holder for data. */
};
...
...
@@ -510,8 +508,8 @@ struct coda_remove_out {
/* coda_link: NO_OUT */
struct
coda_link_in
{
struct
coda_in_hdr
ih
;
ViceFid
sourceFid
;
/* cnode to link *to* */
ViceFid
destFid
;
/* Directory in which to place link */
struct
CodaFid
sourceFid
;
/* cnode to link *to* */
struct
CodaFid
destFid
;
/* Directory in which to place link */
int
tname
;
/* Place holder for data. */
};
...
...
@@ -523,9 +521,9 @@ struct coda_link_out {
/* coda_rename: NO_OUT */
struct
coda_rename_in
{
struct
coda_in_hdr
ih
;
ViceFid
sourceFid
;
struct
CodaFid
sourceFid
;
int
srcname
;
Vice
Fid
destFid
;
struct
Coda
Fid
destFid
;
int
destname
;
};
...
...
@@ -536,14 +534,14 @@ struct coda_rename_out {
/* coda_mkdir: */
struct
coda_mkdir_in
{
struct
coda_in_hdr
ih
;
ViceFid
VFid
;
struct
CodaFid
VFid
;
struct
coda_vattr
attr
;
int
name
;
/* Place holder for data. */
};
struct
coda_mkdir_out
{
struct
coda_out_hdr
oh
;
Vice
Fid
VFid
;
struct
Coda
Fid
VFid
;
struct
coda_vattr
attr
;
};
...
...
@@ -551,7 +549,7 @@ struct coda_mkdir_out {
/* coda_rmdir: NO_OUT */
struct
coda_rmdir_in
{
struct
coda_in_hdr
ih
;
ViceFid
VFid
;
struct
CodaFid
VFid
;
int
name
;
/* Place holder for data. */
};
...
...
@@ -562,7 +560,7 @@ struct coda_rmdir_out {
/* coda_symlink: NO_OUT */
struct
coda_symlink_in
{
struct
coda_in_hdr
ih
;
ViceFid
VFid
;
/* Directory to put symlink in */
struct
CodaFid
VFid
;
/* Directory to put symlink in */
int
srcname
;
struct
coda_vattr
attr
;
int
tname
;
...
...
@@ -575,7 +573,7 @@ struct coda_symlink_out {
/* coda_readlink: */
struct
coda_readlink_in
{
struct
coda_in_hdr
ih
;
Vice
Fid
VFid
;
struct
Coda
Fid
VFid
;
};
struct
coda_readlink_out
{
...
...
@@ -588,7 +586,7 @@ struct coda_readlink_out {
/* coda_fsync: NO_OUT */
struct
coda_fsync_in
{
struct
coda_in_hdr
ih
;
Vice
Fid
VFid
;
struct
Coda
Fid
VFid
;
};
struct
coda_fsync_out
{
...
...
@@ -598,12 +596,12 @@ struct coda_fsync_out {
/* coda_vget: */
struct
coda_vget_in
{
struct
coda_in_hdr
ih
;
Vice
Fid
VFid
;
struct
Coda
Fid
VFid
;
};
struct
coda_vget_out
{
struct
coda_out_hdr
oh
;
Vice
Fid
VFid
;
struct
Coda
Fid
VFid
;
int
vtype
;
};
...
...
@@ -616,50 +614,46 @@ struct coda_vget_out {
/* CODA_PURGEUSER is a venus->kernel call */
struct
coda_purgeuser_out
{
struct
coda_out_hdr
oh
;
#ifdef CODA_FS_OLD_API
struct
coda_cred
cred
;
#else
vuid_t
uid
;
#endif
};
/* coda_zapfile: */
/* CODA_ZAPFILE is a venus->kernel call */
struct
coda_zapfile_out
{
struct
coda_out_hdr
oh
;
Vice
Fid
CodaFid
;
struct
Coda
Fid
CodaFid
;
};
/* coda_zapdir: */
/* CODA_ZAPDIR is a venus->kernel call */
struct
coda_zapdir_out
{
struct
coda_out_hdr
oh
;
ViceFid
CodaFid
;
};
/* coda_zapnode: */
/* CODA_ZAPVNODE is a venus->kernel call */
struct
coda_zapvnode_out
{
struct
coda_out_hdr
oh
;
struct
coda_cred
cred
;
ViceFid
VFid
;
struct
CodaFid
CodaFid
;
};
/* coda_purgefid: */
/* CODA_PURGEFID is a venus->kernel call */
struct
coda_purgefid_out
{
struct
coda_out_hdr
oh
;
Vice
Fid
CodaFid
;
struct
Coda
Fid
CodaFid
;
};
/* coda_replace: */
/* CODA_REPLACE is a venus->kernel call */
struct
coda_replace_out
{
/* coda_replace is a venus->kernel call */
struct
coda_out_hdr
oh
;
Vice
Fid
NewFid
;
Vice
Fid
OldFid
;
struct
Coda
Fid
NewFid
;
struct
Coda
Fid
OldFid
;
};
/* coda_open_by_fd: */
struct
coda_open_by_fd_in
{
struct
coda_in_hdr
ih
;
ViceFid
VFid
;
struct
CodaFid
VFid
;
int
flags
;
};
...
...
@@ -675,7 +669,7 @@ struct coda_open_by_fd_out {
/* coda_open_by_path: */
struct
coda_open_by_path_in
{
struct
coda_in_hdr
ih
;
ViceFid
VFid
;
struct
CodaFid
VFid
;
int
flags
;
};
...
...
@@ -741,7 +735,6 @@ union outputArgs {
struct
coda_purgeuser_out
coda_purgeuser
;
struct
coda_zapfile_out
coda_zapfile
;
struct
coda_zapdir_out
coda_zapdir
;
struct
coda_zapvnode_out
coda_zapvnode
;
struct
coda_purgefid_out
coda_purgefid
;
struct
coda_replace_out
coda_replace
;
struct
coda_open_by_fd_out
coda_open_by_fd
;
...
...
@@ -755,7 +748,6 @@ union coda_downcalls {
struct
coda_purgeuser_out
purgeuser
;
struct
coda_zapfile_out
zapfile
;
struct
coda_zapdir_out
zapdir
;
struct
coda_zapvnode_out
zapvnode
;
struct
coda_purgefid_out
purgefid
;
struct
coda_replace_out
replace
;
};
...
...
@@ -780,16 +772,7 @@ struct PioctlData {
#define CODA_CONTROL ".CONTROL"
#define CODA_CONTROLLEN 8
#define CTL_VOL -1
#define CTL_VNO -1
#define CTL_UNI -1
#define CTL_INO -1
#define CTL_FILE "/coda/.CONTROL"
#define IS_CTL_FID(fidp) ((fidp)->Volume == CTL_VOL &&\
(fidp)->Vnode == CTL_VNO &&\
(fidp)->Unique == CTL_UNI)
/* Data passed to mount */
...
...
include/linux/coda_cache.h
View file @
50a02d70
...
...
@@ -13,7 +13,7 @@
/* credential cache */
void
coda_cache_enter
(
struct
inode
*
inode
,
int
mask
);
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
);
/* for downcalls and attributes and lookups */
...
...
include/linux/coda_fs_i.h
View file @
50a02d70
...
...
@@ -17,11 +17,12 @@
* coda fs inode data
*/
struct
coda_inode_info
{
struct
ViceFid
c_fid
;
/* Coda identifier */
struct
CodaFid
c_fid
;
/* Coda identifier */
u_short
c_flags
;
/* flags (see below) */
struct
list_head
c_cilist
;
/* list of all coda inodes */
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 */
struct
inode
vfs_inode
;
};
...
...
@@ -34,7 +35,6 @@ struct coda_file_info {
int
cfi_magic
;
/* magic number */
struct
file
*
cfi_container
;
/* container file for this cnode */
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))
...
...
@@ -45,11 +45,11 @@ struct coda_file_info {
#define C_DYING 0x4
/* from venus (which died) */
#define C_PURGE 0x8
int
coda_cnode_make
(
struct
inode
**
,
struct
Vice
Fid
*
,
struct
super_block
*
);
struct
inode
*
coda_iget
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
struct
coda_vattr
*
attr
);
int
coda_cnode_make
(
struct
inode
**
,
struct
Coda
Fid
*
,
struct
super_block
*
);
struct
inode
*
coda_iget
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
struct
coda_vattr
*
attr
);
int
coda_cnode_makectl
(
struct
inode
**
inode
,
struct
super_block
*
sb
);
struct
inode
*
coda_fid_to_inode
(
Vice
Fid
*
fid
,
struct
super_block
*
sb
);
void
coda_replace_fid
(
struct
inode
*
,
ViceFid
*
,
Vice
Fid
*
);
struct
inode
*
coda_fid_to_inode
(
struct
Coda
Fid
*
fid
,
struct
super_block
*
sb
);
void
coda_replace_fid
(
struct
inode
*
,
struct
CodaFid
*
,
struct
Coda
Fid
*
);
#endif
#endif
include/linux/coda_linux.h
View file @
50a02d70
...
...
@@ -42,26 +42,21 @@ int coda_permission(struct inode *inode, int mask, struct nameidata *nd);
int
coda_revalidate_inode
(
struct
dentry
*
);
int
coda_getattr
(
struct
vfsmount
*
,
struct
dentry
*
,
struct
kstat
*
);
int
coda_setattr
(
struct
dentry
*
,
struct
iattr
*
);
int
coda_isnullfid
(
ViceFid
*
fid
);
/* global variables */
extern
int
coda_fake_statfs
;
/* this file: heloers */
static
__inline__
struct
Vice
Fid
*
coda_i2f
(
struct
inode
*
);
static
__inline__
struct
Coda
Fid
*
coda_i2f
(
struct
inode
*
);
static
__inline__
char
*
coda_i2s
(
struct
inode
*
);
static
__inline__
void
coda_flag_inode
(
struct
inode
*
,
int
flag
);
char
*
coda_f2s
(
Vice
Fid
*
f
);
char
*
coda_f2s
(
struct
Coda
Fid
*
f
);
int
coda_isroot
(
struct
inode
*
i
);
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_iattr_to_vattr
(
struct
iattr
*
,
struct
coda_vattr
*
);
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 */
void
coda_sysctl_init
(
void
);
...
...
@@ -88,7 +83,7 @@ static inline struct coda_inode_info *ITOC(struct inode *inode)
return
list_entry
(
inode
,
struct
coda_inode_info
,
vfs_inode
);
}
static
__inline__
struct
Vice
Fid
*
coda_i2f
(
struct
inode
*
inode
)
static
__inline__
struct
Coda
Fid
*
coda_i2f
(
struct
inode
*
inode
)
{
return
&
(
ITOC
(
inode
)
->
c_fid
);
}
...
...
include/linux/coda_psdev.h
View file @
50a02d70
...
...
@@ -6,13 +6,11 @@
#define CODA_SUPER_MAGIC 0x73757245
struct
statfs
;
struct
k
statfs
;
struct
coda_sb_info
{
struct
venus_comm
*
sbi_vcomm
;
struct
super_block
*
sbi_sb
;
struct
list_head
sbi_cihead
;
struct
venus_comm
*
sbi_vcomm
;
};
/* communication pending/processing queues */
...
...
@@ -33,46 +31,45 @@ static inline struct coda_sb_info *coda_sbp(struct super_block *sb)
/* upcalls */
int
venus_rootfid
(
struct
super_block
*
sb
,
Vice
Fid
*
fidp
);
int
venus_getattr
(
struct
super_block
*
sb
,
struct
ViceFid
*
fid
,
int
venus_rootfid
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fidp
);
int
venus_getattr
(
struct
super_block
*
sb
,
struct
CodaFid
*
fid
,
struct
coda_vattr
*
attr
);
int
venus_setattr
(
struct
super_block
*
,
struct
ViceFid
*
,
struct
coda_vattr
*
);
int
venus_lookup
(
struct
super_block
*
sb
,
struct
ViceFid
*
fid
,
int
venus_setattr
(
struct
super_block
*
,
struct
CodaFid
*
,
struct
coda_vattr
*
);
int
venus_lookup
(
struct
super_block
*
sb
,
struct
CodaFid
*
fid
,
const
char
*
name
,
int
length
,
int
*
type
,
struct
Vice
Fid
*
resfid
);
int
venus_store
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
flags
,
struct
coda_cred
*
);
int
venus_release
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
flags
);
int
venus_close
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
flags
,
struct
coda_cred
*
);
int
venus_open
(
struct
super_block
*
sb
,
struct
ViceFid
*
fid
,
int
flags
,
struct
file
**
f
);
int
venus_mkdir
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
dirfid
,
struct
Coda
Fid
*
resfid
);
int
venus_store
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
int
flags
,
vuid_t
uid
);
int
venus_release
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
int
flags
);
int
venus_close
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
int
flags
,
vuid_t
uid
);
int
venus_open
(
struct
super_block
*
sb
,
struct
CodaFid
*
fid
,
int
flags
,
struct
file
**
f
);
int
venus_mkdir
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
dirfid
,
const
char
*
name
,
int
length
,
struct
Vice
Fid
*
newfid
,
struct
coda_vattr
*
attrs
);
int
venus_create
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
dirfid
,
struct
Coda
Fid
*
newfid
,
struct
coda_vattr
*
attrs
);
int
venus_create
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
dirfid
,
const
char
*
name
,
int
length
,
int
excl
,
int
mode
,
dev_t
rdev
,
struct
Vice
Fid
*
newfid
,
struct
coda_vattr
*
attrs
)
;
int
venus_rmdir
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
dirfid
,
struct
Coda
Fid
*
newfid
,
struct
coda_vattr
*
attrs
)
;
int
venus_rmdir
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
dirfid
,
const
char
*
name
,
int
length
);
int
venus_remove
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
dirfid
,
int
venus_remove
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
dirfid
,
const
char
*
name
,
int
length
);
int
venus_readlink
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
venus_readlink
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
char
*
buffer
,
int
*
length
);
int
venus_rename
(
struct
super_block
*
,
struct
Vice
Fid
*
new_fid
,
struct
Vice
Fid
*
old_fid
,
size_t
old_length
,
int
venus_rename
(
struct
super_block
*
,
struct
Coda
Fid
*
new_fid
,
struct
Coda
Fid
*
old_fid
,
size_t
old_length
,
size_t
new_length
,
const
char
*
old_name
,
const
char
*
new_name
);
int
venus_link
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
struct
Vice
Fid
*
dirfid
,
const
char
*
name
,
int
len
);
int
venus_symlink
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
venus_link
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
struct
Coda
Fid
*
dirfid
,
const
char
*
name
,
int
len
);
int
venus_symlink
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
const
char
*
name
,
int
len
,
const
char
*
symname
,
int
symlen
);
int
venus_access
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
mask
);
int
venus_pioctl
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
,
int
venus_access
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
int
mask
);
int
venus_pioctl
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
,
unsigned
int
cmd
,
struct
PioctlData
*
data
);
int
coda_downcall
(
int
opcode
,
union
outputArgs
*
out
,
struct
super_block
*
sb
);
int
venus_fsync
(
struct
super_block
*
sb
,
struct
Vice
Fid
*
fid
);
int
venus_fsync
(
struct
super_block
*
sb
,
struct
Coda
Fid
*
fid
);
int
venus_statfs
(
struct
super_block
*
sb
,
struct
kstatfs
*
sfs
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment