OpenAFS
OpenAFS distributed network file system
/cygdrive/c/src/openafs/openafs.git/repo/src/WINNT/afsd/cm_dcache.h
00001 /*
00002  * Copyright 2000, International Business Machines Corporation and others.
00003  * All Rights Reserved.
00004  *
00005  * This software has been released under the terms of the IBM Public
00006  * License.  For details, see the LICENSE file in the top-level source
00007  * directory or online at http://www.openafs.org/dl/license10.html
00008  */
00009 
00010 #ifndef OPENAFS_WINNT_AFSD_CM_DCACHE_H
00011 #define OPENAFS_WINNT_AFSD_CM_DCACHE_H 1
00012 
00013 /* bulk I/O descriptor */
00014 typedef struct cm_bulkIO {
00015     struct cm_scache *scp;              /* typically unheld vnode ptr */
00016     struct cm_user *userp;              /* the user of the request */
00017     struct cm_req *reqp;                /* the request ptr */
00018     osi_hyper_t offset;                 /* offset of buffers */
00019     long length;                        /* # of bytes to be transferred */
00020     int reserved;                       /* did we reserve multiple buffers? */
00021 
00022     /* all of these buffers are held */
00023     osi_queueData_t *bufListp;  /* list of buffers involved in I/O */
00024     osi_queueData_t *bufListEndp;       /* list of buffers involved in I/O */
00025 } cm_bulkIO_t;
00026 
00027 extern long cm_StoreMini(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp);
00028 
00029 extern int cm_InitDCache(int newFile, long chunkSize, afs_uint64 nbuffers);
00030 
00031 extern int cm_HaveBuffer(struct cm_scache *, struct cm_buf *, int haveBufLocked);
00032 
00033 extern long cm_GetBuffer(struct cm_scache *, struct cm_buf *, int *,
00034         struct cm_user *, struct cm_req *);
00035 
00036 extern long cm_GetData(cm_scache_t *scp, osi_hyper_t *offsetp, char *datap, int data_length,
00037                        cm_user_t *userp, cm_req_t *reqp);
00038 
00039 extern afs_int32 cm_CheckFetchRange(cm_scache_t *scp, osi_hyper_t *startBasep,
00040                                     osi_hyper_t *length, cm_user_t *up,
00041                                     cm_req_t *reqp, osi_hyper_t *realBasep);
00042 
00043 extern long cm_SetupFetchBIOD(cm_scache_t *scp, osi_hyper_t *offsetp,
00044         cm_bulkIO_t *biop, cm_user_t *up, cm_req_t *reqp);
00045 
00046 extern void cm_ReleaseBIOD(cm_bulkIO_t *biop, int isStore, long failed, int scp_locked);
00047 
00048 extern long cm_SetupStoreBIOD(cm_scache_t *scp, osi_hyper_t *inOffsetp,
00049         long inSize, cm_bulkIO_t *biop, cm_user_t *userp, cm_req_t *reqp);
00050 
00051 extern afs_int32 cm_BkgPrefetch(cm_scache_t *scp, afs_uint32 p1, afs_uint32 p2, afs_uint32 p3, afs_uint32 p4,
00052         struct cm_user *userp, cm_req_t *reqp);
00053 
00054 extern afs_int32 cm_BkgStore(cm_scache_t *scp, afs_uint32 p1, afs_uint32 p2, afs_uint32 p3, afs_uint32 p4,
00055         struct cm_user *userp, cm_req_t *reqp);
00056 
00057 extern void cm_ConsiderPrefetch(cm_scache_t *scp, osi_hyper_t *offsetp,
00058                                 afs_uint32 count,
00059                                 cm_user_t *userp, cm_req_t *reqp);
00060 
00061 extern long cm_ValidateDCache(void);
00062 
00063 extern long cm_ShutdownDCache(void);
00064 
00065 extern long cm_BufWrite(void *vscp, osi_hyper_t *offsetp, long length, long flags,
00066                  cm_user_t *userp, cm_req_t *reqp);
00067 
00068 extern long cm_VerifyStoreData(cm_bulkIO_t *biod, cm_scache_t *scp);
00069 
00070 #endif /*  OPENAFS_WINNT_AFSD_CM_DCACHE_H */
 All Data Structures Files Functions Variables