#include <afsconfig.h>
#include "afs/param.h"
-
-
#ifdef UKERNEL
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include <net/if.h>
-#include <ctype.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <dirent.h>
#include "afsincludes.h" /* Afs-based standard headers */
#include "afs_usrops.h"
#include "afs/auth.h"
#include "afs/cellconfig.h"
#include "afs/vice.h"
+#include "afs/kauth.h"
#include "afs/kautils.h"
#include "afs/afsutil.h"
#include "rx/rx_globals.h"
struct afs_cacheParams cparams; /* params passed to cache manager */
struct afsconf_dir *afs_cdir; /* config dir */
-static int HandleMTab();
-
int afs_bufferpages = 100;
int usr_udpcksum = 0;
afs_osi_Read(struct osi_file *fp, int offset, void *buf, afs_int32 len)
{
int rc, ret;
- int code;
struct stat st;
AFS_ASSERT_GLOCK();
afs_osi_Write(struct osi_file *fp, afs_int32 offset, void *buf, afs_int32 len)
{
int rc, ret;
- int code;
struct stat st;
AFS_ASSERT_GLOCK();
return 0;
}
-/*
- * Use malloc/free routines with check patterns before and after each block
- */
-
-static char *afs_check_string1 = "UAFS";
-static char *afs_check_string2 = "AFS_OSI_";
-
void *
afs_osi_Alloc(size_t size)
{
}
int
-afs_osi_MapStrategy(int (*aproc) (), struct usr_buf *bp)
+afs_osi_MapStrategy(int (*aproc) (struct usr_buf *), struct usr_buf *bp)
{
afs_int32 returnCode;
returnCode = (*aproc) (bp);
osi_Init(void)
{
int i;
- int rc;
- usr_thread_t tid;
/*
* Allocate the table used to implement psuedo-inodes.
int nDaemonsParam, int cacheFlagsParam, char *logFile)
{
int st;
- struct usr_proc *procp;
- struct usr_ucred *ucredp;
int i;
int rc;
int currVFile; /* Current AFS cache file number */
int cacheIteration; /* cache verification loop counter */
int vFilesFound; /* Num data cache files found in sweep */
FILE *logfd;
- afs_int32 vfs1_type = -1;
- struct afs_ioctl iob;
char tbuffer[1024];
char *p;
char lastchar;
}
memset(pathname_for_V, 0, (cacheFiles * sizeof(char *)));
if (afsd_debug)
- printf("%s: %d pathname_for_V entries at 0x%x, %d bytes\n", rn,
- cacheFiles, pathname_for_V, (cacheFiles * sizeof(AFSD_INO_T)));
+ printf("%s: %d pathname_for_V entries at %" AFS_PTR_FMT
+ ", %lud bytes\n", rn, cacheFiles, pathname_for_V,
+ afs_printable_uint32_lu(cacheFiles * sizeof(AFSD_INO_T)));
/*
* Set up all the pathnames we'll need for later.
return 0;
}
+int
fork_syscall(syscall, afscall, param1, param2, param3, param4)
long syscall, afscall, param1, param2, param3, param4;
{
return 0;
}
+int
call_syscall(syscall, afscall, param1, param2, param3, param4)
long syscall, afscall, param1, param2, param3, param4;
{
struct usr_vnode *vp;
struct usr_vnode *nextVp;
struct usr_vnode *linkVp;
+ struct vcache *nextVc;
char *tmpPath;
char *pathP;
char *nextPathP = NULL;
* lookup the next component in the path, we can release the
* subdirectory since we hold the global lock
*/
+ nextVc = NULL;
nextVp = NULL;
#ifdef AFS_WEB_ENHANCEMENTS
if ((nextPathP != NULL && *nextPathP != '\0') || !no_eval_mtpt)
- code = afs_lookup(vp, pathP, &nextVp, u.u_cred, 0);
+ code = afs_lookup(VTOAFS(vp), pathP, &nextVc, u.u_cred, 0);
else
code =
- afs_lookup(vp, pathP, &nextVp, u.u_cred,
+ afs_lookup(VTOAFS(vp), pathP, &nextVc, u.u_cred,
AFS_LOOKUP_NOEVAL);
#else
- code = afs_lookup(vp, pathP, &nextVp, u.u_cred, 0);
+ code = afs_lookup(VTOAFS(vp), pathP, &nextVc, u.u_cred, 0);
#endif /* AFS_WEB_ENHANCEMENTS */
+ if (nextVc)
+ nextVp=AFSTOV(nextVc);
if (code != 0) {
VN_RELE(vp);
afs_osi_Free(tmpPath, strlen(path) + 1);
/*
* Read the link data
*/
- code = afs_readlink(vp, &uio, u.u_cred);
+ code = afs_readlink(VTOAFS(vp), &uio, u.u_cred);
if (code) {
afs_osi_Free(pathP, MAX_OSI_PATH + 1);
return code;
int code;
char *nameP;
struct vnode *parentP;
- struct vnode *dirP;
+ struct vcache *dirP;
struct usr_vattr attrs;
if (uafs_IsRoot(path)) {
attrs.va_uid = u.u_cred->cr_uid;
attrs.va_gid = u.u_cred->cr_gid;
dirP = NULL;
- code = afs_mkdir(parentP, nameP, &attrs, &dirP, u.u_cred);
+ code = afs_mkdir(VTOAFS(parentP), nameP, &attrs, &dirP, u.u_cred);
VN_RELE(parentP);
if (code != 0) {
errno = code;
return -1;
}
- VN_RELE(dirP);
+ VN_RELE(AFSTOV(dirP));
return 0;
}
return -1;
}
- code = afs_fsync(fileP, u.u_cred);
+ code = afs_fsync(VTOAFS(fileP), u.u_cred);
if (code != 0) {
errno = code;
return -1;
}
afs_FileTable[fd] = NULL;
- code = afs_close(fileP, afs_FileFlags[fd], u.u_cred);
+ code = afs_close(VTOAFS(fileP), afs_FileFlags[fd], u.u_cred);
VN_RELE(fileP);
if (code != 0) {
errno = code;
/*
* Create the link
*/
- code = afs_link(existP, dirP, nameP, u.u_cred);
+ code = afs_link(VTOAFS(existP), VTOAFS(dirP), nameP, u.u_cred);
VN_RELE(existP);
VN_RELE(dirP);
if (code != 0) {
attrs.va_mode = 0777;
attrs.va_uid = u.u_cred->cr_uid;
attrs.va_gid = u.u_cred->cr_gid;
- code = afs_symlink(dirP, nameP, &attrs, target, u.u_cred);
+ code = afs_symlink(VTOAFS(dirP), nameP, &attrs, target, u.u_cred);
VN_RELE(dirP);
if (code != 0) {
errno = code;
/*
* Read the the link
*/
- code = afs_readlink(vp, &uio, u.u_cred);
+ code = afs_readlink(VTOAFS(vp), &uio, u.u_cred);
VN_RELE(vp);
if (code) {
errno = code;
uafs_unlink_r(char *path)
{
int code;
- int openFlags;
- struct usr_vnode *fileP;
struct usr_vnode *dirP;
char *nameP;
/*
* Remove the file
*/
- code = afs_remove(dirP, nameP, u.u_cred);
+ code = afs_remove(VTOAFS(dirP), nameP, u.u_cred);
VN_RELE(dirP);
if (code != 0) {
errno = code;
/*
* Rename the file
*/
- code = afs_rename(odirP, onameP, ndirP, nnameP, u.u_cred);
+ code = afs_rename(VTOAFS(odirP), onameP, VTOAFS(ndirP), nnameP, u.u_cred);
VN_RELE(odirP);
VN_RELE(ndirP);
if (code != 0) {
uafs_rmdir_r(char *path)
{
int code;
- int openFlags;
- struct usr_vnode *fileP;
struct usr_vnode *dirP;
char *nameP;
/*
* Remove the directory
*/
- code = afs_rmdir(dirP, nameP, u.u_cred);
+ code = afs_rmdir(VTOAFS(dirP), nameP, u.u_cred);
VN_RELE(dirP);
if (code != 0) {
errno = code;
/*
* read the next chunk from the directory
*/
- code = afs_readdir(vp, &uio, u.u_cred);
+ code = afs_readdir(VTOAFS(vp), &uio, u.u_cred);
if (code != 0) {
errno = code;
return -1;
struct usr_dirent *
uafs_readdir_r(usr_DIR * dirp)
{
- int rc;
int code;
int len;
struct usr_uio uio;
/*
* read the next chunk from the directory
*/
- code = afs_readdir(vp, &uio, u.u_cred);
+ code = afs_readdir(VTOAFS(vp), &uio, u.u_cred);
if (code != 0) {
errno = code;
return NULL;
uafs_statmountpoint(char *path)
{
int retval;
- int code;
- char buf[256];
AFS_GLOCK();
retval = uafs_statmountpoint_r(path);
int code;
struct vnode *vp;
struct vcache *avc;
- struct vrequest treq;
int r;
code = uafs_LookupName(path, afs_CurrentDir, &vp, 0, 1);
int
uafs_getRights(char *path)
{
- int code, rc;
+ int code;
struct vnode *vp;
int afs_rights;
PRSFS_READ | PRSFS_WRITE | PRSFS_INSERT | PRSFS_LOOKUP | PRSFS_DELETE
| PRSFS_LOCK | PRSFS_ADMINISTER;
- afs_rights = afs_getRights(vp, afs_rights, u.u_cred);
+ afs_rights = afs_getRights(VTOAFS(vp), afs_rights, u.u_cred);
AFS_GUNLOCK();
return afs_rights;