Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 1 | /* |
| 2 | * (C) 2001 Clemson University and The University of Chicago |
| 3 | * |
| 4 | * See COPYING in top-level directory. |
| 5 | */ |
| 6 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 7 | #ifndef __ORANGEFS_BUFMAP_H |
| 8 | #define __ORANGEFS_BUFMAP_H |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 9 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 10 | struct orangefs_bufmap; |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 11 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 12 | int orangefs_bufmap_size_query(void); |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 13 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 14 | int orangefs_bufmap_shift_query(void); |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 15 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 16 | int orangefs_bufmap_initialize(struct ORANGEFS_dev_map_desc *user_desc); |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 17 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 18 | void orangefs_bufmap_finalize(void); |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 19 | |
Al Viro | ea2c9c9 | 2016-02-13 21:01:21 -0500 | [diff] [blame] | 20 | void orangefs_bufmap_run_down(void); |
| 21 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 22 | int orangefs_bufmap_get(struct orangefs_bufmap **mapp, int *buffer_index); |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 23 | |
Al Viro | 1357d06 | 2016-02-11 21:34:52 -0500 | [diff] [blame] | 24 | void orangefs_bufmap_put(int buffer_index); |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 25 | |
Martin Brandenburg | 7d22148 | 2016-01-04 15:05:28 -0500 | [diff] [blame] | 26 | int orangefs_readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index); |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 27 | |
Al Viro | 82d37f1 | 2016-02-13 21:04:51 -0500 | [diff] [blame^] | 28 | void orangefs_readdir_index_put(int buffer_index); |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 29 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 30 | int orangefs_bufmap_copy_from_iovec(struct orangefs_bufmap *bufmap, |
Mike Marshall | 4d1c440 | 2015-09-04 10:31:16 -0400 | [diff] [blame] | 31 | struct iov_iter *iter, |
| 32 | int buffer_index, |
| 33 | size_t size); |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 34 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 35 | int orangefs_bufmap_copy_to_iovec(struct orangefs_bufmap *bufmap, |
Mike Marshall | 4d1c440 | 2015-09-04 10:31:16 -0400 | [diff] [blame] | 36 | struct iov_iter *iter, |
Al Viro | 5c27822 | 2015-10-08 17:43:58 -0400 | [diff] [blame] | 37 | int buffer_index, |
| 38 | size_t size); |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 39 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 40 | size_t orangefs_bufmap_copy_to_user_task_iovec(struct task_struct *tsk, |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 41 | struct iovec *iovec, |
| 42 | unsigned long nr_segs, |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 43 | struct orangefs_bufmap *bufmap, |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 44 | int buffer_index, |
| 45 | size_t bytes_to_be_copied); |
| 46 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 47 | #endif /* __ORANGEFS_BUFMAP_H */ |