User: Password:
|
|
Subscribe / Log in / New account

Add "nonseekable_open()" helper functions for nonseekable

From:  Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
To:  bk-commits-head@vger.kernel.org
Subject:  Add "nonseekable_open()" helper functions for nonseekable
Date:  Sun, 08 Aug 2004 01:54:18 +0000

ChangeSet 1.1940, 2004/08/07 18:54:18-07:00, torvalds@ppc970.osdl.org

	Add "nonseekable_open()" helper functions for nonseekable
	file descriptors.



 fs/open.c          |   12 ++++++++++++
 include/linux/fs.h |    1 +
 2 files changed, 13 insertions(+)


diff -Nru a/fs/open.c b/fs/open.c
--- a/fs/open.c	2004-08-07 20:05:39 -07:00
+++ b/fs/open.c	2004-08-07 20:05:39 -07:00
@@ -1070,3 +1070,15 @@
 }
 
 EXPORT_SYMBOL(generic_file_open);
+
+/*
+ * This is used by subsystems that don't want seekable
+ * file descriptors
+ */
+int nonseekable_open(struct inode *inode, struct file *filp)
+{
+	filp->f_mode &= ~(FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE);
+	return 0;
+}
+
+EXPORT_SYMBOL(nonseekable_open);
diff -Nru a/include/linux/fs.h b/include/linux/fs.h
--- a/include/linux/fs.h	2004-08-07 20:05:39 -07:00
+++ b/include/linux/fs.h	2004-08-07 20:05:39 -07:00
@@ -1435,6 +1435,7 @@
 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 int generic_file_open(struct inode * inode, struct file * filp);
+extern int nonseekable_open(struct inode * inode, struct file * filp);
 
 static inline void do_generic_file_read(struct file * filp, loff_t *ppos,
 					read_descriptor_t * desc,
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Copyright © 2004, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds