2 * Copyright 2000, International Business Machines Corporation and others.
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
10 #ifndef OPENAFS_WINNT_AFSD_CM_DCACHE_H
11 #define OPENAFS_WINNT_AFSD_CM_DCACHE_H 1
13 /* bulk I/O descriptor */
14 typedef struct cm_bulkIO {
15 struct cm_scache *scp; /* typically unheld vnode ptr */
16 struct cm_user *userp; /* the user of the request */
17 struct cm_req *reqp; /* the request ptr */
18 osi_hyper_t offset; /* offset of buffers */
19 long length; /* # of bytes to be transferred */
20 int reserved; /* did we reserve multiple buffers? */
22 /* all of these buffers are held */
23 osi_queueData_t *bufListp; /* list of buffers involved in I/O */
24 osi_queueData_t *bufListEndp; /* list of buffers involved in I/O */
27 extern long cm_StoreMini(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp);
29 extern int cm_InitDCache(int newFile, long chunkSize, afs_uint64 nbuffers);
31 extern int cm_HaveBuffer(struct cm_scache *, struct cm_buf *, int haveBufLocked);
33 extern long cm_GetBuffer(struct cm_scache *, struct cm_buf *, int *,
34 struct cm_user *, struct cm_req *);
36 extern long cm_GetData(cm_scache_t *scp, osi_hyper_t *offsetp, char *datap, int data_length,
37 cm_user_t *userp, cm_req_t *reqp);
39 extern afs_int32 cm_CheckFetchRange(cm_scache_t *scp, osi_hyper_t *startBasep,
40 osi_hyper_t *length, cm_user_t *up,
41 cm_req_t *reqp, osi_hyper_t *realBasep);
43 extern long cm_SetupFetchBIOD(cm_scache_t *scp, osi_hyper_t *offsetp,
44 cm_bulkIO_t *biop, cm_user_t *up, cm_req_t *reqp);
46 extern void cm_ReleaseBIOD(cm_bulkIO_t *biop, int isStore, long failed, int scp_locked);
48 extern long cm_SetupStoreBIOD(cm_scache_t *scp, osi_hyper_t *inOffsetp,
49 long inSize, cm_bulkIO_t *biop, cm_user_t *userp, cm_req_t *reqp);
51 extern afs_int32 cm_BkgPrefetch(cm_scache_t *scp, afs_uint32 p1, afs_uint32 p2, afs_uint32 p3, afs_uint32 p4,
52 struct cm_user *userp, cm_req_t *reqp);
54 extern afs_int32 cm_BkgStore(cm_scache_t *scp, afs_uint32 p1, afs_uint32 p2, afs_uint32 p3, afs_uint32 p4,
55 struct cm_user *userp, cm_req_t *reqp);
57 extern void cm_ConsiderPrefetch(cm_scache_t *scp, osi_hyper_t *offsetp,
59 cm_user_t *userp, cm_req_t *reqp);
61 extern long cm_ValidateDCache(void);
63 extern long cm_ShutdownDCache(void);
65 extern long cm_BufWrite(void *vscp, osi_hyper_t *offsetp, long length, long flags,
66 cm_user_t *userp, cm_req_t *reqp);
68 #endif /* OPENAFS_WINNT_AFSD_CM_DCACHE_H */