[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1258735245-25826-2-git-send-email-jblunck@suse.de>
Date: Fri, 20 Nov 2009 17:40:31 +0100
From: Jan Blunck <jblunck@...e.de>
To: linux-fsdevel@...r.kernel.org,
Christoph Hellwig <hch@...radead.org>,
Alan Cox <alan@...rguk.ukuu.org.uk>
Cc: Linux-Kernel Mailinglist <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>, jkacur@...hat.com,
Arnd Bergmann <arnd@...db.de>,
Frédéric Weisbecker <fweisbec@...il.com>,
Jamie Lokier <jamie@...reable.org>,
Jan Blunck <jblunck@...e.de>,
Alexander Viro <viro@...iv.linux.org.uk>,
Matthew Wilcox <matthew@....cx>
Subject: [PATCH 01/15] Introduce noop_llseek()
The noop_llseek() is a llseek() operation that filesystems can use that
don't want to support seeking (leave the file->f_pos untouched) but still
want to let the syscall itself to succeed.
Signed-off-by: Jan Blunck <jblunck@...e.de>
---
fs/read_write.c | 6 ++++++
include/linux/fs.h | 1 +
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/fs/read_write.c b/fs/read_write.c
index 3ac2898..7a01d11 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -97,6 +97,12 @@ loff_t generic_file_llseek(struct file *file, loff_t offset, int origin)
}
EXPORT_SYMBOL(generic_file_llseek);
+loff_t noop_llseek(struct file *file, loff_t offset, int origin)
+{
+ return file->f_pos;
+}
+EXPORT_SYMBOL(noop_llseek);
+
loff_t no_llseek(struct file *file, loff_t offset, int origin)
{
return -ESPIPE;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 2620a8c..0a0c1f4 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2237,6 +2237,7 @@ extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
extern void
file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
+extern loff_t noop_llseek(struct file *file, loff_t offset, int origin);
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 generic_file_llseek_unlocked(struct file *file, loff_t offset,
--
1.6.4.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists