#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_misc.c,v 1.8 2002/01/28 00:53:20 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_misc.c,v 1.9 2002/05/12 05:50:42 hartmans Exp $");
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
if (nd.dentry->d_inode) {
*dpp = dget(nd.dentry);
code = 0;
- }
+ } else
+ code = ENOENT;
path_release(&nd);
}
#else
for (i=0; i<VCSIZE; i++) {
for(tvc = afs_vhashT[i]; tvc; tvc=tvc->hnext) {
- ip = (struct inode*)tvc;
+ ip = AFSTOI(tvc);
#if defined(AFS_LINUX24_ENV)
if (ip->i_data.nrpages) {
#else
void osi_clear_inode(struct inode *ip)
{
cred_t *credp = crref();
- struct vcache *vc = (struct vcache*)ip;
+ struct vcache *vc = ITOAFS(ip);
#if defined(AFS_LINUX24_ENV)
if (atomic_read(&ip->i_count) > 1)
void check_bad_parent(struct dentry *dp)
{
cred_t *credp;
- struct vcache *vcp = (struct vcache*)dp->d_inode, *avc = NULL;
- struct vcache *pvc = (struct vcache *)dp->d_parent->d_inode;
+ struct vcache *vcp = ITOAFS(dp->d_inode), *avc = NULL;
+ struct vcache *pvc = ITOAFS(dp->d_parent->d_inode);
if (vcp->mvid->Fid.Volume != pvc->fid.Fid.Volume) { /* bad parent */
credp = crref();
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_module.c,v 1.8 2001/10/14 18:43:26 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_module.c,v 1.9 2002/05/12 05:50:42 hartmans Exp $");
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
#endif
#ifdef AFS_IA64_LINUX20_ENV
-unsigned char ia64_syscall_stub[] =
-{
- 0x00, 0x50, 0x45, 0x16, 0x80, 0x05, // [MII] alloc r42=ar.pfs,8,3,6,0
- 0x90, 0x02, 0x00, 0x62, 0x00, 0x60, // mov r41=b0
- 0x05, 0x00, 0x01, 0x84, // mov r43=r32
- 0x00, 0x60, 0x01, 0x42, 0x00, 0x21, // [MII] mov r44=r33
- 0xd0, 0x02, 0x88, 0x00, 0x42, 0xc0, // mov r45=r34
- 0x05, 0x18, 0x01, 0x84, // mov r46=r35
- 0x0d, 0x78, 0x01, 0x48, 0x00, 0x21, // [MFI] mov r47=r36
- 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // nop.f 0x0
- 0x06, 0x08, 0x00, 0x84, // mov r48=gp;;
- 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, // [MLX] nop.m 0x0
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, // movl r15=0x0;;
- 0x01, 0x00, 0x00, 0x60, //
- 0x0a, 0x80, 0x20, 0x1e, 0x18, 0x14, // [MMI] ld8 r16=[r15],8;;
- 0x10, 0x00, 0x3c, 0x30, 0x20, 0xc0, // ld8 gp=[r15]
- 0x00, 0x09, 0x00, 0x07, // mov b6=r16
- 0x1d, 0x00, 0x00, 0x00, 0x01, 0x00, // [MFB] nop.m 0x0
- 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // nop.f 0x0
- 0x68, 0x00, 0x00, 0x10, // br.call.sptk.many b0=b6;;
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // [MII] nop.m 0x0
- 0x00, 0x50, 0x01, 0x55, 0x00, 0x00, // mov.i ar.pfs=r42
- 0x90, 0x0a, 0x00, 0x07, // mov b0=r41
- 0x1d, 0x08, 0x00, 0x60, 0x00, 0x21, // [MFB] mov gp=r48
- 0x00, 0x00, 0x00, 0x02, 0x00, 0x80, // nop.f 0x0
- 0x08, 0x00, 0x84, 0x00 // br.ret.sptk.many b0;;
-};
-void ia64_imm64_fixup(unsigned long v, void *code)
+asmlinkage long
+afs_syscall_stub(int r0, int r1, long r2, long r3, long r4, long gp)
{
- unsigned long *bundle = (unsigned long *) code;
-
- unsigned long insn;
- unsigned long slot1;
-
- insn = ((v & 0x8000000000000000) >> 27) | ((v & 0x0000000000200000)) |
- ((v & 0x00000000001f0000) << 6) | ((v & 0x000000000000ff80) << 20) |
- ((v & 0x000000000000007f) << 13);
-
- slot1 = (v & 0x7fffffffffc00000) >> 22;
-
- *bundle |= slot1 << 46;
- *(bundle+1) |= insn << 23;
- *(bundle+1) |= slot1 >> 18;
+__asm__ __volatile__ ("
+ alloc r42 = ar.pfs, 8, 3, 6, 0
+ mov r41 = b0 /* save rp */
+ mov out0 = in0
+ mov out1 = in1
+ mov out2 = in2
+ mov out3 = in3
+ mov out4 = in4
+ mov out5 = gp /* save gp */
+ ;;
+.L1: mov r3 = ip
+ ;;
+ addl r15=.fptr_afs_syscall-.L1,r3
+ ;;
+ ld8 r15=[r15]
+ ;;
+ ld8 r16=[r15],8
+ ;;
+ ld8 gp=[r15]
+ mov b6=r16
+ br.call.sptk.many b0 = b6
+ ;;
+ mov ar.pfs = r42
+ mov b0 = r41
+ mov gp = r48 /* restore gp */
+ br.ret.sptk.many b0
+.fptr_afs_syscall:
+ data8 @fptr(afs_syscall)
+");
}
-unsigned char *afs_syscall_stub, *afs_xsetgroups_stub;
+asmlinkage long
+afs_xsetgroups_stub(int r0, int r1, long r2, long r3, long r4, long gp)
+{
+__asm__ __volatile__ ("
+ alloc r42 = ar.pfs, 8, 3, 6, 0
+ mov r41 = b0 /* save rp */
+ mov out0 = in0
+ mov out1 = in1
+ mov out2 = in2
+ mov out3 = in3
+ mov out4 = in4
+ mov out5 = gp /* save gp */
+ ;;
+.L2: mov r3 = ip
+ ;;
+ addl r15=.fptr_afs_xsetgroups - .L2,r3
+ ;;
+ ld8 r15=[r15]
+ ;;
+ ld8 r16=[r15],8
+ ;;
+ ld8 gp=[r15]
+ mov b6=r16
+ br.call.sptk.many b0 = b6
+ ;;
+ mov ar.pfs = r42
+ mov b0 = r41
+ mov gp = r48 /* restore gp */
+ br.ret.sptk.many b0
+.fptr_afs_xsetgroups:
+ data8 @fptr(afs_xsetgroups)
+");
+}
struct fptr
{
- unsigned long ip;
+ void *ip;
unsigned long gp;
};
#if defined(AFS_IA64_LINUX20_ENV)
afs_ni_syscall = sys_call_table[__NR_afs_syscall - 1024];
-
- afs_syscall_stub = (void *) kmalloc(sizeof(ia64_syscall_stub), GFP_KERNEL);
- memcpy(afs_syscall_stub, ia64_syscall_stub, sizeof(ia64_syscall_stub));
- ia64_imm64_fixup((unsigned long)afs_syscall, afs_syscall_stub+0x30);
- sys_call_table[__NR_afs_syscall - 1024] = POINTER2SYSCALL afs_syscall_stub;
+ sys_call_table[__NR_afs_syscall - 1024] = POINTER2SYSCALL ((struct fptr *)afs_syscall_stub)->ip;
#else /* AFS_IA64_LINUX20_ENV */
afs_ni_syscall = sys_call_table[__NR_afs_syscall];
sys_call_table[__NR_afs_syscall] = POINTER2SYSCALL afs_syscall;
#if defined(AFS_IA64_LINUX20_ENV)
sys_setgroupsp = (void *) &sys_setgroups;
- afs_xsetgroups_stub = (void *) kmalloc(sizeof(ia64_syscall_stub), GFP_KERNEL);
- memcpy(afs_xsetgroups_stub, ia64_syscall_stub, sizeof(ia64_syscall_stub));
- ia64_imm64_fixup((unsigned long)afs_xsetgroups, afs_xsetgroups_stub+0x30);
-
((struct fptr *)sys_setgroupsp)->ip =
SYSCALL2POINTER sys_call_table[__NR_setgroups - 1024];
((struct fptr *)sys_setgroupsp)->gp = kernel_gp;
- sys_call_table[__NR_setgroups - 1024] = POINTER2SYSCALL afs_xsetgroups_stub;
+ sys_call_table[__NR_setgroups - 1024] = POINTER2SYSCALL ((struct fptr *)afs_xsetgroups_stub)->ip;
#else /* AFS_IA64_LINUX20_ENV */
sys_setgroupsp = SYSCALL2POINTER sys_call_table[__NR_setgroups];
sys_call_table[__NR_setgroups] = POINTER2SYSCALL afs_xsetgroups;
# endif
#endif /* AFS_IA64_LINUX20_ENV */
+ osi_sysctl_init();
+
return 0;
}
{
struct task_struct *t;
+ osi_sysctl_clean();
+
#if defined(AFS_IA64_LINUX20_ENV)
sys_call_table[__NR_setgroups - 1024] = POINTER2SYSCALL ((struct fptr *) sys_setgroupsp)->ip;
sys_call_table[__NR_afs_syscall - 1024] = afs_ni_syscall;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.11 2002/01/22 20:29:44 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.12 2002/05/12 05:50:42 hartmans Exp $");
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
#include "../afs/afs_stats.h"
+#include "../afs/afs_osidnlc.h"
#include "../h/mm.h"
#include "../h/pagemap.h"
#if defined(AFS_LINUX24_ENV)
loff_t *offp)
{
ssize_t code;
- struct vcache *vcp = (struct vcache*)fp->f_dentry->d_inode;
+ struct vcache *vcp = ITOAFS(fp->f_dentry->d_inode);
cred_t *credp = crref();
struct vrequest treq;
{
ssize_t code = 0;
int code2;
- struct vcache *vcp = (struct vcache *)fp->f_dentry->d_inode;
+ struct vcache *vcp = ITOAFS(fp->f_dentry->d_inode);
struct vrequest treq;
cred_t *credp = crref();
void *dirbuf, filldir_t filldir)
{
extern struct DirEntry * afs_dir_GetBlob();
- struct vcache *avc = (struct vcache*)FILE_INODE(fp);
+ struct vcache *avc = ITOAFS(FILE_INODE(fp));
struct vrequest treq;
register struct dcache *tdc;
int code;
if (!vmap->vm_file)
return;
- vcp = (struct vcache*)FILE_INODE(vmap->vm_file);
+ vcp = ITOAFS(FILE_INODE(vmap->vm_file));
if (!vcp)
return;
static int afs_linux_mmap(struct file *fp, struct vm_area_struct *vmap)
{
- struct vcache *vcp = (struct vcache*)FILE_INODE(fp);
+ struct vcache *vcp = ITOAFS(FILE_INODE(fp));
cred_t *credp = crref();
struct vrequest treq;
int code;
{
int code = 0;
cred_t *credp = crref();
- struct vcache *vcp = (struct vcache*)ip;
+ struct vcache *vcp = ITOAFS(ip);
AFS_GLOCK();
#ifdef AFS_LINUX24_ENV
#ifdef AFS_LINUX24_ENV
lock_kernel();
#endif
- code = afs_fsync((struct vcache*)ip, credp);
+ code = afs_fsync(ITOAFS(ip), credp);
#ifdef AFS_LINUX24_ENV
unlock_kernel();
#endif
static int afs_linux_lock(struct file *fp, int cmd, struct file_lock *flp)
{
int code = 0;
- struct vcache *vcp = (struct vcache*)FILE_INODE(fp);
+ struct vcache *vcp = ITOAFS(FILE_INODE(fp));
cred_t *credp = crref();
#ifdef AFS_LINUX24_ENV
struct flock64 flock;
*/
int afs_linux_flush(struct file *fp)
{
- struct vcache *vcp = (struct vcache *)FILE_INODE(fp);
+ struct vcache *vcp = ITOAFS(FILE_INODE(fp));
int code = 0;
cred_t *credp;
int code;
cred_t *credp;
struct vrequest treq;
- struct vcache *vcp = (struct vcache*)dp->d_inode;
+ struct vcache *vcp = ITOAFS(dp->d_inode);
AFS_GLOCK();
#ifdef AFS_LINUX24_ENV
struct vcache *lookupvcp = NULL;
int code, bad_dentry = 1;
struct sysname_info sysState;
- struct vcache *vcp = (struct vcache*) dp->d_inode;
- struct vcache *parentvcp = (struct vcache*) dp->d_parent->d_inode;
+ struct vcache *vcp = ITOAFS(dp->d_inode);
+ struct vcache *parentvcp = ITOAFS(dp->d_parent->d_inode);
AFS_GLOCK();
+ sysState.allocked = 0;
+
/* If it's a negative dentry, then there's nothing to do. */
if (!vcp || !parentvcp)
goto done;
+ /* If it is the AFS root, then there's no chance it needs
+ revalidating */
+ if (vcp == afs_globalVp) {
+ bad_dentry = 0;
+ goto done;
+ }
+
if (code = afs_InitReq(&treq, credp))
goto done;
int code;
cred_t *credp;
struct vrequest treq;
- struct inode *ip = (struct inode *)dp->d_inode;
+ struct inode *ip = AFSTOI(dp->d_inode);
unsigned long timeout = 3*HZ; /* 3 seconds */
vattr.va_mode = mode;
AFS_GLOCK();
- code = afs_create((struct vcache*)dip, name, &vattr, NONEXCL, mode,
+ code = afs_create(ITOAFS(dip), name, &vattr, NONEXCL, mode,
(struct vcache**)&ip, credp);
if (!code) {
struct vcache *vcp=NULL;
const char *comp = dp->d_name.name;
AFS_GLOCK();
- code = afs_lookup((struct vcache *)dip, comp, &vcp, credp);
+ code = afs_lookup(ITOAFS(dip), comp, &vcp, credp);
if (vcp) {
- struct inode *ip = (struct inode*)vcp;
+ struct inode *ip = AFSTOI(vcp);
/* Reset ops if symlink or directory. */
#if defined(AFS_LINUX24_ENV)
if (S_ISREG(ip->i_mode)) {
else if (S_ISLNK(ip->i_mode))
ip->i_op = &afs_symlink_iops;
#endif
+ }
dp->d_time = jiffies;
dp->d_op = afs_dops;
- d_add(dp, (struct inode*)vcp);
- }
+ d_add(dp, AFSTOI(vcp));
AFS_GUNLOCK();
crfree(credp);
d_drop(newdp);
AFS_GLOCK();
- code = afs_link((struct vcache*)oldip, (struct vcache*)dip, name, credp);
+ code = afs_link(ITOAFS(oldip), ITOAFS(dip), name, credp);
AFS_GUNLOCK();
crfree(credp);
int putback = 0;
AFS_GLOCK();
- code = afs_remove((struct vcache*)dip, name, credp);
+ code = afs_remove(ITOAFS(dip), name, credp);
AFS_GUNLOCK();
if (!code)
d_drop(dp);
AFS_GLOCK();
VATTR_NULL(&vattr);
- code = afs_symlink((struct vcache*)dip, name, &vattr, target, credp);
+ code = afs_symlink(ITOAFS(dip), name, &vattr, target, credp);
AFS_GUNLOCK();
crfree(credp);
return -code;
VATTR_NULL(&vattr);
vattr.va_mask = ATTR_MODE;
vattr.va_mode = mode;
- code = afs_mkdir((struct vcache*)dip, name, &vattr, &tvcp, credp);
+ code = afs_mkdir(ITOAFS(dip), name, &vattr, &tvcp, credp);
if (tvcp) {
tvcp->v.v_op = &afs_dir_iops;
#endif
dp->d_op = afs_dops;
dp->d_time = jiffies;
- d_instantiate(dp, (struct inode*)tvcp);
+ d_instantiate(dp, AFSTOI(tvcp));
}
AFS_GUNLOCK();
const char *name = dp->d_name.name;
AFS_GLOCK();
- code = afs_rmdir((struct vcache*)dip, name, credp);
+ code = afs_rmdir(ITOAFS(dip), name, credp);
/* Linux likes to see ENOTEMPTY returned from an rmdir() syscall
* that failed because a directory is not empty. So, we map
d_drop(newdp);
}
AFS_GLOCK();
- code = afs_rename((struct vcache*)oldip, oldname, (struct vcache*)newip,
+ code = afs_rename(ITOAFS(oldip), oldname, ITOAFS(newip),
newname, credp);
AFS_GUNLOCK();
struct iovec iov;
setup_uio(&tuio, &iov, target, 0, maxlen, UIO_READ, seg);
- code = afs_readlink((struct vcache*)ip, &tuio, credp);
+ code = afs_readlink(ITOAFS(ip), &tuio, credp);
crfree(credp);
if (!code)
setup_uio(&tuio, &iovec, (char*)address, offset, PAGESIZE,
UIO_READ, AFS_UIOSYS);
- code = afs_rdwr((struct vcache*)ip, &tuio, UIO_READ, 0, credp);
+ code = afs_rdwr(ITOAFS(ip), &tuio, UIO_READ, 0, credp);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
unlock_kernel();
#endif
if (mode & MAY_EXEC) tmp |= VEXEC;
if (mode & MAY_READ) tmp |= VREAD;
if (mode & MAY_WRITE) tmp |= VWRITE;
- code = afs_access((struct vcache*)ip, tmp, credp);
+ code = afs_access(ITOAFS(ip), tmp, credp);
AFS_GUNLOCK();
crfree(credp);
unsigned long offset,
unsigned int count)
{
- struct vcache *vcp = (struct vcache *) ip;
+ struct vcache *vcp = ITOAFS(ip);
char *buffer;
loff_t base;
int code = 0;
unsigned long offset,
unsigned int count, int sync)
{
- struct vcache *vcp = (struct vcache *)FILE_INODE(fp);
+ struct vcache *vcp = ITOAFS(FILE_INODE(fp));
u8 *page_addr = (u8*) afs_linux_page_address(pp);
int code = 0;
cred_t *credp;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.9 2001/10/14 18:43:27 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.10 2002/05/12 05:50:43 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
AFS_STATCNT(afs_lookup);
#ifdef AFS_OSF_ENV
- ndp->ni_dvp = (struct vnode *)adp;
+ ndp->ni_dvp = AFSTOV(adp);
memcpy(aname, ndp->ni_ptr, ndp->ni_namelen);
aname[ndp->ni_namelen] = '\0';
#endif /* AFS_OSF_ENV */
#ifdef AFS_OSF_ENV
extern struct vcache *afs_globalVp;
if (adp == afs_globalVp) {
- struct vnode *rvp = (struct vnode *)adp;
+ struct vnode *rvp = AFSTOV(adp);
/*
ndp->ni_vp = rvp->v_vfsp->vfs_vnodecovered;
ndp->ni_dvp = ndp->ni_vp;
/* Check for read access as well. We need read access in order to
stat files, but not to stat subdirectories. */
- if (!afs_AccessOK(adp, PRSFS_READ, &treq, CHECK_MODE_BITS))
+ if (!afs_AccessOK(adp, PRSFS_LOOKUP, &treq, CHECK_MODE_BITS))
no_read_access = 1;
/* special case lookup of ".". Can we check for it sooner in this code,
extern afs_uint32 afs_stampValue; /* stamp for pair's usage */
#define MakeStamp() (++afs_stampValue)
+#define VTOAFS(V) ((struct vcache*)(V))
+#define AFSTOV(V) (&(V)->v)
+#ifdef AFS_LINUX22_ENV
+#define ITOAFS(V) ((struct vcache*)(V))
+#define AFSTOI(V) (struct inode *)(&(V)->v)
+#endif
+
/* INVARIANTs: (vlruq.next != NULL) == (vlruq.prev != NULL)
* nextfree => !vlruq.next && ! vlruq.prev
* !(avc->nextfree) && !avc->vlruq.next => (FreeVCList == avc->nextfree)
#ifdef AFS_SGI64_ENV
#include <ksys/behavior.h>
#define AFS_RWLOCK(V,F) \
- afs_rwlock(&(((struct vcache *)(V))->vc_bhv_desc), (F));
+ afs_rwlock(&VTOAFS(V)->vc_bhv_desc, (F));
#define AFS_RWUNLOCK(V,F) \
- afs_rwunlock(&(((struct vcache *)(V))->vc_bhv_desc), (F));
+ afs_rwunlock(&VTOAFS(V)->vc_bhv_desc, (F));
#else
#define AFS_RWLOCK(V,F) afs_rwlock((vnode_t *)(V), (F) )
avc->states |= CCore; /* causes close to be called later */ \
\
/* The cred and vnode holds will be released in afs_FlushActiveVcaches */ \
- VN_HOLD((struct vnode *)avc); /* So it won't disappear */ \
+ VN_HOLD(AFSTOV(avc)); /* So it won't disappear */ \
CRKEEP(avc, acred); /* Should use a better place for the creds */ \
} \
else { \
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_call.c,v 1.10 2002/01/28 00:53:19 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_call.c,v 1.11 2002/05/12 05:50:41 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
long linux_ret=0;
long *retval = &linux_ret;
long eparm[4]; /* matches AFSCALL_ICL in fstrace.c */
+#ifdef AFS_SPARC64_LINUX24_ENV
+ afs_int32 eparm32[4];
+#endif
/* eparm is also used by AFSCALL_CALL in afsd.c */
#else
#if defined(UKERNEL)
uap->parm2 = parm2;
uap->parm3 = parm3;
if (syscall == AFSCALL_ICL || syscall == AFSCALL_CALL) {
+#ifdef AFS_SPARC64_LINUX24_ENV
+/* from arch/sparc64/kernel/sys_sparc32.c */
+#define AA(__x) \
+({ unsigned long __ret; \
+ __asm__ ("srl %0, 0, %0" \
+ : "=r" (__ret) \
+ : "0" (__x)); \
+ __ret; \
+})
+
+
+ if (current->thread.flags & SPARC_FLAG_32BIT) {
+ AFS_COPYIN((char*)parm4, (char*)eparm32, sizeof(eparm32), code);
+ eparm[0]=AA(eparm32[0]);
+ eparm[1]=AA(eparm32[1]);
+ eparm[2]=AA(eparm32[2]);
+#undef AA
+} else
+#endif
AFS_COPYIN((char*)parm4, (char*)eparm, sizeof(eparm), code);
uap->parm4 = eparm[0];
uap->parm5 = eparm[1];
#endif
} else if (uap->syscall == AFSCALL_SETPAG) {
#ifdef AFS_SUN5_ENV
- struct cred *cred;
register proc_t *procp;
procp = ttoproc(curthread);
- mutex_enter(&procp->p_crlock);
- cred = procp->p_cred;
AFS_GLOCK();
- code = afs_setpag(&cred);
+ code = afs_setpag(&procp->p_cred);
AFS_GUNLOCK();
- procp->p_cred = cred;
- mutex_exit(&procp->p_crlock);
#else
AFS_GLOCK();
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_daemons.c,v 1.6 2001/10/14 18:43:25 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_daemons.c,v 1.7 2002/05/12 05:50:42 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
mp = (struct mount *) afs_globalVFS->vfs_data ;
mp->m_rootgp = gget(mp, 0, 0, (char *)rootgp);
afs_unlock(mp->m_rootgp); /* unlock basic gnode */
- afs_vrele((struct vcache *) rootgp); /* zap afs_root's vnode hold */
+ afs_vrele(VTOAFS(rootgp)); /* zap afs_root's vnode hold */
}
}
#endif
return;
}
#ifdef AFS_DEC_ENV
- tvc = (struct vcache *) afs_gntovn(tvn);
+ tvc = VTOAFS(afs_gntovn(tvn));
#else
- tvc = (struct vcache *) tvn;
+ tvc = VTOAFS(tvn);
#endif
/* here we know its an afs vnode, so we can get the data for the chunk */
tdc = afs_GetDCache(tvc, ab->parm[1], &treq, &offset, &len, 1);
#ifdef AFS_DEC_ENV
avc->vrefCount++;
#else
- VN_HOLD((struct vnode *)avc);
+ VN_HOLD(AFSTOV(avc));
#endif
}
tb->refCount = ause+1;
AFS_GLOCK();
continue;
}
- vcp = (struct vcache *)bp->b_vp;
+ vcp = VTOAFS(bp->b_vp);
if (bp->b_flags & B_PFSTORE) { /* XXXX */
ObtainWriteLock(&vcp->lock,404);
if (vcp->v.v_gnode->gn_mwrcnt) {
splx(s);
continue;
}
- vcp = (struct vcache *)bp->b_vp;
+ vcp = VTOAFS(bp->b_vp);
if (bp->b_flags & B_PFSTORE) {
ObtainWriteLock(&vcp->lock,210);
if (vcp->v.v_gnode->gn_mwrcnt) {
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_pioctl.c,v 1.11 2002/01/22 20:29:43 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_pioctl.c,v 1.12 2002/05/12 05:50:42 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
/* first determine whether this is any sort of vnode */
#ifdef AFS_LINUX22_ENV
- tvc = (struct vcache *)ip;
+ tvc = VTOAFS(ip);
{
#else
#ifdef AFS_SUN5_ENV
#endif
/* good, this is a vnode; next see if it is an AFS vnode */
#if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV)
- tvc = (struct vcache *) fd->f_vnode; /* valid, given a vnode */
+ tvc = VTOAFS(fd->f_vnode); /* valid, given a vnode */
#else
- tvc = (struct vcache *) fd->f_data; /* valid, given a vnode */
+ tvc = VTOAFS((struct vnode*)fd->f_data); /* valid, given a vnode */
#endif
#endif /* AFS_LINUX22_ENV */
- if (tvc && IsAfsVnode((struct vnode *)tvc)) {
+ if (tvc && IsAfsVnode(AFSTOV(tvc))) {
#ifdef AFS_DEC_ENV
- tvc = (struct vcache *) afs_gntovn((struct gnode *) tvc);
+ tvc = VTOAFS(afs_gntovn((struct gnode *) tvc));
if (!tvc) { /* shouldn't happen with held gnodes */
u.u_error = ENOENT;
return;
for(tvc = afs_vhashT[i]; tvc; tvc=tvc->hnext) {
if (tvc->fid.Fid.Volume == volume && tvc->fid.Cell == cell) {
#if defined(AFS_SGI_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV)
- VN_HOLD((struct vnode *)tvc);
+ VN_HOLD(AFSTOV(tvc));
#else
#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
osi_vnhold(tvc, 0);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosoprocs.c,v 1.4 2002/01/22 20:29:44 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosoprocs.c,v 1.5 2002/05/12 05:50:43 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
struct bozo_bosEntryStats bozo_bosEntryStats[] = {
{NULL, 1,1, 0755, 02}, /* AFSDIR_SERVER_AFS_DIRPATH */
- {NULL, 1,1, 0700, 02}, /* AFSDIR_SERVER_ETC_DIRPATH */
+ {NULL, 1,1, 0755, 02}, /* AFSDIR_SERVER_ETC_DIRPATH */
{NULL, 1,1, 0755, 02}, /* AFSDIR_SERVER_BIN_DIRPATH */
{NULL, 1,1, 0755, 02}, /* AFSDIR_SERVER_LOGS_DIRPATH */
{NULL, 1,0, 0700, 07}, /* AFSDIR_SERVER_BACKUP_DIRPATH */
afssrvlibexecdir=@afssrvlibexecdir@
afskerneldir=@afskerneldir@
SYS_NAME=@AFS_SYSNAME@
+KDEBUG=@KERN_DEBUG_OPT@
+FOMIT=@OMIT_FRAME_POINTER@
include config/Makefile.${SYS_NAME}
osi_misc.o \
osi_module.o \
osi_sleep.o \
+ osi_sysctl.o \
osi_vfsops.o \
osi_vm.o \
osi_vnodeops.o \
LD = ld
# -Wall
<i386_linux22 i386_linux24>
-CCFLAGS = -O2 -fomit-frame-pointer \
+CCFLAGS = $(KDEBUG) -O2 $(FOMIT) \
-fno-strength-reduce -pipe -march=i486 -malign-loops=2 -malign-jumps=2 \
-malign-functions=2
DEFINES = -D__KERNEL__ -DCPU=586 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} ${KDEFINES}
<alpha_linux_22 alpha_linux_24>
-CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce -pipe -mno-fp-regs -ffixed-8
+CCFLAGS = $(KDEBUG) -O2 $(FOMIT) -fno-strength-reduce -pipe -mno-fp-regs -ffixed-8
DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
<s390_linux22 s390_linux24>
-CCFLAGS = -O -fomit-frame-pointer -fno-strength-reduce \
+CCFLAGS = -O $(FOMIT) -fno-strength-reduce \
-fno-strict-aliasing -fsigned-char
DEFINES = -D__KERNEL__ -D__s390__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
<sparc_linux22 sparc_linux24>
LD = ld -m elf32_sparc
-CCFLAGS = -O2 -fomit-frame-pointer \
+CCFLAGS = $(KDEBUG) -O2 $(FOMIT) \
-fno-strength-reduce -pipe -mcpu=v8 -mno-fpu -fcall-used-g5 -fcall-used-g7
DEFINES = -D__KERNEL__ -DCPU=sparc -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
<sparc64_linux22 sparc64_linux24>
CC = sparc64-linux-gcc
LD = ld -m elf64_sparc
-CCFLAGS = -O2 -fomit-frame-pointer \
+CCFLAGS = $(KDEBUG) -O2 $(FOMIT) \
-fno-strength-reduce -pipe -mcpu=ultrasparc -m64 -mno-fpu -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare
DEFINES = -D__KERNEL__ -DCPU=sparc64 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
<ppc_linux22 ppc_linux24>
-CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce \
+CCFLAGS = $(KDEBUG) -O2 $(FOMIT) -fno-strength-reduce \
-fno-strict-aliasing -fsigned-char -msoft-float -pipe \
-fno-builtin -ffixed-r2
DEFINES = -D__KERNEL__ -D__powerpc__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
<parisc_linux24>
-CCFLAGS = -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -fno-strength-reduce \
+CCFLAGS = $(KDEBUG) -O2 $(FOMIT) \
+ -fno-strict-aliasing -fno-common -fno-strength-reduce \
-fno-strict-aliasing -fsigned-char -mno-space-regs -mfast-indirect-calls \
-mdisable-fpregs -ffunction-sections -march=1.1 -mschedule=7100
DEFINES = -D__KERNEL__ -D__linux__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
<ia64_linux24>
-CCFLAGS = -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe \
+CCFLAGS = $(KDEBUG) -O2 $(FOMIT) -fno-strict-aliasing -fno-common -pipe \
-ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step
DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL ${SMP_DEF} -DMODULE
<all>
$(CRULE1)
osi_sleep.o: $(AFS)/osi_sleep.c
$(CRULE1)
+osi_sysctl.o: $(AFS)/osi_sysctl.c
+ $(CRULE1)
osi_vfsops.o: $(AFS)/osi_vfsops.c
$(CRULE1)
osi_vm.o: $(AFS)/osi_vm.c
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptserver.c,v 1.7 2001/10/14 18:43:29 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptserver.c,v 1.8 2002/05/12 05:50:43 hartmans Exp $");
#include <afs/stds.h>
#ifdef AFS_AIX32_ENV
}
else sc[2] = sc[0];
- /* These two lines disallow jumbograms */
- rx_maxReceiveSize = OLD_MAX_PACKET_SIZE;
- rxi_nSendFrags = rxi_nRecvFrags = 1;
+ /* Disable jumbograms */
+ rx_SetNoJumbo();
tservice = rx_NewService(0,PRSRV,"Protection Server",sc,3,PR_ExecuteRequest);
if (tservice == (struct rx_service *)0) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/venus/fstrace.c,v 1.6 2001/09/11 15:48:53 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/venus/fstrace.c,v 1.7 2002/05/12 05:50:43 hartmans Exp $");
#include <stdio.h>
#include <sys/types.h>
{
if (!failed) {
failed = 1;
+#if defined(AFS_OSF_ENV) && !defined(AFS_OSF20_ENV)
+ catclose1 (catd);
+#else
+ catclose (catd);
+#endif
goto tryagain;
}
sprintf ((char *) error_text, "status %08x (%s / %s)",
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/viced/afsfileprocs.c,v 1.7 2002/01/22 20:29:45 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/afsfileprocs.c,v 1.8 2002/05/12 05:50:44 hartmans Exp $");
#include <stdio.h>
#include <stdlib.h>
V_parentId(volptr));
IH_RELEASE(newfileptr->handle);
if (errorCode == -1) {
- ViceLog(0, ("Del: inode=%d, name=%s, errno=%d\n",
+ ViceLog(0, ("Del: inode=%s, name=%s, errno=%d\n",
PrintInode(NULL, VN_GET_INO(newfileptr)),
NewName, errno));
if ((errno != ENOENT) && (errno != EIO) && (errno != ENXIO))
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/partition.c,v 1.9 2001/10/14 18:43:31 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/partition.c,v 1.10 2002/05/12 05:50:44 hartmans Exp $");
#include <ctype.h>
#ifdef AFS_NT40_ENV
return -1;
#endif
-#ifdef AFS_DUX40_ENV
+#if defined(AFS_DUX40_ENV) && !defined(AFS_NAMEI_ENV)
if (status.st_ino != ROOTINO) {
Log("%s is not a mounted file system; ignored.\n", part);
return 0;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/volser/volmain.c,v 1.7 2001/09/11 15:48:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/volmain.c,v 1.8 2002/05/12 05:50:44 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
}
if (!rxJumbograms) {
/* Don't allow 3.4 vos clients to send jumbograms and we don't send. */
- rx_maxReceiveSize = OLD_MAX_PACKET_SIZE;
- rxi_nSendFrags = rxi_nRecvFrags = 1;
+ rx_SetNoJumbo();
}
rx_GetIFInfo();
rx_SetRxDeadTime(420);