blob: ec2849cb52e2cbfca784a4b6f10f7b6fb72d4c56 [file] [log] [blame]
Mike Marshallf7ab0932015-07-17 10:38:11 -04001/*
2 * (C) 2001 Clemson University and The University of Chicago
3 *
4 * See COPYING in top-level directory.
5 */
6
Yi Liu8bb8aef2015-11-24 15:12:14 -05007#ifndef __ORANGEFS_BUFMAP_H
8#define __ORANGEFS_BUFMAP_H
Mike Marshallf7ab0932015-07-17 10:38:11 -04009
Yi Liu8bb8aef2015-11-24 15:12:14 -050010struct orangefs_bufmap;
Mike Marshallf7ab0932015-07-17 10:38:11 -040011
Yi Liu8bb8aef2015-11-24 15:12:14 -050012int orangefs_bufmap_size_query(void);
Mike Marshallf7ab0932015-07-17 10:38:11 -040013
Yi Liu8bb8aef2015-11-24 15:12:14 -050014int orangefs_bufmap_shift_query(void);
Mike Marshallf7ab0932015-07-17 10:38:11 -040015
Yi Liu8bb8aef2015-11-24 15:12:14 -050016int orangefs_bufmap_initialize(struct ORANGEFS_dev_map_desc *user_desc);
Mike Marshallf7ab0932015-07-17 10:38:11 -040017
Yi Liu8bb8aef2015-11-24 15:12:14 -050018void orangefs_bufmap_finalize(void);
Mike Marshallf7ab0932015-07-17 10:38:11 -040019
Al Viroea2c9c92016-02-13 21:01:21 -050020void orangefs_bufmap_run_down(void);
21
Al Virob8a99a82016-02-16 20:10:26 -050022int orangefs_bufmap_get(void);
Mike Marshallf7ab0932015-07-17 10:38:11 -040023
Al Viro1357d062016-02-11 21:34:52 -050024void orangefs_bufmap_put(int buffer_index);
Mike Marshallf7ab0932015-07-17 10:38:11 -040025
Al Virob8a99a82016-02-16 20:10:26 -050026int orangefs_readdir_index_get(void);
Mike Marshallf7ab0932015-07-17 10:38:11 -040027
Al Viro82d37f12016-02-13 21:04:51 -050028void orangefs_readdir_index_put(int buffer_index);
Mike Marshallf7ab0932015-07-17 10:38:11 -040029
Al Virobf6bf602016-02-16 20:06:19 -050030int orangefs_bufmap_copy_from_iovec(struct iov_iter *iter,
Mike Marshall4d1c4402015-09-04 10:31:16 -040031 int buffer_index,
32 size_t size);
Mike Marshallf7ab0932015-07-17 10:38:11 -040033
Al Virobf6bf602016-02-16 20:06:19 -050034int orangefs_bufmap_copy_to_iovec(struct iov_iter *iter,
Al Viro5c278222015-10-08 17:43:58 -040035 int buffer_index,
36 size_t size);
Mike Marshallf7ab0932015-07-17 10:38:11 -040037
Yi Liu8bb8aef2015-11-24 15:12:14 -050038size_t orangefs_bufmap_copy_to_user_task_iovec(struct task_struct *tsk,
Mike Marshallf7ab0932015-07-17 10:38:11 -040039 struct iovec *iovec,
40 unsigned long nr_segs,
Yi Liu8bb8aef2015-11-24 15:12:14 -050041 struct orangefs_bufmap *bufmap,
Mike Marshallf7ab0932015-07-17 10:38:11 -040042 int buffer_index,
43 size_t bytes_to_be_copied);
44
Yi Liu8bb8aef2015-11-24 15:12:14 -050045#endif /* __ORANGEFS_BUFMAP_H */