Remove CacheStoreProcs and CacheFetchProcs from the afs_cacheOps.
[openafs.git] / src / afs / afs_chunkops.h
index 9b1608f..cb5bc55 100644 (file)
  */
 
 struct afs_cacheOps {
-#if defined(AFS_SUN57_64BIT_ENV) || defined(AFS_SGI62_ENV)
-    void *(*open) (ino_t ainode);
-#else
-#if defined(LINUX_USE_FH)
-    void *(*open) (struct fid *fh, int fh_type);
-#else
-    void *(*open) (afs_int32 ainode);
-#endif
-#endif
+    void *(*open) (afs_dcache_id_t *ainode);
     int (*truncate) (struct osi_file * fp, afs_int32 len);
     int (*fread) (struct osi_file * fp, int offset, void *buf, afs_int32 len);
     int (*fwrite) (struct osi_file * fp, afs_int32 offset, void *buf,
@@ -71,16 +63,6 @@ struct afs_cacheOps {
                  int noLock);
     int (*vwrite) (register struct vcache * avc, struct uio * auio, int aio,
                   struct AFS_UCRED * acred, int noLock);
-    int (*FetchProc) (register struct rx_call * acall,
-                     struct osi_file * afile, afs_size_t abase,
-                     struct dcache * adc, struct vcache * avc,
-                     afs_size_t * abytesToXferP, afs_size_t * abytesXferredP,
-                     afs_int32 lengthFound);
-    int (*StoreProc) (register struct rx_call * acall,
-                     struct osi_file * afile, register afs_int32 alen,
-                     struct vcache * avc, int *shouldWake,
-                     afs_size_t * abytesToXferP,
-                     afs_size_t * abytesXferredP);
     struct dcache *(*GetDSlot) (register afs_int32 aslot,
                                register struct dcache * tmpdc);
     struct volume *(*GetVolSlot) (void);
@@ -88,11 +70,7 @@ struct afs_cacheOps {
 };
 
 /* Ideally we should have used consistent naming - like COP_OPEN, COP_TRUNCATE, etc. */
-#if defined(LINUX_USE_FH)
-#define        afs_CFileOpen(fh, fh_type)            (void *)(*(afs_cacheType->open))(fh, fh_type)
-#else
 #define        afs_CFileOpen(inode)          (void *)(*(afs_cacheType->open))(inode)
-#endif
 #define        afs_CFileTruncate(handle, size) (*(afs_cacheType->truncate))((handle), size)
 #define        afs_CFileRead(file, offset, data, size) (*(afs_cacheType->fread))(file, offset, data, size)
 #define        afs_CFileWrite(file, offset, data, size) (*(afs_cacheType->fwrite))(file, offset, data, size)
@@ -101,9 +79,21 @@ struct afs_cacheOps {
 #define        afs_GetVolSlot()                (*(afs_cacheType->GetVolSlot))()
 #define        afs_HandleLink(avc, areq)       (*(afs_cacheType->HandleLink))(avc, areq)
 
-#define        afs_CacheFetchProc(call, file, base, adc, avc, toxfer, xfered, length) \
-          (*(afs_cacheType->FetchProc))(call, file, (afs_size_t)base, adc, avc, (afs_size_t *)toxfer, (afs_size_t *)xfered, length)
-#define        afs_CacheStoreProc(call, file, bytes, avc, wake, toxfer, xfered) \
-          (*(afs_cacheType->StoreProc))(call, file, bytes, avc, wake, toxfer, xfered)
+/* These memcpys should get optimised to simple assignments when afs_dcache_id_t 
+ * is simple */
+static_inline void afs_copy_inode(afs_dcache_id_t *dst, afs_dcache_id_t *src) {
+    memcpy(dst, src, sizeof(afs_dcache_id_t));
+}
+
+static_inline void afs_reset_inode(afs_dcache_id_t *i) {
+    memset(i, 0, sizeof(afs_dcache_id_t));
+}
+
+/* We need to have something we can output as the 'inode' for fstrace calls. 
+ * This is a hack */
+static_inline int afs_inode2trace(afs_dcache_id_t *i) {
+    return i->mem;
+}
+
 
 #endif /* AFS_CHUNKOPS */