direct.c (eb5bc2a213f96bd43b5f00a625acb0c669613645) direct.c (66ee59af630fd8d5f4f56fb28162857e629aa0ab)
1/*
2 * linux/fs/nfs/direct.c
3 *
4 * Copyright (C) 2003 by Chuck Lever <cel@netapp.com>
5 *
6 * High-performance uncached I/O for the Linux NFS client
7 *
8 * There are important applications whose performance or correctness

--- 251 unchanged lines hidden (view full) ---

260 return 0;
261
262#ifndef CONFIG_NFS_SWAP
263 dprintk("NFS: nfs_direct_IO (%pD) off/no(%Ld/%lu) EINVAL\n",
264 iocb->ki_filp, (long long) pos, iter->nr_segs);
265
266 return -EINVAL;
267#else
1/*
2 * linux/fs/nfs/direct.c
3 *
4 * Copyright (C) 2003 by Chuck Lever <cel@netapp.com>
5 *
6 * High-performance uncached I/O for the Linux NFS client
7 *
8 * There are important applications whose performance or correctness

--- 251 unchanged lines hidden (view full) ---

260 return 0;
261
262#ifndef CONFIG_NFS_SWAP
263 dprintk("NFS: nfs_direct_IO (%pD) off/no(%Ld/%lu) EINVAL\n",
264 iocb->ki_filp, (long long) pos, iter->nr_segs);
265
266 return -EINVAL;
267#else
268 VM_BUG_ON(iocb->ki_nbytes != PAGE_SIZE);
268 VM_BUG_ON(iov_iter_count(iter) != PAGE_SIZE);
269
270 if (rw == READ)
271 return nfs_file_direct_read(iocb, iter, pos);
272 return nfs_file_direct_write(iocb, iter, pos);
273#endif /* CONFIG_NFS_SWAP */
274}
275
276static void nfs_direct_release_pages(struct page **pages, unsigned int npages)
277{
278 unsigned int i;
279 for (i = 0; i < npages; i++)
280 page_cache_release(pages[i]);
281}
282
283void nfs_init_cinfo_from_dreq(struct nfs_commit_info *cinfo,
284 struct nfs_direct_req *dreq)
285{
269
270 if (rw == READ)
271 return nfs_file_direct_read(iocb, iter, pos);
272 return nfs_file_direct_write(iocb, iter, pos);
273#endif /* CONFIG_NFS_SWAP */
274}
275
276static void nfs_direct_release_pages(struct page **pages, unsigned int npages)
277{
278 unsigned int i;
279 for (i = 0; i < npages; i++)
280 page_cache_release(pages[i]);
281}
282
283void nfs_init_cinfo_from_dreq(struct nfs_commit_info *cinfo,
284 struct nfs_direct_req *dreq)
285{
286 cinfo->lock = &dreq->inode->i_lock;
286 cinfo->lock = &dreq->lock;
287 cinfo->mds = &dreq->mds_cinfo;
288 cinfo->ds = &dreq->ds_cinfo;
289 cinfo->dreq = dreq;
290 cinfo->completion_ops = &nfs_direct_commit_completion_ops;
291}
292
293static inline void nfs_direct_setup_mirroring(struct nfs_direct_req *dreq,
294 struct nfs_pageio_descriptor *pgio,

--- 787 unchanged lines hidden ---
287 cinfo->mds = &dreq->mds_cinfo;
288 cinfo->ds = &dreq->ds_cinfo;
289 cinfo->dreq = dreq;
290 cinfo->completion_ops = &nfs_direct_commit_completion_ops;
291}
292
293static inline void nfs_direct_setup_mirroring(struct nfs_direct_req *dreq,
294 struct nfs_pageio_descriptor *pgio,

--- 787 unchanged lines hidden ---