Windows: permit offline volume check to be disabled
[openafs.git] / src / WINNT / afsd / cm_dcache.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #ifndef OPENAFS_WINNT_AFSD_CM_DCACHE_H
11 #define OPENAFS_WINNT_AFSD_CM_DCACHE_H 1
12
13 /* bulk I/O descriptor */
14 typedef struct cm_bulkIO {
15     struct cm_scache *scp;              /* typically unheld vnode ptr */
16     struct cm_req *reqp;                /* the request ptr */
17     osi_hyper_t offset;                 /* offset of buffers */
18     long length;                        /* # of bytes to be transferred */
19     int reserved;                       /* did we reserve multiple buffers? */
20
21     /* all of these buffers are held */
22     osi_queueData_t *bufListp;  /* list of buffers involved in I/O */
23     osi_queueData_t *bufListEndp;       /* list of buffers involved in I/O */
24 } cm_bulkIO_t;
25
26 extern long cm_StoreMini(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp);
27
28 extern int cm_InitDCache(int newFile, long chunkSize, afs_uint64 nbuffers);
29
30 extern int cm_HaveBuffer(struct cm_scache *, struct cm_buf *, int haveBufLocked);
31
32 extern long cm_GetBuffer(struct cm_scache *, struct cm_buf *, int *,
33         struct cm_user *, struct cm_req *);
34
35 extern long cm_GetData(cm_scache_t *scp, osi_hyper_t *offsetp, char *datap, int data_length,
36                        cm_user_t *userp, cm_req_t *reqp);
37
38 extern afs_int32 cm_CheckFetchRange(cm_scache_t *scp, osi_hyper_t *startBasep,
39                                     osi_hyper_t *length, cm_user_t *up,
40                                     cm_req_t *reqp, osi_hyper_t *realBasep);
41
42 extern long cm_SetupFetchBIOD(cm_scache_t *scp, osi_hyper_t *offsetp,
43         cm_bulkIO_t *biop, cm_user_t *up, cm_req_t *reqp);
44
45 extern void cm_ReleaseBIOD(cm_bulkIO_t *biop, int isStore, long failed, int scp_locked);
46
47 extern long cm_SetupStoreBIOD(cm_scache_t *scp, osi_hyper_t *inOffsetp,
48         long inSize, cm_bulkIO_t *biop, cm_user_t *userp, cm_req_t *reqp);
49
50 extern afs_int32 cm_BkgPrefetch(cm_scache_t *scp, afs_uint32 p1, afs_uint32 p2, afs_uint32 p3, afs_uint32 p4,
51         struct cm_user *userp, cm_req_t *reqp);
52
53 extern afs_int32 cm_BkgStore(cm_scache_t *scp, afs_uint32 p1, afs_uint32 p2, afs_uint32 p3, afs_uint32 p4,
54         struct cm_user *userp, cm_req_t *reqp);
55
56 extern void cm_ConsiderPrefetch(cm_scache_t *scp, osi_hyper_t *offsetp,
57                                 afs_uint32 count,
58                                 cm_user_t *userp, cm_req_t *reqp);
59
60 extern long cm_ValidateDCache(void);
61
62 extern long cm_ShutdownDCache(void);
63
64 extern long cm_BufWrite(void *vscp, osi_hyper_t *offsetp, long length, long flags,
65                  cm_user_t *userp, cm_req_t *reqp);
66
67 #endif /*  OPENAFS_WINNT_AFSD_CM_DCACHE_H */