aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys/file.h
diff options
context:
space:
mode:
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-03-18 04:56:43 +0000
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-03-18 04:56:43 +0000
commit5d86345d3753fd6d873ba40480e1121eb7c28e21 (patch)
tree620b75865d244e22240e1c0f7159a05b3558b6e5 /include/sys/file.h
parent1ec74a114cc4ec5055e7bc45cffda483505d8aba (diff)
Initial pass at a file API getf/releasef hooks
git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@50 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
Diffstat (limited to 'include/sys/file.h')
-rw-r--r--include/sys/file.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/sys/file.h b/include/sys/file.h
index 63d662237..8b135c4b1 100644
--- a/include/sys/file.h
+++ b/include/sys/file.h
@@ -1,4 +1,34 @@
#ifndef _SPL_FILE_H
#define _SPL_FILE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <linux/module.h>
+#include <linux/file.h>
+#include <sys/kmem.h>
+#include <sys/mutex.h>
+#include <sys/vnode.h>
+
+typedef struct spl_file {
+ int f_fd; /* linux fd for lookup */
+ struct file *f_file; /* linux file struct */
+ atomic_t f_ref; /* ref count */
+ kmutex_t f_lock; /* struct lock */
+ loff_t f_offset; /* offset */
+ vnode_t *f_vnode; /* vnode */
+ struct list_head f_list; /* list of referenced file_t's */
+} file_t;
+
+extern file_t *getf(int fd);
+extern void releasef(int fd);
+
+int file_init(void);
+void file_fini(void);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* SPL_FILE_H */