which included commits to RCS files with non-trunk default branches.
A. Creating the proper directory structure.
- Uncompress the source into a directory of your choice.
- Preferrably, afs space. In the directory that you uncompressed the
- source in, you will only have an src directory.
-
+ Uncompress the source into a directory of your choice. A directory
+ in afs space is also valid. In the directory that you uncompressed the
+ source in, you will only have an src/ directory.
+
1. Make a directory for each system type that you plan on
building. Current tested system types include the following
(this step is skipped for the i386_nt40 system type):
alpha_dux40/
+ alpha_dux50/ (only tested on 5.0A)
i386_linux22/
+ i386_linux24/ (only tested with 2.4.0 kernel)
rs_aix42/
+ sgi_65/ (file server not tested)
sun4x_56/
sun4x_57/
+ sun4x_58/
Example:
% mkdir i386_linux22
Builds for the following platforms will not fully compile:
hp_ux110/
- sgi_65/
2. Within each of those directories, create a dest/ and obj/ directory.
% mkdir i386_linux22/obj
3. Create symbolic links to the system type you are about to build
+ a. If the source is in AFS space
- Example:
- % ln -s @sys/dest dest
- % ln -s @sys/obj obj
- % ls -CF
- Makefile@ dest@ i386_linux22/ obj@ src/
-
- 4. If this source is NOT in AFS space, You must make a link from
- @sys to your current system type.
+ Example:
+ % ln -s @sys/dest dest
+ % ln -s @sys/obj obj
+ % ls -CF
+ dest@ i386_linux22/ obj@ src/
- Example:
- % ln -s i386_linux22 @sys
+ Within AFS space, the AFS Cache Manager automatically
+ substitutes the local machine's AFS system name (CPU/operating
+ system type [ie: alpha_dux40, i386_linux22, ...]) for the @sys
+ variable.
- Within AFS space, the AFS Cache Manager automatically
- substitutes the local machine's AFS system name (CPU/operating
- system type [ie: alpha_dux40, i386_linux22, ...]) for the @sys
- variable.
+ b. If this source is NOT in AFS space, You must make a link from
+ @sys to your current system type.
+ Example:
+ % ln -s i386_linux22 @sys
+ % ln -s @sys/dest dest
+ % ln -s @sys/obj obj
+ % ls -CF
+ dest@ i386_linux22/ obj@ src/ sys@
+
5. Create the top level Makefile:
- a. For LINUX and UNIX versions
Example:
% ln -s src/Makefile Makefile
% ls -CF
- Makefile@ i386_linux22/ src/
+ Makefile@ dest@ i386_linux22/ obj@ src/
B Building
* we're supposed to close the search if we're done, and we're done,
* or if something went wrong, close the search.
*/
- if ((searchFlags & 1) || ((searchFlags & 2) && eos)
+ /* ((searchFlags & 1) || ((searchFlags & 2) && eos) */
+ if ((searchFlags & 1) || (returnedNames == 0)
|| code != 0) smb_DeleteDirSearch(dsp);
if (code)
smb_SendTran2Error(vcp, p, opx, code);
void Services_Create_OnType (HWND hDlg)
{
- SERVICETYPE type;
+ AFSSERVICETYPE type;
if (IsDlgButtonChecked (hDlg, IDC_SVC_TYPE_FS))
type = SERVICETYPE_FS;
else if (IsDlgButtonChecked (hDlg, IDC_SVC_TYPE_CRON))
lstrcpy (pszTarget, (fWantAFS) ? TEXT("/afs") : TEXT(""));
else if ((*pszSource != TEXT('/')) && (*pszSource != TEXT('\\')))
wsprintf (pszTarget, TEXT("/afs/%s"), pszSource);
- else if (fWantAFS && lstrncmpi (&pszSource[1], TEXT("afs"), 3))
+ // We don't want to strip afs off the start if it is part of something for example afscell.company.com
+ else if (fWantAFS && (lstrncmpi (&pszSource[1], TEXT("afs"), 3)) || !((pszSource[4] == TEXT('/')) ||
+ (pszSource[4] == TEXT('\\')) ||
+ (lstrlen(pszSource) == 4)))
wsprintf (pszTarget, TEXT("/afs%s"), pszSource);
- else if (!fWantAFS && !lstrncmpi (&pszSource[1], TEXT("afs"), 3))
+ else if (!fWantAFS && (!lstrncmpi (&pszSource[1], TEXT("afs"), 3) || ((pszSource[4] == TEXT('/')) ||
+ (pszSource[4] == TEXT('\\')) ||
+ (lstrlen(pszSource) == 4))))
lstrcpy (pszTarget, &pszSource[4]);
else
lstrcpy (pszTarget, pszSource);
}
MOUNTLIST_LOCK();
}
+#ifdef AFS_DUX50_ENV
+#define m_next m_nxt
+#endif
mp = mp->m_next;
} while (mp != rootfs);
MOUNTLIST_UNLOCK();
int fd;
extern struct fileops vnops;
register int code;
+#ifdef AFS_DUX50_ENV
+ struct ufile_entry *fe;
+#endif
AFS_STATCNT(afs_syscall_iopen);
if (code) {
return(code);
}
+#ifdef AFS_DUX50_ENV
+ if ((code = falloc(&fp, &fd, &fe)) != 0) {
+ iput(ip);
+ return(code);
+ }
+#else
if ((code = falloc(&fp, &fd)) != 0) {
iput(ip);
return(code);
}
+#endif
IN_UNLOCK(ip);
FP_LOCK(fp);
fp->f_data = (caddr_t)ITOV(ip);
FP_UNLOCK(fp);
+#ifdef AFS_DUX50_ENV
+ u_set_fe(fd, fe, fp, &u.u_file_state);
+#else
U_FD_SET(fd, fp, &u.u_file_state);
+#endif
*retval = fd;
return(0);
}
}
+#ifdef AFS_DUX50_ENV
+int mp_afs_smoothsync(struct mount *mp, u_int age, u_int smsync_flag)
+{
+ AFS_STATCNT(afs_sync);
+ return 0;
+}
+#endif
+
int mp_afs_fhtovp(struct mount *afsp, struct fid *fidp, struct vnode **avcp)
{
struct vrequest treq;
mp_afs_vptofh,
mp_Afs_init,
mp_afs_mountroot,
- mp_afs_swapvp
+ mp_afs_swapvp,
+#ifdef AFS_DUX50_ENV
+ mp_afs_smoothsync
+#endif
};
AFS_GLOCK();
sysent[AFS_SYSCALL].sy_call = afs3_syscall;
+#ifdef SY_NARG
+ sysent[AFS_SYSCALL].sy_info = 6;
+#else
sysent[AFS_SYSCALL].sy_parallel = 0;
sysent[AFS_SYSCALL].sy_narg = 6;
+#endif
sysent[SYS_setgroups].sy_call = Afs_xsetgroups;
afs_xioctl_func = afsxioctl;
afs_xsetgroups_func = afsxsetgroups;
int mp_afs_page_read(), mp_afs_page_write(), mp_afs_swap(), mp_afs_bread();
int mp_afs_brelse(), mp_afs_lockctl(), mp_afs_syncdata(), mp_afs_close();
int mp_afs_closex();
+int mp_afs_ioctl();
/* AFS vnodeops */
struct vnodeops Afs_vnodeops = {
mp_afs_setattr,
mp_afs_ubcrdwr,
mp_afs_ubcrdwr,
- afs_badop, /* vn_ioctl */
+ mp_afs_ioctl, /* vn_ioctl */
seltrue, /* vn_select */
mp_afs_mmap,
mp_afs_fsync,
flags = 0;
ReleaseWriteLock(&avc->lock);
AFS_GUNLOCK();
+#ifdef AFS_DUX50_ENV
+ code = ubc_lookup(((struct vnode *)avc)->v_object, pageBase,
+ PAGE_SIZE, PAGE_SIZE, &page, &flags, NULL);
+#else
code = ubc_lookup(((struct vnode *)avc)->v_object, pageBase,
PAGE_SIZE, PAGE_SIZE, &page, &flags);
+#endif
AFS_GLOCK();
ObtainWriteLock(&avc->lock,163);
}
AFS_GUNLOCK();
ubc_page_wait(page);
- data = (char *)page->pg_addr; /* DUX 4.0D */
- if (data == 0)
- data = (char *)PHYS_TO_KSEG(page->pg_phys_addr); /* DUX 4.0E */
+ data = ubc_load(page, pageOffset, page_size);
AFS_GLOCK();
ReleaseWriteLock(&avc->lock); /* uiomove may page fault */
AFS_GUNLOCK();
return code;
}
+int
+mp_afs_ioctl(struct vnode *vp, int com, caddr_t data, int fflag,
+ struct ucred *cred, int *retval)
+{
+ return ENOSYS;
+}
/*
* Now for some bad news. Since we artificially hold on to vnodes by doing
}
-int mp_afs_getpage(vop, offset, len, protp, pl, plsz, mape, addr, rw, cred)
+int mp_afs_getpage(vop, offset, len, protp, pl, plsz,
+#ifdef AFS_DUX50_ENV
+ policy,
+#else
+ mape, addr,
+#endif
+ rw, cred)
vm_ubc_object_t vop;
vm_offset_t offset;
vm_size_t len;
vm_prot_t *protp;
vm_page_t *pl;
int plsz;
+#ifdef AFS_DUX50_ENV
+ struct vm_policy *policy;
+#else
vm_map_entry_t mape;
vm_offset_t addr;
+#endif
int rw;
struct ucred *cred;
{
flags = 0;
ReleaseWriteLock(&avc->lock);
AFS_GUNLOCK();
+#ifdef AFS_DUX50_ENV
+ code = ubc_lookup(((struct vnode *)avc)->v_object, off,
+ PAGE_SIZE, PAGE_SIZE, pagep, &flags, NULL);
+#else
code = ubc_lookup(((struct vnode *)avc)->v_object, off,
PAGE_SIZE, PAGE_SIZE, pagep, &flags);
+#endif
AFS_GLOCK();
ObtainWriteLock(&avc->lock,168);
if (code) {
}
if ((rw & B_READ) == 0) {
AFS_GUNLOCK();
+#ifdef AFS_DUX50_ENV
+ ubc_page_dirty(pl[i], 0);
+#else
ubc_page_dirty(pl[i]);
+#endif
AFS_GLOCK();
} else {
if (protp && (flags & B_DIRTY) == 0) {
return TRUE;
}
+#ifdef AFS_DUX50_ENV
+int
+mp_afs_objtovp(vm_ubc_object_t vop, struct vnode **vp)
+{
+ *vp = vop->vu_vp;
+ return 0;
+}
+
+int
+mp_afs_setpgstamp(vm_page_t pp, unsigned int tick)
+{
+ pp->pg_stamp = tick;
+ return 0;
+}
+#endif
struct vfs_ubcops afs_ubcops = {
mp_afs_getpage, /* get page */
mp_afs_putpage, /* put page */
mp_afs_write_check, /* check writablity */
+#ifdef AFS_DUX50_ENV
+ mp_afs_objtovp, /* get vnode pointer */
+ mp_afs_setpgstamp /* set page stamp */
+#endif
};
* now vectors to the correct EFS or XFS function. If new functionality is
* added which accesses the inode, that will also need EFS/XFS variants.
*/
+#ifdef AFS_SGI_EFS_IOPS_ENV
vnode_t *afs_EFSIGetVnode(ino_t ainode)
{
struct inode *ip;
iunlock(ip);
return (EFS_ITOV(ip));
}
+#endif /* AFS_SGI_EFS_IOPS_ENV */
vnode_t *afs_XFSIGetVnode(ino_t ainode)
{
return code;
}
+#ifdef AFS_SGI_EFS_IOPS_ENV
void osi_DisableAtimes(avp)
struct vnode *avp;
{
}
}
+#endif /* AFS_SGI_EFS_IOPS_ENV */
/* Generic read interface */
if (code == 0) {
code = asize - resid;
afile->offset += code;
+#ifdef AFS_SGI_EFS_IOPS_ENV
osi_DisableAtimes(afile->vnode);
+#endif /* AFS_SGI_EFS_IOPS_ENV */
}
else {
afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid,
return ENOSYS;
#endif
- if (error = iget(vfstom(vfsp), (unsigned int)(inode&0xffffffff), &ip)) {
+ if (error = iget((((struct mount *)((vfsp)->vfs_bh.bh_first)->bd_pdata)),
+ (unsigned int)(inode&0xffffffff), &ip)) {
return error;
}
*ipp = ip;
}
#endif
- if (error = xfs_iget(vfstom(vfsp), (void*)0,
- (xfs_ino_t)inode,XFS_ILOCK_SHARED, &ip, (daddr_t)0)) {
+ if (error = xfs_iget((((struct mount *)
+ ((vfsp)->vfs_bh.bh_first)->bd_pdata)),
+ (void*)0, (xfs_ino_t)inode,
+ XFS_ILOCK_SHARED, &ip, (daddr_t)0)) {
SET_XFS_ERROR(3, vfsp->vfs_dev, inode);
return error;
}
int
icreate(struct icreateargs *uap, rval_t *rvp)
{
+#ifdef AFS_SGI_EFS_IOPS_ENV
AFS_STATCNT(icreate);
return(afs_syscall_icreate(uap->dev, uap->near_inode, uap->param1,
uap->param2, uap->param3, uap->param4, rvp));
+#else
+ return ENOSYS;
+#endif
}
+#ifdef AFS_SGI_EFS_IOPS_ENV
int
afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp)
afs_uint32 dev, near_inode, param1, param2, param3, param4;
iput(newip);
return 0;
}
+#else /* !AFS_SGI_EFS_IOPS_ENV */
+int
+afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp)
+afs_uint32 dev, near_inode, param1, param2, param3, param4;
+rval_t *rvp;
+{
+ return ENOSYS;
+}
+#endif /* AFS_SGI_EFS_IOPS_ENV */
#ifdef AFS_SGI_XFS_IOPS_ENV
/* inode creation routines for icreatename64 entry point. Use for EFS/XFS
if (!vfsp)
return ENXIO;
+#ifdef AFS_SGI_EFS_IOPS_ENV
if (vfsp->vfs_fstype == efs_fstype) {
struct inode *ip;
if (error = igetinode(vfsp, (dev_t)dev, inode, &ip))
}
iunlock(ip);
}
- else if (vfsp->vfs_fstype == xfs_fstype) {
- struct xfs_inode *xip;
- if (error = xfs_igetinode(vfsp, (dev_t)dev, inode, &xip))
- return error;
- vp = XFS_ITOV(xip);
- if (error = vfile_alloc((usrmod+1) & (FMASK), &fp, &fd)) {
- VN_RELE(vp);
- return error;
- }
- }
- else {
- osi_Panic("afs_syscall_iopen: bad fstype = %d\n",
- vfsp->vfs_fstype);
- }
+ else
+#endif /* AFS_SGI_EFS_IOPS_ENV */
+ if (vfsp->vfs_fstype == xfs_fstype) {
+ struct xfs_inode *xip;
+ if (error = xfs_igetinode(vfsp, (dev_t)dev, inode, &xip))
+ return error;
+ vp = XFS_ITOV(xip);
+ if (error = vfile_alloc((usrmod+1) & (FMASK), &fp, &fd)) {
+ VN_RELE(vp);
+ return error;
+ }
+ }
+ else {
+ osi_Panic("afs_syscall_iopen: bad fstype = %d\n",
+ vfsp->vfs_fstype);
+ }
vfile_ready(fp, vp);
rvp->r_val1 = fd;
return 0;
* Only VICEMAGIC type inodes.
*/
#ifdef AFS_SGI_XFS_IOPS_ENV
+#ifdef AFS_SGI_EFS_IOPS_ENV
/* efs_iincdec
*
* XFS/EFS iinc/idec code for EFS. Uses 32 bit inode numbers.
iput(ip);
return error;
}
+#endif /* AFS_SGI_EFS_IOPS_ENV */
/* xfs_iincdec
*
int nlink;
int vol;
- code = xfs_iget(vfstom(vfsp), (void*)0, (xfs_ino_t)inode, XFS_ILOCK_SHARED,
- &ip, (daddr_t)0);
+ code = xfs_iget((((struct mount *)((vfsp)->vfs_bh.bh_first)->bd_pdata)),
+ (void*)0, (xfs_ino_t)inode, XFS_ILOCK_SHARED, &ip,
+ (daddr_t)0);
if (code)
return code;
inode |= inode_lo;
return xfs_iincdec64(vfsp, inode, inode_p1, amount);
}
+#ifdef AFS_SGI_EFS_IOPS_ENV
else if (vfsp->vfs_fstype == efs_fstype) {
return efs_iincdec(vfsp, inode_lo, inode_p1, amount);
}
+#endif /* AFS_SGI_EFS_IOPS_ENV */
return ENXIO;
}
inode = inode_hi;
inode <<= 32;
inode |= inode_lo;
- code = xfs_iget(vfstom(vfsp), (void*)0, (xfs_ino_t)inode,
+ code = xfs_iget((((struct mount *)((vfsp)->vfs_bh.bh_first)->bd_pdata)),
+ (void*)0, (xfs_ino_t)inode,
XFS_ILOCK_SHARED, &ip, (daddr_t)0);
if (code)
return code;
/*
* SGI specific vnodeops + other misc interface glue
*/
-#ident "$Revision: 1.1.1.2 $"
+#ident "$Revision: 1.1.1.3 $"
#include "../afs/param.h" /* Should be always first */
#ifdef AFS_SGI62_ENV
inited = 1;
+#ifdef AFS_SGI_EFS_IOPS_ENV
swp = vfs_getvfssw("efs");
if (swp) {
afs_efs_vnodeopsp = swp->vsw_vnodeops;
found = 1;
}
}
+#endif /* AFS_SGI_EFS_IOPS_ENV */
swp = vfs_getvfssw("xfs");
if (swp) {
uid_t i_uid;
gid_t i_gid;
kdev_t i_rdev;
-#if defined(AFS_LINUX24_ENV)
+#if defined(AFS_LINUX24_ENV) || defined(pgoff2loff)
loff_t i_size;
#else
off_t i_size;
* If we use the common inode pool, we'll need to set i_nlink to 0 here.
* That will trigger the call to delete routine.
*/
+
void afs_delete_inode(struct inode *ip)
{
- cred_t *credp = crref();
struct vcache *vc = (struct vcache*)ip;
AFS_GLOCK();
-#if defined(AFS_LINUX24_ENV)
- lock_kernel();
- if (atomic_read(&ip->i_count) > 1)
-#else
- if (ip->i_count > 1)
-#endif
- printf("afs_put_inode: ino %d (0x%x) has count %d\n", ip->i_ino, ip);
-
ObtainWriteLock(&vc->lock, 504);
- afs_InactiveVCache(vc, credp);
-#if defined(AFS_LINUX24_ENV)
- atomic_set(&ip->i_count, 0);
-#else
- ip->i_count = 0;
-#endif
- ip->i_nlink = 0; /* iput checks this after calling this routine. */
+ osi_clear_inode(ip);
ReleaseWriteLock(&vc->lock);
-
-#ifdef AFS_LINUX24_ENV
- unlock_kernel();
-#endif
AFS_GUNLOCK();
- crfree(credp);
}
+
/* afs_put_super
* Called from unmount to release super_block. */
void afs_put_super(struct super_block *sbp)
/*
* Putpage (ASYNC) is called every sec to flush out dirty vm pages
*/
- if (flags == B_ASYNC) {
- /* XXX For testing only XXX */
- return (EINVAL);
- }
AFS_GLOCK();
afs_Trace4(afs_iclSetp, CM_TRACE_PAGEOUT, ICL_TYPE_POINTER, (afs_int32) vp,
ICL_TYPE_LONG, (afs_int32) off, ICL_TYPE_LONG, (afs_int32) len,
#if !defined (AFS_AIX_ENV) && !defined (AFS_HPUX_ENV) && !defined (AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV)
-#ifdef AFS_DUX40_ENV
+#ifdef AFS_DUX50_ENV
+#define vno_close(X) vn_close((X), 0, NOCRED)
+#elif defined(AFS_DUX40_ENV)
#define vno_close vn_close
#endif
/* We don't need this for AIX since:
void afs_osi_TraverseProcTable()
{
struct pid_entry *pe;
+#ifdef AFS_DUX50_ENV
+extern struct pid_entry *pidtab;
+extern int npid;
+#define pidNPID (pidtab + npid)
+#define PID_LOCK()
+#define PID_UNLOCK()
+#endif
PID_LOCK();
for (pe = pidtab; pe < pidNPID; ++pe) {
if (pe->pe_proc != PROC_NULL)
#define AFS_STATS_FS_RPCIDX_XSTATSVERSION 26
#define AFS_STATS_FS_RPCIDX_GETXSTATS 27
#define AFS_STATS_FS_RPCIDX_XLOOKUP 28
+#define AFS_STATS_FS_RPCIDX_RESIDENCYRPCS 29
#define AFS_STATS_NUM_FS_RPC_OPS 29
ec CM_TRACE_READPAGE, "Ireadpage ip 0x%lx pp 0x%x count 0x%x code %x"
ec CM_TRACE_UPDATEPAGE, "Iupdatepage ip 0x%lx pp 0x%x count 0x%x code %d"
ec CM_TRACE_VM_CLOSE, "VMclose ip 0x%lx mapcnt %d opens %d XoW %d"
+ ec CM_TRACE_PREFETCHCMD, "PrefetchCmd tvc 0x%x tfid (%d:%d.%d.%d) fid (%d:%d.%d.%d)"
+ ec CM_TRACE_RESIDCMD, "ResidencyCmd tvc 0x%x command %d fid (%d:%d.%d.%d)"
end
#ifdef AFS_SGI64_ENV
#include <ksys/behavior.h>
#endif /* AFS_SGI64_ENV */
+#include "../fs/efs_inode.h"
+#ifdef AFS_SGI_EFS_IOPS_ENV
#include "../sgiefs/efs.h"
+#endif
#include "../sys/kmem.h"
#include "../sys/cred.h"
#include "../sys/resource.h"