summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2002-10-06 19:39:29 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-10-06 19:39:29 -0700
commite7f900845581666f38aedca7505b3f43aa69139e (patch)
tree5f31391b0c128a0017e2d6207b2b142e2fab65d6 /include/linux
parente1b24127c37d1a029374c77c5583ebfcbadb901a (diff)
parentc03e7607e0391b919d3f6ded8c98fdcddbcb20b1 (diff)
Merge
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h5
-rw-r--r--include/linux/nfs_fs.h15
-rw-r--r--include/linux/nfs_page.h5
-rw-r--r--include/linux/nfs_xdr.h22
4 files changed, 35 insertions, 12 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index ad6648e3fd9c..327a63b8b934 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -308,7 +308,8 @@ struct address_space_operations {
int (*bmap)(struct address_space *, long);
int (*invalidatepage) (struct page *, unsigned long);
int (*releasepage) (struct page *, int);
- int (*direct_IO)(int, struct inode *, const struct iovec *iov, loff_t offset, unsigned long nr_segs);
+ int (*direct_IO)(int, struct file *, const struct iovec *iov,
+ loff_t offset, unsigned long nr_segs);
};
struct backing_dev_info;
@@ -1242,7 +1243,7 @@ ssize_t generic_file_write_nolock(struct file *file, const struct iovec *iov,
unsigned long nr_segs, loff_t *ppos);
extern ssize_t generic_file_sendfile(struct file *, struct file *, loff_t *, size_t);
extern void do_generic_file_read(struct file *, loff_t *, read_descriptor_t *, read_actor_t);
-extern ssize_t generic_file_direct_IO(int rw, struct inode *inode,
+extern ssize_t generic_file_direct_IO(int rw, struct file *file,
const struct iovec *iov, loff_t offset, unsigned long nr_segs);
extern int generic_direct_IO(int rw, struct inode *inode, const struct iovec
*iov, loff_t offset, unsigned long nr_segs, get_blocks_t *get_blocks);
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 16b3e1be73e3..582c7aa90344 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -14,6 +14,7 @@
#include <linux/mm.h>
#include <linux/pagemap.h>
#include <linux/wait.h>
+#include <linux/uio.h>
#include <linux/nfs_fs_sb.h>
@@ -24,6 +25,7 @@
#include <linux/nfs.h>
#include <linux/nfs2.h>
#include <linux/nfs3.h>
+#include <linux/nfs_page.h>
#include <linux/nfs_xdr.h>
/*
@@ -242,9 +244,9 @@ loff_t page_offset(struct page *page)
}
static inline
-unsigned long page_index(struct page *page)
+loff_t req_offset(struct nfs_page *req)
{
- return page->index;
+ return ((loff_t)req->wb_index) << PAGE_CACHE_SHIFT;
}
/*
@@ -284,6 +286,12 @@ nfs_file_cred(struct file *file)
}
/*
+ * linux/fs/nfs/direct.c
+ */
+extern int nfs_direct_IO(int, struct file *, const struct iovec *, loff_t,
+ unsigned long);
+
+/*
* linux/fs/nfs/dir.c
*/
extern struct inode_operations nfs_dir_inode_operations;
@@ -353,7 +361,8 @@ nfs_wb_all(struct inode *inode)
static inline int
nfs_wb_page(struct inode *inode, struct page* page)
{
- int error = nfs_sync_file(inode, 0, page_index(page), 1, FLUSH_WAIT | FLUSH_STABLE);
+ int error = nfs_sync_file(inode, 0, page->index, 1,
+ FLUSH_WAIT | FLUSH_STABLE);
return (error < 0) ? error : 0;
}
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 6bc44a6b1cb7..029818ff0870 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -33,7 +33,8 @@ struct nfs_page {
struct page *wb_page; /* page to read in/write out */
wait_queue_head_t wb_wait; /* wait queue */
unsigned long wb_timeout; /* when to read/write/commit */
- unsigned int wb_offset, /* Offset of read/write */
+ unsigned long wb_index; /* Offset within mapping */
+ unsigned int wb_offset, /* Offset within page */
wb_bytes, /* Length of request */
wb_count; /* reference count */
unsigned long wb_flags;
@@ -47,6 +48,7 @@ extern struct nfs_page *nfs_create_request(struct rpc_cred *, struct inode *,
unsigned int, unsigned int);
extern void nfs_clear_request(struct nfs_page *req);
extern void nfs_release_request(struct nfs_page *req);
+extern void nfs_release_list(struct list_head *list);
extern void nfs_list_add_request(struct nfs_page *, struct list_head *);
@@ -58,6 +60,7 @@ extern int nfs_scan_list(struct list_head *, struct list_head *,
extern int nfs_coalesce_requests(struct list_head *, struct list_head *,
unsigned int);
extern int nfs_wait_on_request(struct nfs_page *);
+extern int nfs_wait_for_reads(struct list_head *);
extern spinlock_t nfs_wreq_lock;
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index c68916571e71..8d9c04899d65 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1,6 +1,8 @@
#ifndef _LINUX_NFS_XDR_H
#define _LINUX_NFS_XDR_H
+#include <linux/sunrpc/xprt.h>
+
struct nfs_fattr {
unsigned short valid; /* which fields are valid */
__u64 pre_size; /* pre_op_attr.size */
@@ -57,10 +59,14 @@ struct nfs_fsinfo {
__u32 namelen;/* max name length */
};
-/* Arguments to the read call.
- * Note that NFS_READ_MAXIOV must be <= (MAX_IOVEC-2) from sunrpc/xprt.h
+/*
+ * Arguments to the read call.
*/
-#define NFS_READ_MAXIOV 8
+
+#define NFS_READ_MAXIOV (9U)
+#if (NFS_READ_MAXIOV > (MAX_IOVEC -2))
+#error "NFS_READ_MAXIOV is too large"
+#endif
struct nfs_readargs {
struct nfs_fh * fh;
@@ -76,10 +82,14 @@ struct nfs_readres {
int eof;
};
-/* Arguments to the write call.
- * Note that NFS_WRITE_MAXIOV must be <= (MAX_IOVEC-2) from sunrpc/xprt.h
+/*
+ * Arguments to the write call.
*/
-#define NFS_WRITE_MAXIOV 8
+#define NFS_WRITE_MAXIOV (9U)
+#if (NFS_WRITE_MAXIOV > (MAX_IOVEC -2))
+#error "NFS_WRITE_MAXIOV is too large"
+#endif
+
struct nfs_writeargs {
struct nfs_fh * fh;
__u64 offset;