package uring

  1. Overview
  2. Docs

Module Uring.Fallocate_flagsSource

Mode flags controlling the behaviour of fallocate. The empty set allocates the range as for posix_fallocate(3), extending the file size if necessary. Flags are combined with ( + ).

include FLAGS
Sourcetype t = private int

A set of flags.

Sourceval empty : t
Sourceval of_int : int -> t

of_int i is the flags whose bits are those set in i.

Sourceval to_int : t -> int

to_int t is the integer with the bits of the flags t set.

Sourceval (+) : t -> t -> t

a + b is the union of the sets.

Sourceval mem : t -> t -> bool

mem x flags is true iff x is a subset of flags.

Sourceval (=) : t -> t -> bool

a = b is true iff a and b are the same set of flags.

Sourceval keep_size : t

keep_size allocates the range but does not change the file size, so a subsequent write into the range will not need to allocate blocks.

Sourceval punch_hole : t

punch_hole deallocates the range (creating a hole), reading back as zeroes. Must be combined with keep_size.

Sourceval collapse_range : t

collapse_range removes the range from the file without leaving a hole, shifting any data beyond it downwards.

Sourceval zero_range : t

zero_range converts the range to zeroes, allocating blocks as needed. Combine with keep_size to avoid changing the file size.

Sourceval insert_range : t

insert_range inserts a hole of len bytes at off, shifting existing data beyond off upwards.

Sourceval unshare_range : t

unshare_range unshares any shared blocks within the range, for example on a reflinked or snapshotted file.

Sourceval write_zeroes : t

write_zeroes zeroes the range such that subsequent reads return zeroes (requires recent kernel and filesystem support).