--- fs/nfs.orig/file.c Thu Jul 13 18:51:06 2000 +++ fs/nfs/file.c Thu Jul 13 19:15:58 2000 @@ -37,6 +37,8 @@ static ssize_t nfs_file_write(struct file *, const char *, size_t, loff_t *); static int nfs_file_flush(struct file *); static int nfs_fsync(struct file *, struct dentry *dentry); +static int nfs_file_ioctl(struct inode * inode, struct file *filp, + unsigned int cmd, unsigned long arg); static struct file_operations nfs_file_operations = { NULL, /* lseek - default */ @@ -44,7 +46,7 @@ nfs_file_write, /* write */ NULL, /* readdir - bad */ NULL, /* select - default */ - NULL, /* ioctl - default */ + nfs_file_ioctl, /* ioctl */ nfs_file_mmap, /* mmap */ nfs_open, /* open */ nfs_file_flush, /* flush */ @@ -118,6 +120,20 @@ if (!result) result = generic_file_read(file, buf, count, ppos); return result; +} + +static int +nfs_file_ioctl(struct inode * inode, struct file *filp, unsigned int cmd, + unsigned long arg) +{ + switch (cmd) { + case NFS_IOC_ZAP_CACHES: + nfs_zap_caches(inode); + return 0; + break; + default: + return -EINVAL; + } } static int --- fs/nfs.orig/inode.c Thu Jul 13 18:51:06 2000 +++ fs/nfs/inode.c Thu Jul 13 19:08:03 2000 @@ -37,7 +37,6 @@ #define NFS_PARANOIA 1 static struct inode * __nfs_fhget(struct super_block *, struct nfs_fattr *); -static void nfs_zap_caches(struct inode *); static void nfs_invalidate_inode(struct inode *); static void nfs_read_inode(struct inode *); @@ -432,7 +431,7 @@ /* * Invalidate the local caches */ -static void +void nfs_zap_caches(struct inode *inode) { NFS_ATTRTIMEO(inode) = NFS_MINATTRTIMEO(inode); --- include/linux/nfs_fs.h.orig Thu Jul 13 19:03:21 2000 +++ include/linux/nfs_fs.h Thu Jul 13 19:09:47 2000 @@ -17,6 +17,8 @@ #include #include +#include + /* * Enable debugging support for nfs client. * Requires RPC_DEBUG. @@ -25,6 +27,8 @@ # define NFS_DEBUG #endif +#define NFS_IOC_ZAP_CACHES _IO('d', 0) + /* * NFS_MAX_DIRCACHE controls the number of simultaneously cached * directory chunks. Each chunk holds the list of nfs_entry's returned @@ -184,6 +188,7 @@ extern int nfs_open(struct inode *, struct file *); extern int nfs_release(struct inode *, struct file *); extern int _nfs_revalidate_inode(struct nfs_server *, struct dentry *); +extern void nfs_zap_caches(struct inode *inode); /* * linux/fs/nfs/file.c