diff --git a/cogent/tests/pass_ticket-e31.cogent b/cogent/tests/pass_ticket-e31.cogent index f39d4e1d6..988482197 100644 --- a/cogent/tests/pass_ticket-e31.cogent +++ b/cogent/tests/pass_ticket-e31.cogent @@ -1,15 +1,5 @@ -type MountState +type OstoreState -type Buffer -type UbiVol -type OstoreState = { - next_inum : U32 -, rbuf : Buffer -, wbuf_eb : U32 -, ubi_vol : UbiVol -} - -type ObjId = U64 type Obj type R a b = @@ -17,23 +7,20 @@ type RR c a b = (c, R a b) type BufOffs = U32 deep_freeObj: Obj -> () -deserialise_Obj: (Buffer!, BufOffs) -> (Obj, BufOffs) -read_obj_pages_in_buf: (MountState!, UbiVol!, Buffer, ObjAddr!) -> Buffer +get_Obj : () -> Obj -type ObjAddr = #{ ebnum : U32, offs : U32, len : U32, sqnum : U64 } +type ObjAddr index_get_addr : () -> ObjAddr success : all (a, b). a -> R a b success a = Success a -ostore_read: (MountState!, OstoreState, ObjId) -> RR OstoreState Obj () -ostore_read (mount_st, ostore_st, oid) = +ostore_read: OstoreState -> RR OstoreState Obj () +ostore_read ostore_st = let addr = index_get_addr () and (ostore_st, r) = - let ostore_st {rbuf} = ostore_st - and rbuf = read_obj_pages_in_buf (mount_st, ostore_st.ubi_vol, rbuf, addr) !ostore_st - and (obj, sz) = deserialise_Obj (rbuf, 1) !rbuf - in (ostore_st {rbuf}, success obj) + let obj = get_Obj () + in (ostore_st, success obj) in r | Success obj -> let _ = deep_freeObj obj in (ostore_st, Error) | Error -> (ostore_st, Error)