From 789bf060d28465edc996b07b7f4bc21fc051515d Mon Sep 17 00:00:00 2001 From: Chas Williams Date: Fri, 10 Nov 2006 00:06:44 +0000 Subject: [PATCH] linux-blkbits-20061109 FIXES 42671 set blkbits if we have it --- acinclude.m4 | 1 + src/afs/DARWIN/osi_machdep.h | 2 -- src/afs/FBSD/osi_machdep.h | 2 -- src/afs/HPUX/osi_machdep.h | 5 ----- src/afs/IRIX/osi_machdep.h | 5 ----- src/afs/LINUX/osi_machdep.h | 1 - src/afs/LINUX/osi_vfsops.c | 3 +++ src/afs/LINUX/osi_vnodeops.c | 4 ++-- src/afs/NBSD/osi_machdep.h | 2 -- src/afs/OBSD/osi_machdep.h | 1 - src/afs/UKERNEL/sysincludes.h | 4 ---- src/afs/VNOPS/afs_vnop_attrs.c | 4 ++-- src/afs/afs.h | 2 ++ src/cf/linux-test4.m4 | 15 +++++++++++++++ 14 files changed, 25 insertions(+), 26 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 876348e..adc7cd3 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -584,6 +584,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM + LINUX_FS_STRUCT_INODE_HAS_I_BLKBITS LINUX_FS_STRUCT_INODE_HAS_I_BLKSIZE LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS diff --git a/src/afs/DARWIN/osi_machdep.h b/src/afs/DARWIN/osi_machdep.h index 0156e79..fc13ade 100644 --- a/src/afs/DARWIN/osi_machdep.h +++ b/src/afs/DARWIN/osi_machdep.h @@ -128,8 +128,6 @@ static inline time_t osi_Time(void) { extern int hz; #endif -#define PAGESIZE 8192 - #define AFS_UCRED ucred #define AFS_PROC struct proc diff --git a/src/afs/FBSD/osi_machdep.h b/src/afs/FBSD/osi_machdep.h index d098c96..55fa0d9 100644 --- a/src/afs/FBSD/osi_machdep.h +++ b/src/afs/FBSD/osi_machdep.h @@ -31,8 +31,6 @@ #define osi_Time() time_second #define afs_hz hz -#define PAGESIZE 8192 - #define AFS_UCRED ucred #define AFS_PROC struct proc diff --git a/src/afs/HPUX/osi_machdep.h b/src/afs/HPUX/osi_machdep.h index f16c7bf..1237d06 100644 --- a/src/afs/HPUX/osi_machdep.h +++ b/src/afs/HPUX/osi_machdep.h @@ -24,11 +24,6 @@ extern struct timeval time; #define osi_Time() (time.tv_sec) -#ifdef PAGESIZE -#undef PAGESIZE -#endif -#define PAGESIZE 8192 - #define AFS_UCRED ucred #define AFS_PROC proc_t diff --git a/src/afs/IRIX/osi_machdep.h b/src/afs/IRIX/osi_machdep.h index 032797c..241deab 100644 --- a/src/afs/IRIX/osi_machdep.h +++ b/src/afs/IRIX/osi_machdep.h @@ -207,11 +207,6 @@ extern long afs_global_owner; #define afs_hz HZ -#ifdef PAGESIZE -#undef PAGESIZE -#endif -#define PAGESIZE 4096 - #ifdef AFS_SGI64_ENV #undef setuerror #undef getuerror diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h index 23d5b95..9c78feb 100644 --- a/src/afs/LINUX/osi_machdep.h +++ b/src/afs/LINUX/osi_machdep.h @@ -123,7 +123,6 @@ static inline long copyinstr(char *from, char *to, int count, int *length) { #define uprintf printk -#define PAGESIZE PAGE_SIZE #ifndef NGROUPS #define NGROUPS NGROUPS_SMALL #endif diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index 1b90c28..4613b79 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -501,6 +501,9 @@ vattr2inode(struct inode *ip, struct vattr *vp) ip->i_ino = vp->va_nodeid; ip->i_nlink = vp->va_nlink; ip->i_blocks = vp->va_blocks; +#ifdef STRUCT_INODE_HAS_I_BLKBITS + ip->i_blkbits = AFS_BLKBITS; +#endif #ifdef STRUCT_INODE_HAS_I_BLKSIZE ip->i_blksize = vp->va_blocksize; #endif diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 2f8b776..29bee80 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -1349,7 +1349,7 @@ afs_linux_readpage(struct file *fp, struct page *pp) clear_bit(PG_error, &pp->flags); #endif - setup_uio(&tuio, &iovec, (char *)address, offset, PAGESIZE, UIO_READ, + setup_uio(&tuio, &iovec, (char *)address, offset, PAGE_SIZE, UIO_READ, AFS_UIOSYS); #ifdef AFS_LINUX24_ENV lock_kernel(); @@ -1367,7 +1367,7 @@ afs_linux_readpage(struct file *fp, struct page *pp) if (!code) { if (tuio.uio_resid) /* zero remainder of page */ - memset((void *)(address + (PAGESIZE - tuio.uio_resid)), 0, + memset((void *)(address + (PAGE_SIZE - tuio.uio_resid)), 0, tuio.uio_resid); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) flush_dcache_page(pp); diff --git a/src/afs/NBSD/osi_machdep.h b/src/afs/NBSD/osi_machdep.h index a0f7101..8703c92 100644 --- a/src/afs/NBSD/osi_machdep.h +++ b/src/afs/NBSD/osi_machdep.h @@ -32,8 +32,6 @@ extern struct timeval time; #define osi_Time() (time.tv_sec) #define afs_hz hz -#define PAGESIZE 8192 - #define AFS_UCRED ucred #define AFS_PROC struct proc diff --git a/src/afs/OBSD/osi_machdep.h b/src/afs/OBSD/osi_machdep.h index 048ec33..a387f3b 100644 --- a/src/afs/OBSD/osi_machdep.h +++ b/src/afs/OBSD/osi_machdep.h @@ -85,7 +85,6 @@ #ifndef iodone #define iodone biodone #endif -#define PAGESIZE 8192 #define printk printf /* for RX version of xdr_* */ #define setgroups sys_setgroups #define UVM diff --git a/src/afs/UKERNEL/sysincludes.h b/src/afs/UKERNEL/sysincludes.h index 2c851b0..ab6d449 100644 --- a/src/afs/UKERNEL/sysincludes.h +++ b/src/afs/UKERNEL/sysincludes.h @@ -175,10 +175,6 @@ #define MAXNAMLEN 512 #endif -#ifndef PAGESIZE -#define PAGESIZE 4096 -#endif - /* * This file contains data types and definitions for running * the AFS client in user space. Kernel data structures diff --git a/src/afs/VNOPS/afs_vnop_attrs.c b/src/afs/VNOPS/afs_vnop_attrs.c index be9245b..3f85e6c 100644 --- a/src/afs/VNOPS/afs_vnop_attrs.c +++ b/src/afs/VNOPS/afs_vnop_attrs.c @@ -147,9 +147,9 @@ afs_CopyOutAttrs(register struct vcache *avc, register struct vattr *attrs) attrs->va_flags = 0; #endif #if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) - attrs->va_blksize = PAGESIZE; /* XXX Was 8192 XXX */ + attrs->va_blksize = AFS_BLKSIZE; /* XXX Was 8192 XXX */ #else - attrs->va_blocksize = PAGESIZE; /* XXX Was 8192 XXX */ + attrs->va_blocksize = AFS_BLKSIZE; /* XXX Was 8192 XXX */ #endif attrs->va_rdev = 1; #if defined(AFS_HPUX110_ENV) diff --git a/src/afs/afs.h b/src/afs/afs.h index e22530d..f3cb0c7 100644 --- a/src/afs/afs.h +++ b/src/afs/afs.h @@ -86,6 +86,8 @@ extern int afs_shuttingdown; #define AFS_NRXPACKETS 80 #define AFS_RXDEADTIME 50 #define AFS_HARDDEADTIME 120 +#define AFS_BLKBITS 12 +#define AFS_BLKSIZE (1 << AFS_BLKBITS) extern afs_int32 afs_rx_deadtime; extern afs_int32 afs_rx_harddead; diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index e32c355..5457fec 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -176,6 +176,21 @@ printk("%d\n", _inode.i_blksize);], ac_cv_linux_fs_struct_inode_has_i_blksize=no)]) AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_blksize)]) +AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BLKBITS], [ + AC_MSG_CHECKING([for i_blkbits in struct inode]) + AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_blkbits], [ + AC_TRY_KBUILD( +[#include ], +[struct inode _inode; +printk("%d\n", _inode.i_blkbits);], + ac_cv_linux_fs_struct_inode_has_i_blkbits=yes, + ac_cv_linux_fs_struct_inode_has_i_blkbits=no)]) + AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_blkbits) + if test "x$ac_cv_linux_fs_struct_inode_has_i_blkbits" = "xyes"; then + AC_DEFINE(STRUCT_INODE_HAS_I_BLKBITS, 1, [define if your struct inode has i_blkbits]) + fi]) + + AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_CDEV], [ AC_MSG_CHECKING([for i_cdev in struct inode]) AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_cdev], [ -- 1.9.4