• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..17-May-2021-

LICENSEH A D17-May-2021162 32

MakefileH A D17-May-2021351 2817

READMEH A D17-May-20211.6 KiB3527

README.BSDH A D17-May-20211.1 KiB2720

queue.hH A D17-May-202117.6 KiB528339

tree.hH A D03-May-202224 KiB724622

ublio.cH A D17-May-202123 KiB955653

ublio.hH A D17-May-20213.7 KiB9929

ublio_conf.hH A D03-May-20222.2 KiB538

README

1libublio is a small library with the aim of providing a buffered I/O
2layer in userspace. It's primary motivation is to make it easy to fulfil
3the I/O alignment constraints of disk devices on FreeBSD (and derivative
4OS-es). (These exist since FreeBSD chose to ditch block devices and
5make all disks and alike character devices). However, libublio is
6generic code and might prove to be useful in other cases as well.
7
8libublio provides a random positioned I/O API which is translated into
9blocksize aligned I/O (where blocksize is defined by the user).
10libublio also caches data; the caching algorithm uses red/black trees
11and puts emphasis on making all cache operations logarithmic (in terms
12of the number of cache entries).
13
14Note that libublio is _not_ thread safe.
15
16Usage:
17
18- Take a look at the ublio_conf.h to see if you want to make any compile
19  time cusomization (you can tune there some diagnostic features and
20  some platform specific settings which could be much better determined by
21  autotools if I have taken the effort to use autotools).
22
23- Compile either a static libublio.a with the help of the provided
24  Makefile or throw directly ublio.c among your source files (in the
25  latter case make sure that it can include the ublio.h and ublio_conf.h
26  header files).
27
28- See ublio.h for the API and runtime tunables. Include ublio.h to your
29  program, compile, enjoy.
30
31Feedback, bugreports is to be sent to csaba.henk creo.hu .
32                                                ^
33                                                |
34                                                @
35

README.BSD

1libublio uses BSD style data structure macros via queue.h and tree.h,
2something which is present in a form in all four major BSD variants.
3
4Upon trying to compile libublio on xBSD, one may ask: how do libublio's
5{quee,tree}.h headers relate to those of xBSD, and is it possible to use
6the native xBSD versions of these header files indeed?
7
8Briefly: you can use the native queue.h on all BSDs but you can use the
9native tree.h only on FreeBSD.
10
11In details:
12
13- queue.h is taken from OpenBSD as is. I choose the OpenBSD version because
14  that seemed to be the least stuffed with system-specific stuff. However,
15  those macros of queue.h which I use do the same on all BSDs.
16
17- tree.h was taken from FreeBSD with some modifications. I choose the FreeBSD
18  version for two features:
19  - it can generate a static tree function kit;
20  - it has the RB_NFIND macro which looks up the least upper bound of a sample
21    node.
22
23  I made some adjustments on both features.
24  - regarding the static functions: I made the code a bit more portable;
25  - regarding RB_NFIND: I replaced the FreeBSD implementation with a more
26    streamlined and optimized one.
27