Lines Matching refs:rid
42 int rid; member
57 int rid; in rid_alloc() local
59 for (rid = 0; rid < nrids; rid++) { in rid_alloc()
60 if (ridtbl[rid].fd == -1) in rid_alloc()
63 if (rid == nrids) { in rid_alloc()
72 ridtbl[rid].fd = INT_MAX; in rid_alloc()
73 return (rid); in rid_alloc()
77 rid_lookup(int rid) in rid_lookup() argument
81 if (rid < 0 || rid >= nrids) { in rid_lookup()
85 r = ridtbl + rid; in rid_lookup()
99 int len, rid; in bs_map() local
106 rid = rid_alloc(); in bs_map()
107 if (rid == -1) in bs_map()
109 r = rid_lookup(rid); in bs_map()
115 r->rid = -1; in bs_map()
126 return (rid); in bs_map()
130 bs_read(int rid, off_t ofs, void *buf, ssize_t bufsz) in bs_read() argument
137 r = rid_lookup(rid); in bs_read()
178 int fd0, rid; in bs_subregion() local
195 rid = rid_alloc(); in bs_subregion()
196 if (rid == -1) in bs_subregion()
198 r = rid_lookup(rid); in bs_subregion()
201 r->rid = rid0; in bs_subregion()
207 return (rid); in bs_subregion()
211 bs_unmap(int rid) in bs_unmap() argument
215 r = rid_lookup(rid); in bs_unmap()
218 if (r->rid == -1) { in bs_unmap()
228 bs_write(int rid, off_t ofs, void *buf, ssize_t bufsz) in bs_write() argument
235 r = rid_lookup(rid); in bs_write()