LINUX_FS_STRUCT_INODE_HAS_I_DEVICES
LINUX_FS_STRUCT_INODE_HAS_I_SECURITY
LINUX_INODE_SETATTR_RETURN_TYPE
+ LINUX_WRITE_INODE_RETURN_TYPE
+ LINUX_IOP_NAMEIDATA
+ LINUX_AOP_WRITEBACK_CONTROL
LINUX_KERNEL_LINUX_SYSCALL_H
LINUX_KERNEL_SELINUX
LINUX_KERNEL_SOCK_CREATE
if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
AC_DEFINE(INODE_SETATTR_NOT_VOID, 1, [define if your setattr return return non-void])
fi
+ if test "x$ac_cv_linux_func_write_inode_returns_int" = "xyes" ; then
+ AC_DEFINE(WRITE_INODE_NOT_VOID, 1, [define if your sops.write_inode returns non-void])
+ fi
if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then
AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, 1, [define if your struct address_space has page_lock])
fi
#endif
);
if (new) /* piggy back alloc type */
- (unsigned long)new |= KM_TYPE;
+ new = (void *)(KM_TYPE | (unsigned long)new);
} else {
new = (void *)vmalloc(asize);
if (new) /* piggy back alloc type */
- (unsigned long)new |= VM_TYPE;
+ new = (void *)(VM_TYPE | (unsigned long)new);
}
if (!new) {
vfree(MEMADDR(p));
break;
default:
- printf("afs_osi_Free: Asked to free unknown type %d at 0x%x\n",
- MEMTYPE(p), MEMADDR(p));
+ printf("afs_osi_Free: Asked to free unknown type %d at 0x%lx\n",
+ (int)MEMTYPE(p), (unsigned long)MEMADDR(p));
break;
}
memtype = MEMTYPE(lmp->chunk);
if (memtype != KM_TYPE && memtype != VM_TYPE) {
printf
- ("osi_linux_verify_alloced_memory: unknown type %d at 0x%x, index=%d\n",
- memtype, lmp->chunk, index);
+ ("osi_linux_verify_alloced_memory: unknown type %d at 0x%lx, index=%lu\n",
+ (int)memtype, (unsigned long)lmp->chunk, (unsigned long)index);
}
afs_linux_hash_verify_count++;
}
RCSID
("$Header$");
+#include "h/module.h" /* early to avoid printf->printk mapping */
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
#include "afs/afs_stats.h" /* afs statistics */
#include "h/smp_lock.h"
-#include "h/module.h"
int afs_osicred_initialized = 0;
void *
osi_UFSOpen(afs_int32 ainode)
{
- struct inode *ip;
register struct osi_file *afile = NULL;
extern int cacheDiskType;
afs_int32 code = 0;
- int dummy;
struct inode *tip = NULL;
struct file *filp = NULL;
AFS_STATCNT(osi_UFSOpen);
int
osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize)
{
- struct AFS_UCRED *oldCred;
register afs_int32 code;
struct osi_stat tstat;
struct iattr newattrs;
afs_osi_Read(register struct osi_file *afile, int offset, void *aptr,
afs_int32 asize)
{
- struct AFS_UCRED *oldCred;
size_t resid;
register afs_int32 code;
- register afs_int32 cnt1 = 0;
AFS_STATCNT(osi_Read);
/**
afs_osi_Write(register struct osi_file *afile, afs_int32 offset, void *aptr,
afs_int32 asize)
{
- struct AFS_UCRED *oldCred;
size_t resid;
register afs_int32 code;
AFS_STATCNT(osi_Write);
osi_file_uio_rdwr(struct osi_file *osifile, uio_t * uiop, int rw)
{
struct file *filp = &osifile->file;
- struct inode *ip = FILE_INODE(&osifile->file);
KERNEL_SPACE_DECL;
int code = 0;
struct iovec *iov;
* Setup a uio struct.
*/
void
-setup_uio(uio_t * uiop, struct iovec *iovecp, char *buf, afs_offs_t pos,
+setup_uio(uio_t * uiop, struct iovec *iovecp, const char *buf, afs_offs_t pos,
int count, uio_flag_t flag, uio_seg_t seg)
{
- iovecp->iov_base = buf;
+ iovecp->iov_base = (char *)buf;
iovecp->iov_len = count;
uiop->uio_iov = iovecp;
uiop->uio_iovcnt = 1;
int
uiomove(char *dp, int length, uio_flag_t rw, uio_t * uiop)
{
- int count, n;
+ int count;
struct iovec *iov;
int code;
#else
if (ip->i_nrpages) {
#endif
- printf("Failed to invalidate all pages on inode 0x%x\n",
- ip);
+ printf("Failed to invalidate all pages on inode 0x%lx\n",
+ (unsigned long)ip);
}
}
}
#if defined(AFS_LINUX24_ENV)
if (atomic_read(&ip->i_count) > 1)
+ printf("afs_put_inode: ino %ld (0x%lx) has count %ld\n",
+ (long)ip->i_ino, (unsigned long)ip,
+ (long)atomic_read(&ip->i_count));
#else
if (ip->i_count > 1)
+ printf("afs_put_inode: ino %ld (0x%lx) has count %ld\n",
+ (long)ip->i_ino, (unsigned long)ip, (long)ip->i_count);
#endif
- printf("afs_put_inode: ino %d (0x%x) has count %d\n", ip->i_ino, ip,
- ip->i_count);
afs_InactiveVCache(vcp, credp);
ObtainWriteLock(&vcp->lock, 504);
RCSID
("$Header$");
+#include <linux/module.h> /* early to avoid printf->printk mapping */
#include "afs/sysincludes.h"
#include "afsincludes.h"
#include "h/unistd.h" /* For syscall numbers. */
#include "../asm/ia32_unistd.h"
#endif
-#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/slab.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
extern struct file_system_type afs_fs_type;
+#if !defined(AFS_LINUX24_ENV)
static long get_page_offset(void);
+#endif
#if defined(AFS_LINUX24_ENV)
DECLARE_MUTEX(afs_global_lock);
csdbproc_read(char *buffer, char **start, off_t offset, int count,
int *eof, void *data)
{
- int len, i, j;
+ int len, j;
struct afs_q *cq, *tq;
struct cell *tc;
- void *ret = NULL;
char tbuffer[16];
afs_uint32 addr;
{
int len, i, j;
struct rx_peer *sep;
- void *ret = NULL;
- char tbuffer[16];
- afs_uint32 addr;
len = 0;
for (i = 0, j = 0; i < 256; i++) {
for (sep = rx_peerHashTable[i]; sep; sep = sep->next, j++) {
- len += sprintf(buffer + len, "%lx: next=0x%lx, host=0x%x, ", sep, sep->next,
- sep->host);
+ len += sprintf(buffer + len, "%lx: next=0x%lx, host=0x%x, ", (unsigned long)sep,
+ (unsigned long)sep->next, sep->host);
len += sprintf(buffer + len, "ifMTU=%d, natMTU=%d, maxMTU=%d\n", sep->ifMTU,
sep->natMTU, sep->maxMTU);
len += sprintf(buffer + len, "\trtt=%d:%d, timeout(%d:%d), nSent=%d, reSends=%d\n",
sep->timeout.usec, sep->nSent, sep->reSends);
len += sprintf(buffer + len, "\trefCount=%d, port=%d, idleWhen=0x%x\n",
sep->refCount, sep->port, sep->idleWhen);
- len += sprintf(buffer + len, "\tCongestionQueue (0x%x:0x%x), inPacketSkew=0x%x, outPacketSkew=0x%x\n",
- sep->congestionQueue.prev, sep->congestionQueue.next,
+ len += sprintf(buffer + len, "\tCongestionQueue (0x%lx:0x%lx), inPacketSkew=0x%x, outPacketSkew=0x%x\n",
+ (unsigned long)sep->congestionQueue.prev, (unsigned long)sep->congestionQueue.next,
sep->inPacketSkew, sep->outPacketSkew);
#ifdef RX_ENABLE_LOCKS
len += sprintf(buffer + len, "\tpeer_lock=%d\n", sep->peer_lock);
rxstatsproc_read(char *buffer, char **start, off_t offset, int count,
int *eof, void *data)
{
- int len, i, j;
- void *ret = NULL;
- char tbuffer[16];
- afs_uint32 addr;
+ int len, i;
len = 0;
len += sprintf(buffer + len, "packetRequests = %d\n", rx_stats.packetRequests);
rxproc_read(char *buffer, char **start, off_t offset, int count,
int *eof, void *data)
{
- int len, i, j;
- struct rx_peer *sep;
- void *ret = NULL;
- char tbuffer[16];
- afs_uint32 addr;
+ int len, i;
len = 0;
len += sprintf(buffer + len, "rx_extraQuota = %d\n", rx_extraQuota);
len += sprintf(buffer + len, "rxi_nSendFrags = %d\n", rxi_nSendFrags);
len += sprintf(buffer + len, "rx_nPackets = %d\n", rx_nPackets);
len += sprintf(buffer + len, "rx_nFreePackets = %d\n", rx_nFreePackets);
- len += sprintf(buffer + len, "rx_socket = 0x%x\n", rx_socket);
+ len += sprintf(buffer + len, "rx_socket = 0x%lx\n", (unsigned long)rx_socket);
len += sprintf(buffer + len, "rx_Port = %d\n", rx_port);
for (i = 0; i < RX_N_PACKET_CLASSES; i++)
len += sprintf(buffer + len, "\trx_packetQuota[%d] = %d\n", i, rx_packetQuota[i]);
{
int len, i, j;
struct rx_connection *sep;
- void *ret = NULL;
- char tbuffer[16];
- afs_uint32 addr;
len = 0;
for (i = 0, j = 0; i < 256; i++) {
for (sep = rx_connHashTable[i]; sep; sep = sep->next, j++) {
len += sprintf(buffer + len, "%lx: next=0x%lx, peer=0x%lx, epoch=0x%x, cid=0x%x, ackRate=%d\n",
- sep, sep->next, sep->peer, sep->epoch, sep->cid,
- sep->ackRate);
- len += sprintf(buffer + len, "\tcall[%x=%d, %x=%d, %x=%d, %x=%d]\n",
- sep->call[0], sep->callNumber[0], sep->call[1],
- sep->callNumber[1], sep->call[2],
- sep->callNumber[2], sep->call[3],
- sep->callNumber[3]);
+ (unsigned long)sep, (unsigned long)sep->next, (unsigned long)sep->peer,
+ sep->epoch, sep->cid, sep->ackRate);
+ len += sprintf(buffer + len, "\tcall[%lx=%d, %lx=%d, %lx=%d, %lx=%d]\n",
+ (unsigned long)sep->call[0], sep->callNumber[0],
+ (unsigned long)sep->call[1], sep->callNumber[1],
+ (unsigned long)sep->call[2], sep->callNumber[2],
+ (unsigned long)sep->call[3], sep->callNumber[3]);
len += sprintf(buffer + len, "\ttimeout=%d, flags=0x%x, type=0x%x, serviceId=%d, service=0x%lx, refCount=%d\n",
sep->timeout, sep->flags, sep->type,
- sep->serviceId, sep->service, sep->refCount);
+ sep->serviceId, (unsigned long)sep->service, sep->refCount);
len += sprintf(buffer + len, "\tserial=%d, lastSerial=%d, secsUntilDead=%d, secsUntilPing=%d, secIndex=%d\n",
sep->serial, sep->lastSerial, sep->secondsUntilDead,
sep->secondsUntilPing, sep->securityIndex);
len += sprintf(buffer + len, "\terror=%d, secObject=0x%lx, secData=0x%lx, secHeaderSize=%d, secmaxTrailerSize=%d\n",
- sep->error, sep->securityObject, sep->securityData,
- sep->securityHeaderSize,
- sep->securityMaxTrailerSize);
+ sep->error, (unsigned long)sep->securityObject,
+ (unsigned long)sep->securityData,
+ sep->securityHeaderSize, sep->securityMaxTrailerSize);
len += sprintf(buffer + len, "\tchallEvent=0x%lx, lastSendTime=0x%x, maxSerial=%d, hardDeadTime=%d\n",
- sep->challengeEvent, sep->lastSendTime,
+ (unsigned long)sep->challengeEvent, sep->lastSendTime,
sep->maxSerial, sep->hardDeadTime);
if (sep->flags & RX_CONN_MAKECALL_WAITING)
len += sprintf(buffer + len, "\t***** Conn in RX_CONN_MAKECALL_WAITING state *****\n");
{
int len, i, j;
struct rx_service *sentry;
- void *ret = NULL;
- char tbuffer[16];
- afs_uint32 addr;
len = 0;
for (i = 0, j = 0; i < RX_MAX_SERVICES; i++) {
- if (sentry = rx_services[i]) {
+ if ((sentry = rx_services[i])) {
j++;
len += sprintf(buffer + len,
- "\t%lx: serviceId=%d, port=%d, serviceName=%s, socket=0x%x\n",
- sentry, sentry->serviceId, sentry->servicePort,
- sentry->serviceName, sentry->socket);
+ "\t%lx: serviceId=%d, port=%d, serviceName=%s, socket=0x%lx\n",
+ (unsigned long)sentry, sentry->serviceId, sentry->servicePort,
+ sentry->serviceName, (unsigned long)sentry->socket);
len += sprintf(buffer + len,
"\t\tnSecObj=%d, nReqRunning=%d, maxProcs=%d, minProcs=%d, connDeadTime=%d, idleDeadTime=%d\n",
sentry->nSecurityObjects, sentry->nRequestsRunning,
{
int len, i, j, k;
struct rx_connection *sep;
- void *ret = NULL;
- char tbuffer[16];
- afs_uint32 addr;
len = 0;
for (i = 0, j = 0; i < 256; i++) {
j++;
len += sprintf(buffer + len,
"%lx: conn=0x%lx, qiheader(0x%lx:0x%lx), tq(0x%lx:0x%lx), rq(0x%lx:0x%lx)\n",
- call, call->conn, call->queue_item_header.prev,
- call->queue_item_header.next, call->tq.prev,
- call->tq.next, call->rq.prev, call->rq.next);
+ (unsigned long)call, (unsigned long)call->conn,
+ (unsigned long)call->queue_item_header.prev,
+ (unsigned long)call->queue_item_header.next,
+ (unsigned long)call->tq.prev, (unsigned long)call->tq.next,
+ (unsigned long)call->rq.prev, (unsigned long)call->rq.next);
len += sprintf(buffer + len,
- "\t: curvec=%d, curpos=%d, nLeft=%d, nFree=%d, currPacket=0x%lx, callNumber=0x%x\n",
- call->curvec, call->curpos, call->nLeft,
- call->nFree, call->currentPacket,
- call->callNumber);
+ "\t: curvec=%d, curpos=%lx, nLeft=%d, nFree=%d, currPacket=0x%lx, callNumber=0x%lx\n",
+ call->curvec, (unsigned long)call->curpos, call->nLeft,
+ call->nFree, (unsigned long)call->currentPacket,
+ (unsigned long)call->callNumber);
len += sprintf(buffer + len,
"\t: channel=%d, state=0x%x, mode=0x%x, flags=0x%x, localStatus=0x%x, remStatus=0x%x\n",
call->channel, call->state, call->mode,
call->tnext);
len += sprintf(buffer + len,
"\t: twind=%d, resendEvent=0x%lx, timeoutEvent=0x%lx, keepAliveEvent=0x%lx, delayedAckEvent=0x%lx\n",
- call->twind, call->resendEvent,
- call->timeoutEvent, call->keepAliveEvent,
- call->delayedAckEvent);
+ call->twind, (unsigned long)call->resendEvent,
+ (unsigned long)call->timeoutEvent,
+ (unsigned long)call->keepAliveEvent,
+ (unsigned long)call->delayedAckEvent);
len += sprintf(buffer + len,
"\t: lastSendTime=0x%x, lastReceiveTime=0x%x, lastAcked=0x%x, startTime=0x%x, startWait=0x%x\n",
call->lastSendTime, call->lastReceiveTime,
- call->lastAcked, call->startTime,
+ call->lastAcked, call->startTime.sec,
call->startWait);
if (call->flags & RX_CALL_WAIT_PROC)
len += sprintf(buffer + len,
unsigned long *ptr;
unsigned long offset=0;
unsigned long datalen=0;
- int ret;
+#if defined(EXPORTED_KALLSYMS_SYMBOL)
unsigned long token=0;
+#endif
+#if defined(EXPORTED_KALLSYMS_SYMBOL) || defined(EXPORTED_KALLSYMS_ADDRESS)
+ int ret;
char *mod_name;
unsigned long mod_start=0;
unsigned long mod_end=0;
char *sym_name;
unsigned long sym_start=0;
unsigned long sym_end=0;
+#endif
#endif /* EXPORTED_SYS_CALL_TABLE */
RWLOCK_INIT(&afs_xosi, "afs_xosi");
if (!sys_call_table) {
printf("Failed to find address of sys_call_table\n");
} else {
- printf("Found sys_call_table at %x\n", sys_call_table);
+ printf("Found sys_call_table at %lx\n", (unsigned long)sys_call_table);
#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_S390X_LINUX24_ENV)
error cant support this yet.;
#endif /* AFS_SPARC64_LINUX20_ENV */
if (!ia32_sys_call_table) {
printf("Warning: Failed to find address of ia32_sys_call_table\n");
} else {
- printf("Found ia32_sys_call_table at %x\n", ia32_sys_call_table);
+ printf("Found ia32_sys_call_table at %lx\n", (unsigned long)ia32_sys_call_table);
}
#else
- printf("Found ia32_sys_call_table at %x\n", ia32_sys_call_table);
+ printf("Found ia32_sys_call_table at %lx\n", (unsigned long)ia32_sys_call_table);
#endif /* IA32_SYS_CALL_TABLE */
#endif
cleanup_module(void)
#endif
{
- struct task_struct *t;
-
osi_sysctl_clean();
if (sys_call_table) {
#if defined(AFS_IA64_LINUX20_ENV)
extern void osi_linux_free_inode_pages(void);
extern void check_bad_parent(struct dentry *dp);
+/* osi_sysctl.c */
+extern int osi_sysctl_init();
+extern void osi_sysctl_clean();
+
/* osi_vm.c */
extern int osi_VM_FlushVCache(struct vcache *avc, int *slept);
extern void osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred,
/* osi_vfsops.c */
extern void set_inode_cache(struct inode *ip, struct vattr *vp);
+extern void put_inode_on_dummy_list(struct inode *ip);
+extern void vattr2inode(struct inode *ip, struct vattr *vp);
+/* osi_vnodeops.c */
+extern int afs_linux_writepage_sync(struct inode *ip, struct page *pp,
+ unsigned long offset, unsigned int count);
#endif /* _OSI_PROTO_H_ */
afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok)
{
afs_int32 endTime;
- struct timer_list *timer = NULL;
int code;
AFS_STATCNT(osi_Wait);
#define VATTR_NULL(A) memset(A, 0, sizeof(struct vattr))
-/* va_masks - these should match their respective ATTR_xxx #defines in fs.h.
- * afs_notify_change has to use the attr bits in both the Linux and AFS
- * meanings. The glue layer code uses the ATTR_xxx style names.
- */
-#define AT_SIZE ATTR_SIZE
-#define AT_MODE ATTR_MODE
-#undef AT_UID
-#define AT_UID ATTR_UID
-#undef AT_GID
-#define AT_GID ATTR_GID
-#define AT_MTIME ATTR_MTIME
-
-
#define vnodeops inode_operations
#endif /* OSI_VFS_H_ */
RCSID
("$Header$");
+#define __NO_VERSION__ /* don't define kernel_version in module.h */
+#include <linux/module.h> /* early to avoid printf->printk mapping */
#include "afs/sysincludes.h"
#include "afsincludes.h"
#include "afs/afs_stats.h"
#include "h/smp_lock.h"
#endif
-#define __NO_VERSION__ /* don't define kernel_version in module.h */
-#include <linux/module.h>
-
struct vcache *afs_globalVp = 0;
struct vfs *afs_globalVFS = 0;
struct super_block *afs_read_super(struct super_block *sb, void *data, int silent);
int afs_fill_super(struct super_block *sb, void *data, int silent);
static struct super_block *afs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data);
-void put_inode_on_dummy_list(struct inode *ip);
/* afs_file_system
* VFS entry for Linux - installed in init_module
* has synced some pages of a file to disk.
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+#ifdef WRITE_INODE_NOT_VOID
+static int
+#else
static void
+#endif
afs_write_inode(struct inode *ip, int unused)
#else
static void
/* for now we don't actually update the metadata during msync. This
* is just to keep linux happy. */
+#ifdef WRITE_INODE_NOT_VOID
+ return 0;
+#endif
}
static void
afs_delete_inode(struct inode *ip)
{
- struct vcache *vp = ITOAFS(ip);
-
#ifdef AFS_LINUX26_ENV
put_inode_on_dummy_list(ip);
#endif
static void
afs_put_super(struct super_block *sbp)
{
- extern int afs_afs_cold_shutdown;
int code = 0;
- int fv_slept;
AFS_GLOCK();
AFS_STATCNT(afs_unmount);
#endif
osi_linux_verify_alloced_memory();
- done:
AFS_GUNLOCK();
if (!code) {
#if defined(AFS_LINUX24_ENV)
#include "h/smp_lock.h"
#endif
+#if defined(AFS_LINUX26_ENV)
+#include "h/writeback.h"
+#endif
#ifdef pgoff2loff
#define pageoff(pp) pgoff2loff((pp)->index)
if (*offp + count > afs_vmMappingEnd) {
uio_t tuio;
struct iovec iov;
- afs_size_t oldOffset = *offp;
afs_int32 xfered = 0;
if (*offp < afs_vmMappingEnd) {
afs_linux_write(struct file *fp, const char *buf, size_t count, loff_t * offp)
{
ssize_t code = 0;
- int code2;
+ int code2 = 0;
struct vcache *vcp = ITOAFS(fp->f_dentry->d_inode);
struct vrequest treq;
cred_t *credp = crref();
return code;
}
+extern int BlobScan(struct dcache * afile, afs_int32 ablob);
+
/* This is a complete rewrite of afs_readdir, since we can make use of
* filldir instead of afs_readdir_move. Note that changes to vcache/dcache
* handling and use of bulkstats will need to be reflected here as well.
if (de->name)
len = strlen(de->name);
else {
- printf("afs_linux_readdir: afs_dir_GetBlob failed, null name (inode %x, dirpos %d)\n",
- &tdc->f.inode, dirpos);
+ printf("afs_linux_readdir: afs_dir_GetBlob failed, null name (inode %lx, dirpos %d)\n",
+ (unsigned long)&tdc->f.inode, dirpos);
DRelease((struct buffer *) de, 0);
afs_PutDCache(tdc);
ReleaseReadLock(&avc->lock);
ReleaseWriteLock(&vcp->lock);
}
- unlock_exit:
AFS_GUNLOCK();
}
* later on, we shouldn't have to do it until later. Perhaps in the future..
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,10)
+#ifdef DOP_REVALIDATE_TAKES_NAMEIDATA
+static int
+afs_linux_dentry_revalidate(struct dentry *dp, struct nameidata *nd)
+#else
static int
afs_linux_dentry_revalidate(struct dentry *dp, int flags)
+#endif
#else
static int
afs_linux_dentry_revalidate(struct dentry *dp)
#endif
{
- char *name;
+ char *name = NULL;
cred_t *credp = crref();
struct vrequest treq;
struct vcache *lookupvcp = NULL;
*
* name is in kernel space at this point.
*/
+#ifdef IOP_CREATE_TAKES_NAMEIDATA
+int
+afs_linux_create(struct inode *dip, struct dentry *dp, int mode,
+ struct nameidata *nd)
+#else
int
afs_linux_create(struct inode *dip, struct dentry *dp, int mode)
+#endif
{
int code;
cred_t *credp = crref();
struct vattr vattr;
- enum vcexcl excl;
const char *name = dp->d_name.name;
struct inode *ip;
#endif
AFS_GLOCK();
code =
- afs_create(ITOAFS(dip), name, &vattr, NONEXCL, mode,
+ afs_create(ITOAFS(dip), (char *)name, &vattr, NONEXCL, mode,
(struct vcache **)&ip, credp);
if (!code) {
/* afs_linux_lookup */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,10)
+#ifdef IOP_LOOKUP_TAKES_NAMEIDATA
+struct dentry *
+afs_linux_lookup(struct inode *dip, struct dentry *dp,
+ struct nameidata *nd)
+#else
struct dentry *
afs_linux_lookup(struct inode *dip, struct dentry *dp)
+#endif
#else
int
afs_linux_lookup(struct inode *dip, struct dentry *dp)
}
#if defined(AFS_LINUX24_ENV)
+#ifdef AOP_WRITEPAGE_TAKES_WRITEBACK_CONTROL
+int
+afs_linux_writepage(struct page *pp, struct writeback_control *wbc)
+#else
int
afs_linux_writepage(struct page *pp)
+#endif
{
struct address_space *mapping = pp->mapping;
struct inode *inode;
unsigned offset = PAGE_CACHE_SIZE;
long status;
-#ifdef PageLaunder
+#if defined(AFS_LINUX26_ENV)
+ if (PageReclaim(pp)) {
+ return WRITEPAGE_ACTIVATE;
+ }
+#else
if (PageLaunder(pp)) {
return(fail_writepage(pp));
}
/* afs_linux_permission
* Check access rights - returns error if can't check or permission denied.
*/
+#ifdef IOP_PERMISSION_TAKES_NAMEIDATA
+int
+afs_linux_permission(struct inode *ip, int mode, struct nameidata *nd)
+#else
int
afs_linux_permission(struct inode *ip, int mode)
+#endif
{
int code;
cred_t *credp = crref();
/* Boy, was this machine dependent bogosity hard to swallow????.... */
if (av->va_mode != -1) {
#else
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_LINUX22_ENV)
+ if (av->va_mask & ATTR_MODE) {
+#else
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
if (av->va_mask & AT_MODE) {
#else
if (av->va_mode != ((unsigned short)-1)) {
#endif
#endif
+#endif
mask |= AFS_SETMODE;
as->UnixModeBits = av->va_mode & 0xffff;
if (avc->states & CForeign) {
ReleaseWriteLock(&avc->lock);
}
}
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_LINUX22_ENV)
+ if (av->va_mask & ATTR_GID) {
+#else
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
if (av->va_mask & AT_GID) {
#else
#if (defined(AFS_HPUX_ENV) || defined(AFS_SUN_ENV))
if (av->va_gid != -1) {
#endif
#endif /* AFS_SUN5_ENV */
+#endif /* AFS_LINUX22_ENV */
mask |= AFS_SETGROUP;
as->Group = av->va_gid;
}
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_LINUX22_ENV)
+ if (av->va_mask & ATTR_UID) {
+#else
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
if (av->va_mask & AT_UID) {
#else
#if (defined(AFS_HPUX_ENV) || defined(AFS_SUN_ENV))
if (av->va_uid != -1) {
#endif
#endif /* AFS_SUN5_ENV */
+#endif /* AFS_LINUX22_ENV */
mask |= AFS_SETOWNER;
as->Owner = av->va_uid;
}
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_LINUX22_ENV)
+ if (av->va_mask & ATTR_MTIME) {
+#else
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
if (av->va_mask & AT_MTIME) {
#else
if (av->va_mtime.tv_sec != -1) {
#endif
+#endif
mask |= AFS_SETMODTIME;
#ifndef AFS_SGI_ENV
#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
* path (unlike BSD or SUNOS), so we skip this check for Ultrix.
*
*/
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_LINUX22_ENV)
+ if (attrs->va_mask & ATTR_SIZE) {
+#else
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
if (attrs->va_mask & AT_SIZE) {
#else
#ifdef AFS_OSF_ENV
#endif
#endif
#endif
+#endif
if (!afs_AccessOK(avc, PRSFS_WRITE, &treq, DONT_CHECK_MODE_BITS)) {
code = EACCES;
goto done;
#if defined(AFS_SGI_ENV)
AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE);
#endif
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_LINUX22_ENV)
+ if (attrs->va_mask & ATTR_SIZE) {
+#else
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
if (attrs->va_mask & AT_SIZE) {
#else
#if defined(AFS_OSF_ENV)
if (attrs->va_size != -1) {
#endif
#endif
+#endif
afs_size_t tsize = attrs->va_size;
ObtainWriteLock(&avc->lock, 128);
avc->states |= CDirty;
#ifdef AFS_OSF_ENV
-afs_lockctl(struct vcache * avc, struct eflock * af, int flag,
- struct AFS_UCRED * acred, pid_t clid, off_t offset)
+int afs_lockctl(struct vcache * avc, struct eflock * af, int flag,
+ struct AFS_UCRED * acred, pid_t clid, off_t offset)
#elif defined(AFS_SGI_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
- struct AFS_UCRED * acred, pid_t clid)
+int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
+ struct AFS_UCRED * acred, pid_t clid)
#else
u_int clid = 0;
-afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
- struct AFS_UCRED * acred)
+int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
+ struct AFS_UCRED * acred)
#endif
{
struct vrequest treq;
char *cpos, *volnamep;
char type, *buf;
afs_int32 prefetch; /* 1=>None 2=>RO 3=>BK */
- afs_int32 mtptCell, assocCell, hac = 0;
+ afs_int32 mtptCell, assocCell = 0, hac = 0;
afs_int32 samecell, roname, len;
AFS_STATCNT(EvalMountPoint);
}
void
-Check_AtSys(register struct vcache *avc, char *aname,
+Check_AtSys(register struct vcache *avc, const char *aname,
struct sysname_info *state, struct vrequest *areq)
{
int num = 0;
state->offset = -1;
state->allocked = 0;
state->index = 0;
- state->name = aname;
+ state->name = (char *)aname;
}
}
}
afs_PutUser(au, 0);
}
- if (++(state->index) >= num || !(*sysnamelist)[state->index])
+ if (++(state->index) >= num || !(*sysnamelist)[(unsigned int)state->index])
return 0; /* end of list */
}
- strcpy(state->name + state->offset, (*sysnamelist)[state->index]);
+ strcpy(state->name + state->offset, (*sysnamelist)[(unsigned int)state->index]);
return 1;
}
struct afs_q *tq; /* temp queue variable */
AFSCBFids fidParm; /* file ID parm for bulk stat */
AFSBulkStats statParm; /* stat info parm for bulk stat */
- int fidIndex; /* which file were stating */
- struct conn *tcp; /* conn for call */
+ int fidIndex = 0; /* which file were stating */
+ struct conn *tcp = 0; /* conn for call */
AFSCBs cbParm; /* callback parm for bulk stat */
struct server *hostp = 0; /* host we got callback from */
long startTime; /* time we started the call,
* for callback expiration base
*/
- afs_size_t statSeqNo; /* Valued of file size to detect races */
+ afs_size_t statSeqNo = 0; /* Valued of file size to detect races */
int code; /* error code */
long newIndex; /* new index in the dir */
struct DirEntry *dirEntryp; /* dir entry we are examining */
long volStates; /* flags from vol structure */
struct volume *volp = 0; /* volume ptr */
struct VenusFid dotdot;
- int flagIndex; /* First file with bulk fetch flag set */
+ int flagIndex = 0; /* First file with bulk fetch flag set */
int inlinebulk = 0; /* Did we use InlineBulk RPC or not? */
XSTATS_DECLS;
/* first compute some basic parameters. We dont want to prefetch more
tagain:
code = afs_VerifyVCache(adp, areqp);
if (code)
- goto done;
+ goto done2;
dcp = afs_GetDCache(adp, (afs_size_t) 0, areqp, &temp, &temp, 1);
if (!dcp) {
code = ENOENT;
- goto done;
+ goto done2;
}
/* lock the directory cache entry */
} else {
code = 0;
}
+ done2:
osi_FreeLargeSpace(statMemp);
osi_FreeLargeSpace(cbfMemp);
return code;
struct VenusFid dirFid;
register struct dcache *tdc;
afs_int32 code = 0;
+#ifdef AFS_DARWIN14_ENV
int oldref;
+#endif
if (NBObtainWriteLock(&avc->lock, 423))
return 0;
* high-level write op.
*/
if (avc->execsOrWriters <= 0) {
- printf("WARNING: afs_ufswr vp=%x, exOrW=%d\n", avc,
+ printf("WARNING: afs_ufswr vp=%lx, exOrW=%d\n", (unsigned long)avc,
avc->execsOrWriters);
}
#else
* high-level write op.
*/
if (avc->execsOrWriters <= 0) {
- printf("WARNING: afs_ufswr vcp=%x, exOrW=%d\n", avc,
+ printf("WARNING: afs_ufswr vcp=%lx, exOrW=%d\n", (unsigned long)avc,
avc->execsOrWriters);
}
#else
complete_and_exit(0, 0);
break;
default:
- printf("Unknown op %d in StartDaemon()\n", parm);
+ printf("Unknown op %ld in StartDaemon()\n", (long)parm);
break;
}
return 0;
};
+#if defined(AFS_HPUX_64BIT_ENV) || defined(AFS_SUN57_64BIT_ENV) || (defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) && !defined(AFS_AMD64_LINUX20_ENV))
static void
iparam32_to_iparam(const struct iparam32 *src, struct iparam *dst)
{
dst->param3 = src->param3;
dst->param4 = src->param4;
}
+#endif
/*
* If you need to change copyin_iparam(), you may also need to change
for (tp = afs_icl_allSets; tp; tp = np) {
tp->refCount++; /* hold this guy */
ReleaseWriteLock(&afs_icl_lock);
- code = (*aproc) (tp->name, arock, tp);
+ code = (*aproc) (tp->name, arock, (struct afs_icl_log *)tp);
ObtainWriteLock(&afs_icl_lock, 206);
np = tp->nextp; /* tp may disappear next, but not np */
if (--tp->refCount == 0 && (tp->states & ICL_SETF_DELETED))
}
isec = 2;
/* kerberos tickets on channel 2 */
- csec = rxkad_NewClientSecurityObject(level, tu->ct.HandShakeKey,
+ csec = rxkad_NewClientSecurityObject(level,
+ (struct ktc_encryptionKey *)tu->ct.HandShakeKey,
/* kvno */
tu->ct.AuthHandle, tu->stLen,
tu->stp);
strcpy(rootVolName, afs_rootVolumeName);
}
- if (!usingDynroot) {
+ if (usingDynroot) {
+ afs_GetDynrootFid(&afs_rootFid);
+ tvp = afs_GetVolume(&afs_rootFid, NULL, READ_LOCK);
+ } else {
struct cell *lc = afs_GetPrimaryCell(READ_LOCK);
if (!lc)
return ENOENT;
localcell = lc->cellNum;
afs_PutCell(lc, READ_LOCK);
- }
-
- if (usingDynroot) {
- afs_GetDynrootFid(&afs_rootFid);
- tvp = afs_GetVolume(&afs_rootFid, NULL, READ_LOCK);
- } else {
tvp = afs_GetVolumeByName(rootVolName, localcell, 1, NULL, READ_LOCK);
- }
- if (!tvp && !usingDynroot) {
- char buf[128];
- int len = strlen(rootVolName);
-
- if ((len < 9) || strcmp(&rootVolName[len - 9], ".readonly")) {
- strcpy(buf, rootVolName);
- afs_strcat(buf, ".readonly");
- tvp = afs_GetVolumeByName(buf, localcell, 1, NULL, READ_LOCK);
+ if (!tvp) {
+ char buf[128];
+ int len = strlen(rootVolName);
+
+ if ((len < 9) || strcmp(&rootVolName[len - 9], ".readonly")) {
+ strcpy(buf, rootVolName);
+ afs_strcat(buf, ".readonly");
+ tvp = afs_GetVolumeByName(buf, localcell, 1, NULL, READ_LOCK);
+ }
}
- }
- if (tvp) {
- if (!usingDynroot) {
+ if (tvp) {
int volid = (tvp->roVol ? tvp->roVol : tvp->volume);
afs_rootFid.Cell = localcell;
if (afs_rootFid.Fid.Volume && afs_rootFid.Fid.Volume != volid
afs_rootFid.Fid.Vnode = 1;
afs_rootFid.Fid.Unique = 1;
}
+ }
+ if (tvp) {
afs_initState = 300; /* won */
afs_osi_Wakeup(&afs_initState);
afs_PutVolume(tvp, READ_LOCK);
{
afs_int32 chunk;
register afs_int32 i, index;
- register struct dcache *tdc;
+ register struct dcache *tdc = NULL;
AFS_STATCNT(afs_FindDCache);
chunk = AFS_CHUNK(abyte);
register struct osi_file *file;
register struct conn *tc;
int downDCount = 0;
- struct server *newCallback;
+ struct server *newCallback = NULL;
char setNewCallback;
char setVcacheStatus;
char doVcacheUpdate;
struct osi_stat tstat;
register struct osi_file *tfile;
struct afs_fheader theader;
+#ifndef AFS_LINUX22_ENV
struct vnode *filevp;
+#endif
int goodFile;
AFS_STATCNT(afs_InitCacheInfo);
}
int
-afs_MemCacheClose(char *file)
+afs_MemCacheClose(struct osi_file *file)
{
return 0;
}
+#if defined(AFS_SUN57_64BIT_ENV) || defined(AFS_SGI62_ENV)
void *
afs_MemCacheOpen(ino_t blkno)
+#else
+void *
+afs_MemCacheOpen(afs_int32 blkno)
+#endif
{
struct memCacheEntry *mep;
* this routine simulates a read in the Memory Cache
*/
int
-afs_MemReadBlk(register struct memCacheEntry *mceP, int offset, char *dest,
+afs_MemReadBlk(register struct osi_file *fP, int offset, void *dest,
int size)
{
+ register struct memCacheEntry *mceP = (struct memCacheEntry *)fP;
int bytesRead;
MObtainReadLock(&mceP->afs_memLock);
/*XXX: this extends a block arbitrarily to support big directories */
int
-afs_MemWriteBlk(register struct memCacheEntry *mceP, int offset, char *src,
+afs_MemWriteBlk(register struct osi_file *fP, int offset, void *src,
int size)
{
+ register struct memCacheEntry *mceP = (struct memCacheEntry *)fP;
AFS_STATCNT(afs_MemWriteBlk);
MObtainWriteLock(&mceP->afs_memLock, 560);
if (size + offset > mceP->dataSize) {
}
int
-afs_MemCacheTruncate(register struct memCacheEntry *mceP, int size)
+afs_MemCacheTruncate(register struct osi_file *fP, int size)
{
+ register struct memCacheEntry *mceP = (struct memCacheEntry *)fP;
AFS_STATCNT(afs_MemCacheTruncate);
MObtainWriteLock(&mceP->afs_memLock, 313);
int
afs_MemCacheStoreProc(register struct rx_call *acall,
- register struct memCacheEntry *mceP,
+ register struct osi_file *fP,
register afs_int32 alen, struct vcache *avc,
int *shouldWake, afs_size_t * abytesToXferP,
- afs_size_t * abytesXferredP, afs_int32 length)
+ afs_size_t * abytesXferredP)
{
+ register struct memCacheEntry *mceP = (struct memCacheEntry *)fP;
register afs_int32 code;
register int tlen;
int
afs_MemCacheFetchProc(register struct rx_call *acall,
- register struct memCacheEntry *mceP, afs_size_t abase,
+ register struct osi_file *fP, afs_size_t abase,
struct dcache *adc, struct vcache *avc,
afs_size_t * abytesToXferP, afs_size_t * abytesXferredP,
afs_int32 lengthFound)
{
+ register struct memCacheEntry *mceP = (struct memCacheEntry *)fP;
register afs_int32 code;
afs_int32 length;
int moredata = 0;
void *
afs_osi_Alloc(size_t x)
{
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV)
register struct osimem *tm = NULL;
register int size;
+#endif
AFS_STATCNT(osi_Alloc);
/* 0-length allocs may return NULL ptr from AFS_KALLOC, so we special-case
#define PSetClientContext 99 /* Special pioctl to setup caller's creds */
int afs_nobody = NFS_NOBODY;
+#if (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) || defined(AFS_HPUX_64BIT_ENV) || defined(AFS_SUN57_64BIT_ENV) || (defined(AFS_SGI_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) && !defined(AFS_AMD64_LINUX20_ENV))
static void
afs_ioctl32_to_afs_ioctl(const struct afs_ioctl32 *src, struct afs_ioctl *dst)
{
dst->in_size = src->in_size;
dst->out_size = src->out_size;
}
+#endif
/*
* If you need to change copyin_afs_ioctl(), you may also need to change
int follow;
{
struct afs_ioctl data;
- struct AFS_UCRED *tmpcred, *foreigncreds = NULL;
+#ifdef AFS_NEED_CLIENTCONTEXT
+ struct AFS_UCRED *tmpcred;
+#endif
+ struct AFS_UCRED *foreigncreds = NULL;
register afs_int32 code = 0;
- struct vnode *vp;
+ struct vnode *vp = NULL;
#ifdef AFS_DEC_ENV
struct vnode *gp;
#endif
char *motd = afs_osi_Alloc(256);
register struct conn *tc;
register afs_int32 code = 0;
- struct VolumeStatus volstat;
+ struct AFSFetchVolumeStatus volstat;
register char *cp;
char *Name, *OfflineMsg, *MOTD;
XSTATS_DECLS;
/* for the reader. */
DECL_PIOCTL(PSetSysName)
{
- char *cp, *cp2, inname[MAXSYSNAME], outname[MAXSYSNAME];
+ char *cp, *cp2 = NULL, inname[MAXSYSNAME], outname[MAXSYSNAME];
int setsysname, foundname = 0;
register struct afs_exporter *exporter;
register struct unixuser *au;
/* afs_memcache.c */
extern int afs_InitMemCache(int blkCount, int blkSize, int flags);
-extern int afs_MemCacheClose(char *file);
+extern int afs_MemCacheClose(struct osi_file *file);
+#if defined(AFS_SUN57_64BIT_ENV) || defined(AFS_SGI62_ENV)
extern void *afs_MemCacheOpen(ino_t blkno);
-extern int afs_MemReadBlk(register struct memCacheEntry *mceP, int offset,
- char *dest, int size);
+#else
+extern void *afs_MemCacheOpen(afs_int32 blkno);
+#endif
+extern int afs_MemReadBlk(register struct osi_file *fP, int offset,
+ void *dest, int size);
extern int afs_MemReadvBlk(register struct memCacheEntry *mceP, int offset,
struct iovec *iov, int nio, int size);
extern int afs_MemReadUIO(ino_t blkno, struct uio *uioP);
-extern int afs_MemWriteBlk(register struct memCacheEntry *mceP, int offset,
- char *src, int size);
+extern int afs_MemWriteBlk(register struct osi_file *fP, int offset,
+ void *src, int size);
extern int afs_MemWritevBlk(register struct memCacheEntry *mceP, int offset,
struct iovec *iov, int nio, int size);
extern int afs_MemWriteUIO(ino_t blkno, struct uio *uioP);
-extern int afs_MemCacheTruncate(register struct memCacheEntry *mceP,
+extern int afs_MemCacheTruncate(register struct osi_file *fP,
int size);
extern int afs_MemCacheStoreProc(register struct rx_call *acall,
- register struct memCacheEntry *mceP,
+ register struct osi_file *fP,
register afs_int32 alen, struct vcache *avc,
int *shouldWake, afs_size_t * abytesToXferP,
- afs_size_t * abytesXferredP,
- afs_int32 length);
+ afs_size_t * abytesXferredP);
extern int afs_MemCacheFetchProc(register struct rx_call *acall,
- register struct memCacheEntry *mceP,
+ register struct osi_file *fP,
afs_size_t abase, struct dcache *adc,
struct vcache *avc,
afs_size_t * abytesToXferP,
extern int osi_rdwr(int rw, struct osi_file *file, caddr_t addrp,
size_t asize, size_t * resid);
extern int osi_file_uio_rdwr(struct osi_file *osifile, uio_t * uiop, int rw);
-extern void setup_uio(uio_t * uiop, struct iovec *iovecp, char *buf,
+extern void setup_uio(uio_t * uiop, struct iovec *iovecp, const char *buf,
afs_offs_t pos, int count, uio_flag_t flag,
uio_seg_t seg);
extern int uiomove(char *dp, int length, uio_flag_t rw, uio_t * uiop);
extern struct vcache *afs_globalVp;
#ifdef AFS_LINUX20_ENV
extern void vcache2inode(struct vcache *avc);
+extern void vcache2fakeinode(struct vcache *rootvp, struct vcache *mpvp);
#endif
/* afs_pioctl.c */
extern void afs_RemoveSrvAddr(struct srvAddr *sap);
extern void afs_ActivateServer(struct srvAddr *sap);
#ifdef AFS_USERSPACE_IP_ADDR
-extern int afsi_SetServerIPRank(struct srvAddr *sa, afs_int32 addr,
+extern void afsi_SetServerIPRank(struct srvAddr *sa, afs_int32 addr,
afs_uint32 subnetmask);
#else
#if (!defined(AFS_SUN5_ENV)) && defined(USEIFADDR)
#endif
#endif
extern int afs_HaveCallBacksFrom(struct server *aserver);
+extern void shutdown_server(void);
struct vrequest *areq);
extern void afs_PutFakeStat(struct afs_fakestat_state *state);
extern int afs_ENameOK(register char *aname);
-extern void Check_AtSys(register struct vcache *avc, char *aname,
+extern void Check_AtSys(register struct vcache *avc, const char *aname,
struct sysname_info *state, struct vrequest *areq);
extern int Next_AtSys(register struct vcache *avc, struct vrequest *areq,
struct sysname_info *state);
extern int afs_UFSRead(register struct vcache *avc, struct uio *auio,
struct AFS_UCRED *acred, daddr_t albn,
struct buf **abpp, int noLock);
+extern void afs_PrefetchChunk(struct vcache *avc, struct dcache *adc,
+ struct AFS_UCRED *acred, struct vrequest *areq);
/* VNOPS/afs_vnop_readdir.c */
*/
origCBs = afs_allCBs;
- retry:
maxStoredLength = 0;
tlen = avc->m.Length;
minj = 0;
afs_size_t base, bytes;
afs_uint32 nchunks;
int nomore;
- unsigned int first;
+ unsigned int first = 0;
int *shouldwake;
struct conn *tc;
struct osi_file *tfile;
struct conn *tc;
afs_int32 i, j;
afs_int32 code;
- afs_int32 start, end, delta;
+ afs_int32 start, end = 0, delta;
osi_timeval_t tv;
- int setTimer;
struct unixuser *tu;
char tbuffer[CVBS];
int srvAddrCount;
struct conn **conns;
int nconns;
struct rx_connection **rxconns;
- int nrxconns;
afs_int32 *conntimer, *deltas;
- XSTATS_DECLS;
AFS_STATCNT(afs_CheckServers);
* afs_uint32 subnetmask; subnet mask of local addr in net order
*
*/
-int
+void
afsi_SetServerIPRank(struct srvAddr *sa, afs_int32 addr,
afs_uint32 subnetmask)
{
typedef struct timeval osi_timeval_t;
#endif /* !KERNEL */
-#define XSTATS_DECLS struct afs_stats_opTimingData *opP; \
+#define XSTATS_DECLS struct afs_stats_opTimingData *opP = NULL; \
osi_timeval_t opStartTime, opStopTime, elapsedTime
#define XSTATS_START_TIME(arg) \
for (i = 0; i < NSERVERS; i++) {
for (ts = afs_servers[i]; ts; ts = ts->next) {
if (ts->flags & SRVR_ISDOWN)
- printf("Server entry %x is marked down\n", ts);
+ printf("Server entry %lx is marked down\n", (unsigned long)ts);
for (sa = ts->addr; sa; sa = sa->next_sa) {
for (tc = sa->conns; tc; tc = tc->next) {
if (tc->refCount)
for (i = 0; i < NUSERS; i++) {
for (tu = afs_users[i]; tu; tu = tu->next) {
if (tu->refCount)
- printf("user at %x is held\n", tu);
+ printf("user at %lx is held\n", (unsigned long)tu);
}
}
}
static struct volume *
-afs_SetupVolume(afs_int32 volid, char *aname, char *ve, struct cell *tcell,
+afs_SetupVolume(afs_int32 volid, char *aname, void *ve, struct cell *tcell,
afs_int32 agood, afs_int32 type, struct vrequest *areq)
{
struct volume *tv;
/* Avoid conflicts with coda overloading AFS type namespace. Must precede
* inclusion of uaccess.h.
*/
+#ifndef _LINUX_CODA_FS_I
#define _LINUX_CODA_FS_I
+#endif
#define _CFS_HEADER_
struct coda_inode_info {
};
ac_cv_linux_func_inode_setattr_returns_int=no)])
AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int)
CPPFLAGS="$save_CPPFLAGS"])
+
+AC_DEFUN([LINUX_WRITE_INODE_RETURN_TYPE],[
+AC_MSG_CHECKING(for write_inode return type)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_func_write_inode_returns_int,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>],
+[struct inode _inode;
+struct super_operations _sops;
+int i;
+i = _sops.write_inode(&_inode, 0);],
+ac_cv_linux_func_write_inode_returns_int=yes,
+ac_cv_linux_func_write_inode_returns_int=no)])
+AC_MSG_RESULT($ac_cv_linux_func_write_inode_returns_int)
+CPPFLAGS="$save_CPPFLAGS"])
+
+AC_DEFUN([LINUX_IOP_NAMEIDATA],[
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+AC_MSG_CHECKING(whether inode_operations.create takes a nameidata)
+AC_CACHE_VAL(ac_cv_linux_func_i_create_takes_nameidata,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct inode _inode;
+struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
+ac_cv_linux_func_i_create_takes_nameidata=yes,
+ac_cv_linux_func_i_create_takes_nameidata=no)])
+AC_MSG_RESULT($ac_cv_linux_func_i_create_takes_nameidata)
+if test "x$ac_cv_linux_func_i_create_takes_nameidata" = "xyes" ; then
+AC_DEFINE(IOP_CREATE_TAKES_NAMEIDATA, 1, [define if your iops.create takes a nameidata argument])
+fi
+AC_MSG_CHECKING(whether inode_operations.lookup takes a nameidata)
+AC_CACHE_VAL(ac_cv_linux_func_i_lookup_takes_nameidata,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct inode _inode;
+struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
+ac_cv_linux_func_i_lookup_takes_nameidata=yes,
+ac_cv_linux_func_i_lookup_takes_nameidata=no)])
+AC_MSG_RESULT($ac_cv_linux_func_i_lookup_takes_nameidata)
+if test "x$ac_cv_linux_func_i_lookup_takes_nameidata" = "xyes" ; then
+AC_DEFINE(IOP_LOOKUP_TAKES_NAMEIDATA, 1, [define if your iops.lookup takes a nameidata argument])
+fi
+AC_MSG_CHECKING(whether inode_operations.permission takes a nameidata)
+AC_CACHE_VAL(ac_cv_linux_func_i_permission_takes_nameidata,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct inode _inode;
+struct nameidata _nameidata;
+(void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
+ac_cv_linux_func_i_permission_takes_nameidata=yes,
+ac_cv_linux_func_i_permission_takes_nameidata=no)])
+AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)
+if test "x$ac_cv_linux_func_i_permission_takes_nameidata" = "xyes" ; then
+AC_DEFINE(IOP_PERMISSION_TAKES_NAMEIDATA, 1, [define if your iops.permission takes a nameidata argument])
+fi
+AC_MSG_CHECKING(whether dentry_operations.d_revalidate takes a nameidata)
+CPPFLAGS="$CPPFLAGS -Werror"
+AC_CACHE_VAL(ac_cv_linux_func_d_revalidate_takes_nameidata,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
+ac_cv_linux_func_d_revalidate_takes_nameidata=yes,
+ac_cv_linux_func_d_revalidate_takes_nameidata=no)])
+AC_MSG_RESULT($ac_cv_linux_func_d_revalidate_takes_nameidata)
+if test "x$ac_cv_linux_func_d_revalidate_takes_nameidata" = "xyes" ; then
+ AC_DEFINE(DOP_REVALIDATE_TAKES_NAMEIDATA, 1, [define if your dops.d_revalidate takes a nameidata argument])
+fi
+CPPFLAGS="$save_CPPFLAGS"])
+
+AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL],[
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+AC_MSG_CHECKING(whether address_space_operations.writepage takes a writeback_control)
+AC_CACHE_VAL(ac_cv_linux_func_a_writepage_takes_writeback_control,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/writeback.h>],
+[struct address_space_operations _aops;
+struct page _page;
+struct writeback_control _writeback_control;
+(void)_aops.writepage(&_page, &_writeback_control);],
+ac_cv_linux_func_a_writepage_takes_writeback_control=yes,
+ac_cv_linux_func_a_writepage_takes_writeback_control=no)])
+AC_MSG_RESULT($ac_cv_linux_func_a_writepage_takes_writeback_control)
+if test "x$ac_cv_linux_func_a_writepage_takes_writeback_control" = "xyes" ; then
+AC_DEFINE(AOP_WRITEPAGE_TAKES_WRITEBACK_CONTROL, 1, [define if your aops.writepage takes a struct writeback_control argument])
+fi
+CPPFLAGS="$save_CPPFLAGS"])