FreeBSD ZFS
The Zettabyte File System
Data Structures | Typedefs | Enumerations | Functions

sys/zfs_rlock.h File Reference

#include <sys/zfs_znode.h>
Include dependency graph for zfs_rlock.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rl

Typedefs

typedef struct rl rl_t

Enumerations

enum  rl_type_t { RL_READER, RL_WRITER, RL_APPEND }

Functions

rl_tzfs_range_lock (znode_t *zp, uint64_t off, uint64_t len, rl_type_t type)
 Lock an object range.
void zfs_range_unlock (rl_t *rl)
void zfs_range_reduce (rl_t *rl, uint64_t off, uint64_t len)
 Unlock range and destroy range lock structure.
int zfs_range_compare (const void *arg1, const void *arg2)
 AVL comparison function used to order range locks Locks are ordered on the start offset of the range.

Typedef Documentation

typedef struct rl rl_t

Enumeration Type Documentation

enum rl_type_t
Enumerator:
RL_READER 
RL_WRITER 
RL_APPEND 

Definition at line 39 of file zfs_rlock.h.


Function Documentation

int zfs_range_compare ( const void *  arg1,
const void *  arg2 
)

AVL comparison function used to order range locks Locks are ordered on the start offset of the range.

Definition at line 585 of file zfs_rlock.c.

rl_t* zfs_range_lock ( znode_t zp,
uint64_t  off,
uint64_t  len,
rl_type_t  type 
)

Lock an object range.

Parameters:
offOffset into the file that begins the range
lenLength of the range to lock
typeEither shared (RL_READER) or exclusive (RL_WRITER or RL_APPEND). APPEND is a special type that is converted to WRITER that specified to lock from the start of the end of file.
Returns:
The range lock structure for later unlocking or reduce range (if entire file previously locked as RL_WRITER).

Definition at line 423 of file zfs_rlock.c.

void zfs_range_reduce ( rl_t rl,
uint64_t  off,
uint64_t  len 
)

Unlock range and destroy range lock structure.

Unlock range and destroy range lock structure.

Asserts the whole file is exclusivly locked and so there's only one entry in the tree.

Definition at line 562 of file zfs_rlock.c.

void zfs_range_unlock ( rl_t rl)

Definition at line 524 of file zfs_rlock.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines