blob: 0be62be373f70da096fd47da002ed6475a23d550 [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
Yi Liu8bb8aef2015-11-24 15:12:14 -050022int orangefs_bufmap_get(struct orangefs_bufmap **mapp, int *buffer_index);
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
Martin Brandenburg7d221482016-01-04 15:05:28 -050026int orangefs_readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index);
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
Yi Liu8bb8aef2015-11-24 15:12:14 -050030int orangefs_bufmap_copy_from_iovec(struct orangefs_bufmap *bufmap,
Mike Marshall4d1c4402015-09-04 10:31:16 -040031 struct iov_iter *iter,
32 int buffer_index,
33 size_t size);
Mike Marshallf7ab0932015-07-17 10:38:11 -040034
Yi Liu8bb8aef2015-11-24 15:12:14 -050035int orangefs_bufmap_copy_to_iovec(struct orangefs_bufmap *bufmap,
Mike Marshall4d1c4402015-09-04 10:31:16 -040036 struct iov_iter *iter,
Al Viro5c278222015-10-08 17:43:58 -040037 int buffer_index,
38 size_t size);
Mike Marshallf7ab0932015-07-17 10:38:11 -040039
Yi Liu8bb8aef2015-11-24 15:12:14 -050040size_t orangefs_bufmap_copy_to_user_task_iovec(struct task_struct *tsk,
Mike Marshallf7ab0932015-07-17 10:38:11 -040041 struct iovec *iovec,
42 unsigned long nr_segs,
Yi Liu8bb8aef2015-11-24 15:12:14 -050043 struct orangefs_bufmap *bufmap,
Mike Marshallf7ab0932015-07-17 10:38:11 -040044 int buffer_index,
45 size_t bytes_to_be_copied);
46
Yi Liu8bb8aef2015-11-24 15:12:14 -050047#endif /* __ORANGEFS_BUFMAP_H */