All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Love <rml@tech9.net>
To: Alexander Viro <viro@math.psu.edu>
Cc: Jan Harkes <jaharkes@cs.cmu.edu>,
	torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.5: further llseek cleanup (1/3)
Date: 31 Jan 2002 17:04:23 -0500	[thread overview]
Message-ID: <1012514664.3213.186.camel@phantasy> (raw)
In-Reply-To: <Pine.GSO.4.21.0201311649460.17860-100000@weyl.math.psu.edu>
In-Reply-To: <Pine.GSO.4.21.0201311649460.17860-100000@weyl.math.psu.edu>

On Thu, 2002-01-31 at 16:51, Alexander Viro wrote:
>
> On 31 Jan 2002, Robert Love wrote:
> > I'd be happy to keep Coda using the new generic_file_llseek if Al Viro
> > agrees with you.  Al?
> 
> I'm OK with that.

OK, updated patch in my ftp as well as attached below.

Linus, this patch supersedes the previous patch #1.  2 and 3 are
separate and up for inclusion.

	Robert Love

diff -urN linux-2.5.3/fs/ncpfs/file.c linux/fs/ncpfs/file.c
--- linux-2.5.3/fs/ncpfs/file.c	Thu Jan 31 01:08:54 2002
+++ linux/fs/ncpfs/file.c	Thu Jan 31 01:09:47 2002
@@ -281,7 +281,7 @@
 
 struct file_operations ncp_file_operations =
 {
-	llseek:		generic_file_llseek,
+	llseek:		remote_llseek,
 	read:		ncp_file_read,
 	write:		ncp_file_write,
 	ioctl:		ncp_ioctl,
diff -urN linux-2.5.3/fs/nfs/file.c linux/fs/nfs/file.c
--- linux-2.5.3/fs/nfs/file.c	Thu Jan 31 01:08:54 2002
+++ linux/fs/nfs/file.c	Thu Jan 31 01:09:47 2002
@@ -41,7 +41,7 @@
 static int  nfs_fsync(struct file *, struct dentry *dentry, int datasync);
 
 struct file_operations nfs_file_operations = {
-	llseek:		generic_file_llseek,
+	llseek:		remote_llseek,
 	read:		nfs_file_read,
 	write:		nfs_file_write,
 	mmap:		nfs_file_mmap,
diff -urN linux-2.5.3/fs/read_write.c linux/fs/read_write.c
--- linux-2.5.3/fs/read_write.c	Thu Jan 31 01:08:54 2002
+++ linux/fs/read_write.c	Thu Jan 31 01:12:09 2002
@@ -51,6 +51,31 @@
 	return retval;
 }
 
+loff_t remote_llseek(struct file *file, loff_t offset, int origin)
+{
+	long long retval;
+
+	lock_kernel();
+	switch (origin) {
+		case 2:
+			offset += file->f_dentry->d_inode->i_size;
+			break;
+		case 1:
+			offset += file->f_pos;
+	}
+	retval = -EINVAL;
+	if (offset>=0 && offset<=file->f_dentry->d_inode->i_sb->s_maxbytes) {
+		if (offset != file->f_pos) {
+			file->f_pos = offset;
+			file->f_reada = 0;
+			file->f_version = ++event;
+		}
+		retval = offset;
+	}
+	unlock_kernel();
+	return retval;
+}
+
 loff_t no_llseek(struct file *file, loff_t offset, int origin)
 {
 	return -ESPIPE;
diff -urN linux-2.5.3/fs/smbfs/file.c linux/fs/smbfs/file.c
--- linux-2.5.3/fs/smbfs/file.c	Thu Jan 31 01:08:54 2002
+++ linux/fs/smbfs/file.c	Thu Jan 31 01:09:47 2002
@@ -381,7 +381,7 @@
 
 struct file_operations smb_file_operations =
 {
-	llseek:		generic_file_llseek,
+	llseek:		remote_llseek,
 	read:		smb_file_read,
 	write:		smb_file_write,
 	ioctl:		smb_ioctl,
diff -urN linux-2.5.3/include/linux/fs.h linux/include/linux/fs.h
--- linux-2.5.3/include/linux/fs.h	Thu Jan 31 01:08:54 2002
+++ linux/include/linux/fs.h	Thu Jan 31 01:10:37 2002
@@ -1449,6 +1449,7 @@
 extern void do_generic_file_read(struct file *, loff_t *, read_descriptor_t *, read_actor_t);
 extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
 extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
+extern loff_t remote_llseek(struct file *file, loff_t offset, int origin);
 extern ssize_t generic_read_dir(struct file *, char *, size_t, loff_t *);
 extern int generic_file_open(struct inode * inode, struct file * filp);
 
diff -urN linux-2.5.3/kernel/ksyms.c linux/kernel/ksyms.c
--- linux-2.5.3/kernel/ksyms.c	Thu Jan 31 01:08:54 2002
+++ linux/kernel/ksyms.c	Thu Jan 31 01:10:06 2002
@@ -251,6 +251,7 @@
 EXPORT_SYMBOL(vfs_statfs);
 EXPORT_SYMBOL(generic_read_dir);
 EXPORT_SYMBOL(generic_file_llseek);
+EXPORT_SYMBOL(remote_llseek);
 EXPORT_SYMBOL(no_llseek);
 EXPORT_SYMBOL(__pollwait);
 EXPORT_SYMBOL(poll_freewait);


      reply	other threads:[~2002-01-31 21:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-31  6:45 [PATCH] 2.5: further llseek cleanup (1/3) Robert Love
2002-01-31 15:19 ` Jan Harkes
2002-01-31 21:51   ` Robert Love
2002-01-31 21:51     ` Alexander Viro
2002-01-31 22:04       ` Robert Love [this message]

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=1012514664.3213.186.camel@phantasy \
    --to=rml@tech9.net \
    --cc=jaharkes@cs.cmu.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=viro@math.psu.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.