Commit | Line | Data |
---|---|---|
f7ab093f MM |
1 | /* |
2 | * (C) 2001 Clemson University and The University of Chicago | |
3 | * | |
4 | * See COPYING in top-level directory. | |
5 | */ | |
6 | ||
7 | #ifndef __PVFS2_BUFMAP_H | |
8 | #define __PVFS2_BUFMAP_H | |
9 | ||
10 | /* used to describe mapped buffers */ | |
11 | struct pvfs_bufmap_desc { | |
12 | void *uaddr; /* user space address pointer */ | |
13 | struct page **page_array; /* array of mapped pages */ | |
14 | int array_count; /* size of above arrays */ | |
15 | struct list_head list_link; | |
16 | }; | |
17 | ||
18 | struct pvfs2_bufmap; | |
19 | ||
20 | struct pvfs2_bufmap *pvfs2_bufmap_ref(void); | |
21 | void pvfs2_bufmap_unref(struct pvfs2_bufmap *bufmap); | |
22 | ||
23 | /* | |
24 | * pvfs_bufmap_size_query is now an inline function because buffer | |
25 | * sizes are not hardcoded | |
26 | */ | |
27 | int pvfs_bufmap_size_query(void); | |
28 | ||
29 | int pvfs_bufmap_shift_query(void); | |
30 | ||
31 | int pvfs_bufmap_initialize(struct PVFS_dev_map_desc *user_desc); | |
32 | ||
33 | int get_bufmap_init(void); | |
34 | ||
35 | void pvfs_bufmap_finalize(void); | |
36 | ||
37 | int pvfs_bufmap_get(struct pvfs2_bufmap **mapp, int *buffer_index); | |
38 | ||
39 | void pvfs_bufmap_put(struct pvfs2_bufmap *bufmap, int buffer_index); | |
40 | ||
41 | int readdir_index_get(struct pvfs2_bufmap **mapp, int *buffer_index); | |
42 | ||
43 | void readdir_index_put(struct pvfs2_bufmap *bufmap, int buffer_index); | |
44 | ||
4d1c4404 MM |
45 | int pvfs_bufmap_copy_from_iovec(struct pvfs2_bufmap *bufmap, |
46 | struct iov_iter *iter, | |
47 | int buffer_index, | |
48 | size_t size); | |
49 | ||
50 | int pvfs_bufmap_copy_to_iovec(struct pvfs2_bufmap *bufmap, | |
51 | struct iov_iter *iter, | |
52 | int buffer_index); | |
f7ab093f MM |
53 | |
54 | size_t pvfs_bufmap_copy_to_user_task_iovec(struct task_struct *tsk, | |
55 | struct iovec *iovec, | |
56 | unsigned long nr_segs, | |
57 | struct pvfs2_bufmap *bufmap, | |
58 | int buffer_index, | |
59 | size_t bytes_to_be_copied); | |
60 | ||
61 | #endif /* __PVFS2_BUFMAP_H */ |