Orangefs: change pvfs2 filenames to orangefs
[linux-2.6-block.git] / fs / orangefs / orangefs-bufmap.h
1 /*
2  * (C) 2001 Clemson University and The University of Chicago
3  *
4  * See COPYING in top-level directory.
5  */
6
7 #ifndef __ORANGEFS_BUFMAP_H
8 #define __ORANGEFS_BUFMAP_H
9
10 /* used to describe mapped buffers */
11 struct orangefs_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 orangefs_bufmap;
19
20 struct orangefs_bufmap *orangefs_bufmap_ref(void);
21 void orangefs_bufmap_unref(struct orangefs_bufmap *bufmap);
22
23 /*
24  * orangefs_bufmap_size_query is now an inline function because buffer
25  * sizes are not hardcoded
26  */
27 int orangefs_bufmap_size_query(void);
28
29 int orangefs_bufmap_shift_query(void);
30
31 int orangefs_bufmap_initialize(struct ORANGEFS_dev_map_desc *user_desc);
32
33 int get_bufmap_init(void);
34
35 void orangefs_bufmap_finalize(void);
36
37 int orangefs_bufmap_get(struct orangefs_bufmap **mapp, int *buffer_index);
38
39 void orangefs_bufmap_put(struct orangefs_bufmap *bufmap, int buffer_index);
40
41 int readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index);
42
43 void readdir_index_put(struct orangefs_bufmap *bufmap, int buffer_index);
44
45 int orangefs_bufmap_copy_from_iovec(struct orangefs_bufmap *bufmap,
46                                 struct iov_iter *iter,
47                                 int buffer_index,
48                                 size_t size);
49
50 int orangefs_bufmap_copy_to_iovec(struct orangefs_bufmap *bufmap,
51                               struct iov_iter *iter,
52                               int buffer_index,
53                               size_t size);
54
55 size_t orangefs_bufmap_copy_to_user_task_iovec(struct task_struct *tsk,
56                                            struct iovec *iovec,
57                                            unsigned long nr_segs,
58                                            struct orangefs_bufmap *bufmap,
59                                            int buffer_index,
60                                            size_t bytes_to_be_copied);
61
62 #endif /* __ORANGEFS_BUFMAP_H */