Contents

buf_meta_breadn

Read a metadata block from a file with read-ahead.

Declaration

errno_t buf_meta_breadn(vnode_t vp, daddr64_t blkno, int size, daddr64_t *rablks, int *rasizes, int nrablks, kauth_cred_t cred, buf_t *bpp);

Parameters

  • vp:

    The file from which to read.

  • blkno:

    The logical (filesystem) block number to read synchronously.

  • size:

    Size of block; do not use for sizes > 4K.

  • rablks:

    Array of logical block numbers for asynchronous read-aheads.

  • rasizes:

    Array of block sizes for asynchronous read-aheads, each index corresponding to same index in "rablks."

  • nrablks:

    Number of entries in read-ahead arrays.

  • cred:

    Credential to store and use for reading from disk if data are not already in core.

  • bpp:

    Destination pointer for buffer.

Return Value

0 for success, or an error from buf_biowait().

Discussion

buf_meta_breadn() reads one block synchronously in the style of buf_meta_bread() and fires off a specified set of asynchronous reads to improve the likelihood of future cache hits. It should not be used to read blocks of greater than 4K (one VM page) in size; use cluster routines for large reads.

See Also

Buffers