From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Blunck Subject: [PATCH 01/15] Introduce noop_llseek() Date: Fri, 20 Nov 2009 17:40:31 +0100 Message-ID: <1258735245-25826-2-git-send-email-jblunck@suse.de> References: <1258735245-25826-1-git-send-email-jblunck@suse.de> Cc: Linux-Kernel Mailinglist , Andrew Morton , Thomas Gleixner , jkacur@redhat.com, Arnd Bergmann , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Weisbecker?= , Jamie Lokier , Jan Blunck , Alexander Viro , Matthew Wilcox To: linux-fsdevel@vger.kernel.org, Christoph Hellwig , Alan Cox Return-path: In-Reply-To: <1258735245-25826-1-git-send-email-jblunck@suse.de> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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 --- 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