Lines Matching refs:sb

40 	PE_SecBuf *sb;  in libpe_alloc_buffer()  local
42 if ((sb = malloc(sizeof(PE_SecBuf))) == NULL) { in libpe_alloc_buffer()
47 sb->sb_ps = ps; in libpe_alloc_buffer()
48 sb->sb_flags = 0; in libpe_alloc_buffer()
49 sb->sb_pb.pb_align = 1; in libpe_alloc_buffer()
50 sb->sb_pb.pb_off = 0; in libpe_alloc_buffer()
51 sb->sb_pb.pb_size = sz; in libpe_alloc_buffer()
53 if ((sb->sb_pb.pb_buf = malloc(sz)) == NULL) { in libpe_alloc_buffer()
54 free(sb); in libpe_alloc_buffer()
58 sb->sb_flags |= LIBPE_F_BUFFER_MALLOCED; in libpe_alloc_buffer()
60 sb->sb_pb.pb_buf = NULL; in libpe_alloc_buffer()
62 STAILQ_INSERT_TAIL(&ps->ps_b, sb, sb_next); in libpe_alloc_buffer()
64 return (sb); in libpe_alloc_buffer()
68 libpe_release_buffer(PE_SecBuf *sb) in libpe_release_buffer() argument
72 assert(sb != NULL); in libpe_release_buffer()
74 ps = sb->sb_ps; in libpe_release_buffer()
76 STAILQ_REMOVE(&ps->ps_b, sb, _PE_SecBuf, sb_next); in libpe_release_buffer()
78 if (sb->sb_flags & LIBPE_F_BUFFER_MALLOCED) in libpe_release_buffer()
79 free(sb->sb_pb.pb_buf); in libpe_release_buffer()
81 free(sb); in libpe_release_buffer()
109 PE_SecBuf *sb; in libpe_resync_buffers() local
118 STAILQ_FOREACH(sb, &ps->ps_b, sb_next) { in libpe_resync_buffers()
120 sb->sb_flags |= PE_F_DIRTY; in libpe_resync_buffers()
122 pb = (PE_Buffer *) sb; in libpe_resync_buffers()
132 sb->sb_flags |= PE_F_DIRTY; in libpe_resync_buffers()
144 PE_SecBuf *sb; in libpe_write_buffers() local
153 STAILQ_FOREACH(sb, &ps->ps_b, sb_next) { in libpe_write_buffers()
154 pb = &sb->sb_pb; in libpe_write_buffers()
158 if ((sb->sb_flags & PE_F_DIRTY) == 0) { in libpe_write_buffers()