direct.c (95d465fd750897ab32462a6702fbfe1b122cbbc0) | direct.c (e99170ff3b799a9fd43d538932a9231fac1de9d4) |
---|---|
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 --- 98 unchanged lines hidden (view full) --- 107 * 108 * The presence of this routine in the address space ops vector means 109 * the NFS client supports direct I/O. However, we shunt off direct 110 * read and write requests before the VFS gets them, so this method 111 * should never be called. 112 */ 113ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_t pos, unsigned long nr_segs) 114{ | 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 --- 98 unchanged lines hidden (view full) --- 107 * 108 * The presence of this routine in the address space ops vector means 109 * the NFS client supports direct I/O. However, we shunt off direct 110 * read and write requests before the VFS gets them, so this method 111 * should never be called. 112 */ 113ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_t pos, unsigned long nr_segs) 114{ |
115 struct dentry *dentry = iocb->ki_filp->f_dentry; 116 | |
117 dprintk("NFS: nfs_direct_IO (%s) off/no(%Ld/%lu) EINVAL\n", | 115 dprintk("NFS: nfs_direct_IO (%s) off/no(%Ld/%lu) EINVAL\n", |
118 dentry->d_name.name, (long long) pos, nr_segs); | 116 iocb->ki_filp->f_dentry->d_name.name, 117 (long long) pos, nr_segs); |
119 120 return -EINVAL; 121} 122 123static void nfs_free_user_pages(struct page **pages, int npages, int do_dirty) 124{ 125 int i; 126 for (i = 0; i < npages; i++) { --- 336 unchanged lines hidden (view full) --- 463static const struct rpc_call_ops nfs_commit_direct_ops = { 464 .rpc_call_done = nfs_direct_commit_result, 465 .rpc_release = nfs_commit_release, 466}; 467 468static void nfs_direct_commit_schedule(struct nfs_direct_req *dreq) 469{ 470 struct nfs_write_data *data = dreq->commit_data; | 118 119 return -EINVAL; 120} 121 122static void nfs_free_user_pages(struct page **pages, int npages, int do_dirty) 123{ 124 int i; 125 for (i = 0; i < npages; i++) { --- 336 unchanged lines hidden (view full) --- 462static const struct rpc_call_ops nfs_commit_direct_ops = { 463 .rpc_call_done = nfs_direct_commit_result, 464 .rpc_release = nfs_commit_release, 465}; 466 467static void nfs_direct_commit_schedule(struct nfs_direct_req *dreq) 468{ 469 struct nfs_write_data *data = dreq->commit_data; |
471 struct rpc_task *task = &data->task; | |
472 473 data->inode = dreq->inode; 474 data->cred = dreq->ctx->cred; 475 476 data->args.fh = NFS_FH(data->inode); 477 data->args.offset = dreq->pos; 478 data->args.count = dreq->user_count; 479 data->res.count = 0; --- 4 unchanged lines hidden (view full) --- 484 &nfs_commit_direct_ops, data); 485 NFS_PROTO(data->inode)->commit_setup(data, 0); 486 487 data->task.tk_priority = RPC_PRIORITY_NORMAL; 488 data->task.tk_cookie = (unsigned long)data->inode; 489 /* Note: task.tk_ops->rpc_release will free dreq->commit_data */ 490 dreq->commit_data = NULL; 491 | 470 471 data->inode = dreq->inode; 472 data->cred = dreq->ctx->cred; 473 474 data->args.fh = NFS_FH(data->inode); 475 data->args.offset = dreq->pos; 476 data->args.count = dreq->user_count; 477 data->res.count = 0; --- 4 unchanged lines hidden (view full) --- 482 &nfs_commit_direct_ops, data); 483 NFS_PROTO(data->inode)->commit_setup(data, 0); 484 485 data->task.tk_priority = RPC_PRIORITY_NORMAL; 486 data->task.tk_cookie = (unsigned long)data->inode; 487 /* Note: task.tk_ops->rpc_release will free dreq->commit_data */ 488 dreq->commit_data = NULL; 489 |
492 dprintk("NFS: %5u initiated commit call\n", task->tk_pid); | 490 dprintk("NFS: %5u initiated commit call\n", data->task.tk_pid); |
493 494 lock_kernel(); 495 rpc_execute(&data->task); 496 unlock_kernel(); 497} 498 499static void nfs_direct_write_complete(struct nfs_direct_req *dreq, struct inode *inode) 500{ --- 418 unchanged lines hidden --- | 491 492 lock_kernel(); 493 rpc_execute(&data->task); 494 unlock_kernel(); 495} 496 497static void nfs_direct_write_complete(struct nfs_direct_req *dreq, struct inode *inode) 498{ --- 418 unchanged lines hidden --- |