--- IO-AIO/AIO.pm 2012/06/17 17:07:25 1.228 +++ IO-AIO/AIO.pm 2012/07/30 16:46:30 1.232 @@ -204,8 +204,8 @@ =head2 QUICK OVERVIEW -This section simply lists the prototypes of the most important functions -for quick reference. See the following sections for function-by-function +This section simply lists the prototypes most of the functions for +quick reference. See the following sections for function-by-function documentation. aio_wd $pathname, $callback->($wd) @@ -223,6 +223,8 @@ aio_chown $fh_or_path, $uid, $gid, $callback->($status) aio_chmod $fh_or_path, $mode, $callback->($status) aio_truncate $fh_or_path, $offset, $callback->($status) + aio_allocate $fh, $mode, $offset, $len, $callback->($status) + aio_fiemap $fh, $start, $length, $flags, $count, $cb->(\@extents) aio_unlink $pathname, $callback->($status) aio_mknod $pathname, $mode, $dev, $callback->($status) aio_link $srcpath, $dstpath, $callback->($status) @@ -640,6 +642,22 @@ Works like truncate(2) or ftruncate(2). +=item aio_allocate $fh, $mode, $offset, $len, $callback->($status) + +Allocates or freed disk space according to the C<$mode> argument. See the +linux C docuemntation for details. + +C<$mode> can currently be C<0> or C +to allocate space, or C, to deallocate a file range. + +The file system block size used by C is presumably the +C returned by C. + +If C isn't available or cannot be emulated (currently no +emulation will be attempted), passes C<-1> and sets C<$!> to C. + + =item aio_chmod $fh_or_path, $mode, $callback->($status) Works like perl's C function. @@ -1263,7 +1281,7 @@ Queries the extents of the given file (by calling the Linux FIEMAP ioctl, see L for details). If the -C is not available on your OS, then this rquiest will fail with +C is not available on your OS, then this request will fail with C. C<$start> is the starting offset to query extents for, C<$length> is the @@ -1276,9 +1294,9 @@ the data portion. C<$count> is the maximum number of extent records to return. If it is -C, then IO::AIO queries all extents of the file. As a very special +C, then IO::AIO queries all extents of the range. As a very special case, if it is C<0>, then the callback receives the number of extents -instead of the extents themselves. +instead of the extents themselves (which is unreliable, see below). If an error occurs, the callback receives no arguments. The special C value C is available to test for flag errors. @@ -1290,7 +1308,7 @@ [$logical, $physical, $length, $flags] Flags is any combination of the following flag values (typically either C<0> -or C): +or C (1)): C, C, C, C, @@ -1299,6 +1317,11 @@ C, C or C. +At the time of this writing (Linux 3.2), this requets is unreliable unless +C<$count> is C, as the kernel has all sorts of bugs preventing +it to return all extents of a range for files with large number of +extents. The code works around all these issues if C<$count> is undef. + =item aio_group $callback->(...) This is a very special aio request: Instead of doing something, it is a