ia64/xen-unstable

view extras/mini-os/include/fs.h @ 19836:d9890e67d2b7

tools: add SHAREDIR to buildmakevars2file

c/s 19818 dropped SHAREDIR from xen/util/path.py, which broke the "xm
new" command. This patch adds SHAREDIR back to the new
buildmakevars2file-closure function.

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:05:10 2009 +0100 (2009-06-25)
parents 3ab0e76fb8e2
children
line source
1 #ifndef __FS_H__
2 #define __FS_H__
4 #include <xen/io/fsif.h>
5 #include <mini-os/semaphore.h>
6 #include <mini-os/types.h>
8 #define FSIF_RING_SIZE_ORDER 1
9 #define FSIF_RING_SIZE_PAGES (1<<FSIF_RING_SIZE_ORDER)
11 struct fs_import
12 {
13 domid_t dom_id; /* dom id of the exporting domain */
14 u16 export_id; /* export id (exporting dom specific) */
15 u16 import_id; /* import id (specific to this domain) */
16 struct minios_list_head list; /* list of all imports */
17 unsigned int nr_entries; /* Number of entries in rings & request
18 array */
19 struct fsif_front_ring ring; /* frontend ring (contains shared ring) */
20 u32 gnt_refs[FSIF_RING_SIZE_PAGES]; /* grant references to the shared ring */
21 evtchn_port_t local_port; /* local event channel port */
22 char *backend; /* XenBus location of the backend */
23 struct fs_request *requests; /* Table of requests */
24 unsigned short *freelist; /* List of free request ids */
25 struct semaphore reqs_sem; /* Accounts requests resource */
26 };
28 extern struct fs_import *fs_import;
30 void init_fs_frontend(void);
32 int fs_open(struct fs_import *import, char *file);
33 int fs_close(struct fs_import *import, int fd);
34 ssize_t fs_read(struct fs_import *import, int fd, void *buf,
35 ssize_t len, ssize_t offset);
36 ssize_t fs_write(struct fs_import *import, int fd, void *buf,
37 ssize_t len, ssize_t offset);
38 int fs_stat(struct fs_import *import,
39 int fd,
40 struct fsif_stat_response *stat);
41 int fs_truncate(struct fs_import *import,
42 int fd,
43 int64_t length);
44 int fs_remove(struct fs_import *import, char *file);
45 int fs_rename(struct fs_import *import,
46 char *old_file_name,
47 char *new_file_name);
48 int fs_create(struct fs_import *import, char *name,
49 int8_t directory, int32_t mode);
50 char** fs_list(struct fs_import *import, char *name,
51 int32_t offset, int32_t *nr_files, int *has_more);
52 int fs_chmod(struct fs_import *import, int fd, int32_t mode);
53 int64_t fs_space(struct fs_import *import, char *location);
54 int fs_sync(struct fs_import *import, int fd);
56 #endif