fs: add no_next_extent() dummy function
authorH. Peter Anvin <hpa@zytor.com>
Mon, 1 Mar 2010 05:55:59 +0000 (21:55 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 1 Mar 2010 05:55:59 +0000 (21:55 -0800)
Add a no_next_extent() dummy function for filesystems (like iso9660)
which should never end up calling next_extent (because there is only
one extent...)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/fs/iso9660/iso9660.c
core/fs/nonextextent.c [new file with mode: 0644]
core/include/fs.h

index aa1ca16..2362293 100644 (file)
@@ -359,5 +359,6 @@ const struct fs_ops iso_fs_ops = {
     .load_config   = iso_load_config,
     .iget_root     = iso_iget_root,
     .iget          = iso_iget,
-    .readdir       = iso_readdir
+    .readdir       = iso_readdir,
+    .next_extent   = no_next_extent,
 };
diff --git a/core/fs/nonextextent.c b/core/fs/nonextextent.c
new file mode 100644 (file)
index 0000000..0c1ce2c
--- /dev/null
@@ -0,0 +1,13 @@
+#include "fs.h"
+
+/*
+ * Use this routine for the next_extent() pointer when we never should
+ * be calling next_extent(), e.g. iso9660.
+ */
+int no_next_extent(struct inode *inode, uint32_t lstart)
+{
+    (void)inode;
+    (void)lstart;
+
+    return -1;
+}
index 4aca7fc..c210288 100644 (file)
@@ -227,4 +227,7 @@ void generic_close_file(struct file *file);
 uint32_t generic_getfssec(struct file *file, char *buf,
                          int sectors, bool *have_more);
 
+/* nonextextent.c */
+int no_next_extent(struct inode *, uint32_t);
+
 #endif /* FS_H */