From a221239d76d9a082a002d08bceb4011daf09f115 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Sun, 3 Dec 2000 06:25:27 +0000 Subject: [PATCH] This commit was generated by cvs2svn to compensate for changes in r107, which included commits to RCS files with non-trunk default branches. --- src/afs/LINUX/osi_alloc.c | 29 +++++++++++++++-------------- src/afs/LINUX/osi_vnodeops.c | 31 ++++++++++++++++++++++++++++--- src/afs/SOLARIS/osi_vfsops.c | 9 ++++++++- src/afs/VNOPS/afs_vnop_lookup.c | 17 ++++------------- src/afs/afs_osi.h | 4 ++++ src/afs/afs_pioctl.c | 2 ++ src/afs/sysincludes.h | 2 ++ src/config/Makefile | 4 ++-- src/config/param.sun4x_58.h | 2 +- src/config/param.sun4x_58_usr.h | 2 +- 10 files changed, 67 insertions(+), 35 deletions(-) diff --git a/src/afs/LINUX/osi_alloc.c b/src/afs/LINUX/osi_alloc.c index ab0352d63..75d7498f1 100644 --- a/src/afs/LINUX/osi_alloc.c +++ b/src/afs/LINUX/osi_alloc.c @@ -339,20 +339,21 @@ void osi_linux_free_afs_memory(void) { down(&afs_linux_alloc_sem); - /* iterate through all elements in the hash table and free both - * the chunk and the atom associated with it. - */ - afs_lhash_iter(lh_mem_htab, hash_free); - - /* free the atomlist. */ - afs_atomlist_destroy(al_mem_pool); - - /* free the hashlist. */ - afs_lhash_destroy(lh_mem_htab); - - /* change the state so that the allocator is now uninitialized. */ - allocator_init = 0; - + if (allocator_init) { + /* iterate through all elements in the hash table and free both + * the chunk and the atom associated with it. + */ + afs_lhash_iter(lh_mem_htab, hash_free); + + /* free the atomlist. */ + afs_atomlist_destroy(al_mem_pool); + + /* free the hashlist. */ + afs_lhash_destroy(lh_mem_htab); + + /* change the state so that the allocator is now uninitialized. */ + allocator_init = 0; + } up(&afs_linux_alloc_sem); } diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index e5ce3dcb1..d1894e790 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -1164,10 +1164,34 @@ int afs_linux_readpage(struct file *fp, struct page *pp) return -code; } -#ifdef NOTUSED -/* afs_linux_writepage - is this used anywhere? swap files via nfs? */ -int afs_linux_writepage(struct inode *ip, struct page *) { return -EINVAL }; +#if defined(AFS_LINUX24_ENV) +int afs_linux_writepage(struct file *file, struct page *page) +{ + struct dentry *dentry = file->f_dentry; + struct inode *inode = dentry->d_inode; + unsigned long end_index = inode->i_size >> PAGE_CACHE_SHIFT; + unsigned offset = PAGE_CACHE_SIZE; + long status; + + /* easy case */ + if (page->index < end_index) + goto do_it; + /* things got complicated... */ + offset = inode->i_size & (PAGE_CACHE_SIZE-1); + /* OK, are we completely out? */ + if (page->index >= end_index+1 || !offset) + return -EIO; +do_it: + status = afs_linux_updatepage(file, page, 0, offset, 1); + kunmap(page); + if (status == offset) + return 0; + else + return status; +} +#endif +#ifdef NOTUSED /* afs_linux_bmap - supports generic_readpage, but we roll our own. */ int afs_linux_bmap(struct inode *ip, int) { return -EINVAL; } @@ -1292,6 +1316,7 @@ struct inode_operations afs_file_iops = { }; struct address_space_operations afs_file_aops = { readpage: afs_linux_readpage, + writepage: afs_linux_writepage, commit_write: afs_linux_commit_write, prepare_write: afs_linux_prepare_write, }; diff --git a/src/afs/SOLARIS/osi_vfsops.c b/src/afs/SOLARIS/osi_vfsops.c index 343df6dc5..40d72507b 100644 --- a/src/afs/SOLARIS/osi_vfsops.c +++ b/src/afs/SOLARIS/osi_vfsops.c @@ -54,7 +54,11 @@ int afs_mount(struct vfs *afsp, struct vnode *amvp, struct mounta *uap, return 0; } +#if defined(AFS_SUN58_ENV) +int afs_unmount (struct vfs *afsp, int flag, struct AFS_UCRED *credp) +#else int afs_unmount (struct vfs *afsp, struct AFS_UCRED *credp) +#endif { AFS_GLOCK(); AFS_STATCNT(afs_unmount); @@ -217,7 +221,10 @@ struct vfsops Afs_vfsops = { afs_sync, afs_vget, afs_mountroot, - afs_swapvp + afs_swapvp, +#if defined(AFS_SUN58_ENV) + fs_freevfs, +#endif }; diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c index 1778c4050..c02fcfb03 100644 --- a/src/afs/VNOPS/afs_vnop_lookup.c +++ b/src/afs/VNOPS/afs_vnop_lookup.c @@ -637,6 +637,7 @@ tagain: /* actually a serious error, probably should panic. Probably will * panic soon, oh well. */ ReleaseReadLock(&afs_xvcache); + afs_warnuser("afs_DoBulkStat: VLRU empty!"); goto done; } if ((VLRU.next->prev != &VLRU) || (VLRU.prev->next != &VLRU)) { @@ -739,12 +740,15 @@ tagain: refpanic ("Bulkstat VLRU inconsistent6"); ReleaseWriteLock(&afs_xvcache); + ObtainWriteLock(&afs_xcbhash, 494); + /* We need to check the flags again. We may have missed * something while we were waiting for a lock. */ if (!(tvcp->states & CBulkFetching) || (tvcp->m.Length != statSeqNo)) { flagIndex++; ReleaseWriteLock(&tvcp->lock); + ReleaseWriteLock(&afs_xcbhash); afs_PutVCache(tvcp); continue; } @@ -761,19 +765,6 @@ tagain: tvcp->v.v_op = &afs_symlink_iops; #endif - ObtainWriteLock(&afs_xcbhash, 494); - - /* We need to check the flags once more. We may have missed - * something while we were waiting for a lock. - */ - if (!(tvcp->states & CBulkFetching) || (tvcp->m.Length != statSeqNo)) { - flagIndex++; - ReleaseWriteLock(&afs_xcbhash); - ReleaseWriteLock(&tvcp->lock); - afs_PutVCache(tvcp); - continue; - } - /* do some accounting for bulk stats: mark this entry as * loaded, so we can tell if we use it before it gets * recycled. diff --git a/src/afs/afs_osi.h b/src/afs/afs_osi.h index 505d58ba0..4586e4474 100644 --- a/src/afs/afs_osi.h +++ b/src/afs/afs_osi.h @@ -20,6 +20,10 @@ #define _CODA_HEADER_ struct coda_inode_info {}; #endif +#ifndef _LINUX_XFS_FS_I +#define _LINUX_XFS_FS_I +struct xfs_inode_info {}; +#endif #include "../h/fs.h" #include "../h/mm.h" #endif diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index ef7320378..fe5c9b5fc 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -2421,6 +2421,8 @@ struct AFS_UCRED *acred; afs_int32 cell, volume; AFS_STATCNT(PFlushVolumeData); + if (!avc) + return EINVAL; if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ return EIO; /* Inappropriate ioctl for device */ diff --git a/src/afs/sysincludes.h b/src/afs/sysincludes.h index d0b4cbdfa..022420734 100644 --- a/src/afs/sysincludes.h +++ b/src/afs/sysincludes.h @@ -27,6 +27,8 @@ #define _LINUX_CODA_FS_I #define _CFS_HEADER_ struct coda_inode_info {}; +#define _LINUX_XFS_FS_I +struct xfs_inode_info {}; #include #include #include diff --git a/src/config/Makefile b/src/config/Makefile index c7d3cd259..6ea8484b7 100644 --- a/src/config/Makefile +++ b/src/config/Makefile @@ -95,14 +95,14 @@ ${KERNELDIR}/afs/permit_xprt.h ../permit_xprt.h: perm_src=`pwd`/../xprt ; \ echo "perm_src='$$perm_src'" ; \ set -x ; \ - ln -s $$perm_src/permit_export.h ${KERNELDIR}/afs/permit_xprt.h ; \ + $(CP) $$perm_src/permit_export.h ${KERNELDIR}/afs/permit_xprt.h ; \ ln -s $$perm_src/permit_xprt.h ../permit_xprt.h ; \ else \ echo "CONFIG" ; \ perm_src=`pwd` ; \ echo "perm_src='$$perm_src'" ; \ set -x ; \ - ln -s $$perm_src/permit_xprt.h ${KERNELDIR}/afs/permit_xprt.h ; \ + $(CP) $$perm_src/permit_xprt.h ${KERNELDIR}/afs/permit_xprt.h ; \ ln -s $$perm_src/permit_xprt.h ../permit_xprt.h ; \ fi diff --git a/src/config/param.sun4x_58.h b/src/config/param.sun4x_58.h index 7326e4f6f..b81851011 100644 --- a/src/config/param.sun4x_58.h +++ b/src/config/param.sun4x_58.h @@ -26,7 +26,7 @@ #define AFS_GCPAGS 1 /* if nonzero, garbage collect PAGs */ #define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */ -#define AFS_SYSCALL 101 +#define AFS_SYSCALL 65 /* File system entry (used if mount.h doesn't define MOUNT_AFS */ #define AFS_MOUNT_AFS "afs" diff --git a/src/config/param.sun4x_58_usr.h b/src/config/param.sun4x_58_usr.h index e6c08d377..9de7672d4 100644 --- a/src/config/param.sun4x_58_usr.h +++ b/src/config/param.sun4x_58_usr.h @@ -20,7 +20,7 @@ /*#define AFS_GLOBAL_SUNLOCK 1 /* For global locking */ #define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */ -#define AFS_SYSCALL 101 +#define AFS_SYSCALL 65 /* File system entry (used if mount.h doesn't define MOUNT_AFS */ #define AFS_MOUNT_AFS 1 -- 2.39.5