From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-kernel@vger.kernel.org, richard@bouska.cz
Subject: Re: NFS mountned directory and apache2 (2.5.47)
Date: Sun, 17 Nov 2002 21:18:04 +0100 [thread overview]
Message-ID: <15831.63868.96933.508631@helicity.uio.no> (raw)
In-Reply-To: <20021116044454.A31763@infradead.org>
>>>>> " " == Christoph Hellwig <hch@infradead.org> writes:
> just a little bit more then one line :) nfs needs to do the
> same revalidation as in nfs_file_read and then call
> generic_file_sendfile.
Duh, I must have eaten a bad mushroom at dinner. Thanks for staying
awake...
The correct patch is of course as appended.
Cheers,
Trond
--- linux-2.5.47/fs/nfs/file.c 2002-11-08 14:16:27.000000000 -0500
+++ linux-2.5.47-01-sendfile/fs/nfs/file.c 2002-11-17 15:15:04.000000000 -0500
@@ -35,6 +35,7 @@
#define NFSDBG_FACILITY NFSDBG_FILE
static int nfs_file_mmap(struct file *, struct vm_area_struct *);
+static ssize_t nfs_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *);
static ssize_t nfs_file_read(struct kiocb *, char *, size_t, loff_t);
static ssize_t nfs_file_write(struct kiocb *, const char *, size_t, loff_t);
static int nfs_file_flush(struct file *);
@@ -52,6 +53,7 @@
.release = nfs_release,
.fsync = nfs_fsync,
.lock = nfs_lock,
+ .sendfile = nfs_file_sendfile,
};
struct inode_operations nfs_file_inode_operations = {
@@ -102,6 +104,24 @@
return result;
}
+static ssize_t
+nfs_file_sendfile(struct file *filp, loff_t *ppos, size_t count,
+ read_actor_t actor, void *target)
+{
+ struct dentry *dentry = filp->f_dentry;
+ struct inode *inode = dentry->d_inode;
+ ssize_t res;
+
+ dfprintk(VFS, "nfs: sendfile(%s/%s, %lu@%Lu)\n",
+ dentry->d_parent->d_name.name, dentry->d_name.name,
+ (unsigned long) count, (unsigned long long) *ppos);
+
+ res = nfs_revalidate_inode(NFS_SERVER(inode), inode);
+ if (!res)
+ res = generic_file_sendfile(filp, ppos, count, actor, target);
+ return res;
+}
+
static int
nfs_file_mmap(struct file * file, struct vm_area_struct * vma)
{
next prev parent reply other threads:[~2002-11-17 20:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-15 18:19 Petr Vandrovec
2002-11-15 20:16 ` Trond Myklebust
2002-11-15 20:26 ` Christoph Hellwig
2002-11-15 20:53 ` Trond Myklebust
2002-11-16 4:44 ` Christoph Hellwig
2002-11-17 20:18 ` Trond Myklebust [this message]
2002-11-15 21:10 ` Linus Torvalds
-- strict thread matches above, loose matches on Subject: below --
2002-11-15 10:25 Richard Bouska
2002-11-15 18:10 ` Trond Myklebust
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15831.63868.96933.508631@helicity.uio.no \
--to=trond.myklebust@fys.uio.no \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=richard@bouska.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®