uml-2.6.7-1um
[linux-2.6.git] / arch / um / include / filehandle.h
1 /* 
2  * Copyright (C) 2004 Jeff Dike (jdike@addtoit.com)
3  * Licensed under the GPL
4  */
5
6 #ifndef __FILEHANDLE_H__
7 #define __FILEHANDLE_H__
8
9 #include "linux/list.h"
10 #include "linux/fs.h"
11 #include "os.h"
12
13 struct file_handle {
14         struct list_head list;
15         int fd;
16         char *(*get_name)(struct inode *);
17         struct inode *inode;
18         struct openflags flags;
19 };
20
21 extern struct file_handle bad_filehandle;
22
23 extern int open_file(char *name, struct openflags flags, int mode);
24 extern void *open_dir(char *file);
25 extern int open_filehandle(char *name, struct openflags flags, int mode, 
26                            struct file_handle *fh);
27 extern int read_file(struct file_handle *fh, unsigned long long offset, 
28                      char *buf, int len);
29 extern int write_file(struct file_handle *fh, unsigned long long offset, 
30                       const char *buf, int len);
31 extern int truncate_file(struct file_handle *fh, unsigned long long size);
32 extern int close_file(struct file_handle *fh);
33 extern void not_reclaimable(struct file_handle *fh);
34 extern void is_reclaimable(struct file_handle *fh, 
35                            char *(name_proc)(struct inode *),
36                            struct inode *inode);
37 extern int filehandle_fd(struct file_handle *fh);
38 extern int make_pipe(struct file_handle *fhs);
39
40 #endif
41
42 /*
43  * Overrides for Emacs so that we follow Linus's tabbing style.
44  * Emacs will notice this stuff at the end of the file and automatically
45  * adjust the settings for this buffer only.  This must remain at the end
46  * of the file.
47  * ---------------------------------------------------------------------------
48  * Local variables:
49  * c-file-style: "linux"
50  * End:
51  */