e6cc5dbc382fb4393464210570679b98dc7a5ae8
[openafs.git] / src / WINNT / afsd / cm_direct.h
1 /*
2  * Copyright (c) 2012 Your File System, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * - Redistributions of source code must retain the above copyright notice,
10  *   this list of conditions and the following disclaimer.
11  * - Redistributions in binary form must reproduce the above copyright
12  *   notice, this list of conditions and the following disclaimer in the
13  *   documentation and/or other materials provided with the distribution.
14  * - Neither the name of Your File System, Inc nor the names of its
15  *   contributors may be used to endorse or promote products derived
16  *   from this software without specific prior written permission from
17  *   Your File System, Inc.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
23  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31
32 #ifndef OPENAFS_WINNT_AFSD_CM_DIRECT_H
33 #define OPENAFS_WINNT_AFSD_CM_DIRECT_H 1
34
35 extern afs_int32
36 cm_SetupDirectStoreBIOD( cm_scache_t *scp,
37                          osi_hyper_t *offsetp,
38                          afs_uint32   length,
39                          cm_bulkIO_t *biodp,
40                          cm_user_t   *userp,
41                          cm_req_t    *reqp);
42
43 extern afs_int32
44 cm_DirectWrite( IN cm_scache_t *scp,
45                 IN osi_hyper_t *offsetp,
46                 IN afs_uint32   length,
47                 IN afs_uint32   flags,
48                 IN cm_user_t   *userp,
49                 IN cm_req_t    *reqp,
50                 IN void        *memoryRegionp,
51                 OUT afs_uint32 *bytesWritten);
52
53 #define CM_DIRECT_SCP_LOCKED            0x1
54
55 typedef struct rock_BkgDirectWrite {
56     osi_hyper_t offset;
57     afs_uint32  length;
58     afs_uint32  bypass_cache;
59     void *      memoryRegion;
60     cm_bulkIO_t biod;           /* bulk IO descriptor */
61 } rock_BkgDirectWrite_t;
62
63 extern afs_int32
64 cm_BkgDirectWrite( cm_scache_t *scp, void *rockp, struct cm_user *userp, cm_req_t *reqp);
65
66 extern void
67 cm_BkgDirectWriteDone( cm_scache_t *scp, void *vrockp, afs_int32 code);
68 #endif