Table of Contents

NAME

gfs_read_nested, gfs_nb_read_nested, gfs_write_nested, gfs_nb_write_nested, - access a fork with a nested-strided pattern.

SYNOPSIS

#include <gfs.h>

int gfs_read_nested(int fork_id, char *buf, ulong_t offset, ulong_t size, struct gfs_stride *list, int levels);

int gfs_nb_read_nested(gfs_handle handle, int fork_id, char *buf, ulong_t offset, ulong_t size, struct gfs_stride *list, int levels);

int gfs_write_nested(int fork_id, char *buf, ulong_t offset, ulong_t size, struct gfs_stride *list, int levels);

int gfs_nb_write_nested(gfs_handle handle, int fork_id, char *buf, ulong_t offset, ulong_t size, struct gfs_stride *list, int levels);

DESCRIPTION

Galley's nested-strided calls read or write a series of chunks of data from fork fork_id. list is the address of a list of struct gfs_stride structures, each of which corresponds to a level of nesting. list[0] contains the information for the innermost level of nesting, and so on.

The innermost level of nesting is identical to a simplestrided request, as supported by Galley's stridedcalls. When that inner pattern is completed, the file offset is increased by list[1].f_off, the offset into memory is increased by list[1].m_off, and the inner strided pattern is repeated, beginning at the new file and memory offsets. The inner pattern causes list[0].quant chunks of data to be transferred, and the second-level pattern causes the first pattern to be repeated list[1].quant times. levels indicates how many levels of nesting are contained in list.

gfs_read_nested and gfs_write_nested are blocking calls, so they will not return until all the data has been transferred.

gfs_nb_read_nested and gfs_nb_write_nested are non-blocking calls, so they will return immediately. The application can call gfs_test(handle) to determine whether or not all the data has been transferred. The application must call gfs_wait(handle) before handle may be used in another nonblocking call.

RETURN VALUE

On a successful blocking call, the number of bytes read are returned. On a successful non-blocking call, 0 is returned. In either case, -1 is returned on an error, and gfs_errno is set appropriately.

ERRORS

GFS_EBADF
fork_id is not a valid fork.

GFS_EINVAL
handle is not a valid gfs_handle.

GFS_EIO A failure occurred at the server. This should not happen.

GFS_EBUSY
Can only occur on a non-blocking request. handle is already attached to an outstanding request, and needs to be "cleared" by calling gfs_wait(handle).


Table of Contents