/trunk/uspace/srv/vfs/vfs_ops.c |
---|
50,7 → 50,6 |
#include <ctype.h> |
#include <fcntl.h> |
#include <assert.h> |
#include <atomic.h> |
#include <vfs/canonify.h> |
/* Forward declarations of static functions. */ |
62,7 → 61,7 |
*/ |
RWLOCK_INITIALIZE(namespace_rwlock); |
atomic_t rootfs_futex = FUTEX_INITIALIZER; |
futex_t rootfs_futex = FUTEX_INITIALIZER; |
vfs_triplet_t rootfs = { |
.fs_handle = 0, |
.dev_handle = 0, |
686,7 → 685,9 |
* VFS_DESTROY'ed after the last reference to it is dropped. |
*/ |
vfs_node_t *node = vfs_node_get(&lr); |
futex_down(&nodes_futex); |
node->lnkcnt--; |
futex_up(&nodes_futex); |
rwlock_write_unlock(&namespace_rwlock); |
vfs_node_put(node); |
ipc_answer_0(rid, EOK); |
810,7 → 811,9 |
free(new); |
return; |
} |
futex_down(&nodes_futex); |
new_node->lnkcnt--; |
futex_up(&nodes_futex); |
break; |
default: |
rwlock_write_unlock(&namespace_rwlock); |
830,7 → 833,9 |
free(new); |
return; |
} |
futex_down(&nodes_futex); |
old_node->lnkcnt++; |
futex_up(&nodes_futex); |
/* Destroy the link for the old name. */ |
rc = vfs_lookup_internal(oldc, L_UNLINK, NULL, NULL); |
if (rc != EOK) { |
843,7 → 848,9 |
free(new); |
return; |
} |
futex_down(&nodes_futex); |
old_node->lnkcnt--; |
futex_up(&nodes_futex); |
rwlock_write_unlock(&namespace_rwlock); |
vfs_node_put(old_node); |
if (new_node) |
/trunk/uspace/srv/vfs/vfs.h |
---|
35,7 → 35,7 |
#include <ipc/ipc.h> |
#include <libadt/list.h> |
#include <atomic.h> |
#include <futex.h> |
#include <rwlock.h> |
#include <sys/types.h> |
#include <bool.h> |
107,7 → 107,7 |
link_t fs_link; |
vfs_info_t vfs_info; |
int fs_handle; |
atomic_t phone_futex; /**< Phone serializing futex. */ |
futex_t phone_futex; /**< Phone serializing futex. */ |
ipcarg_t phone; |
} fs_info_t; |
232,6 → 232,8 |
off_t pos; |
} vfs_file_t; |
extern futex_t nodes_futex; |
extern link_t fs_head; /**< List of registered file systems. */ |
extern vfs_triplet_t rootfs; /**< Root node of the root file system. */ |
247,7 → 249,7 |
size_t len; /**< Number of characters in this PLB entry. */ |
} plb_entry_t; |
extern atomic_t plb_futex; /**< Futex protecting plb and plb_head. */ |
extern futex_t plb_futex; /**< Futex protecting plb and plb_head. */ |
extern uint8_t *plb; /**< Path Lookup Buffer */ |
extern link_t plb_head; /**< List of active PLB entries. */ |
/trunk/uspace/srv/vfs/vfs_node.c |
---|
38,7 → 38,6 |
#include "vfs.h" |
#include <stdlib.h> |
#include <string.h> |
#include <atomic.h> |
#include <futex.h> |
#include <rwlock.h> |
#include <libadt/hash_table.h> |
47,7 → 46,7 |
#include <errno.h> |
/** Futex protecting the VFS node hash table. */ |
atomic_t nodes_futex = FUTEX_INITIALIZER; |
futex_t nodes_futex = FUTEX_INITIALIZER; |
#define NODES_BUCKETS_LOG 8 |
#define NODES_BUCKETS (1 << NODES_BUCKETS_LOG) |
/trunk/uspace/srv/vfs/vfs_lookup.c |
---|
44,12 → 44,11 |
#include <bool.h> |
#include <futex.h> |
#include <libadt/list.h> |
#include <atomic.h> |
#include <vfs/canonify.h> |
#define min(a, b) ((a) < (b) ? (a) : (b)) |
atomic_t plb_futex = FUTEX_INITIALIZER; |
futex_t plb_futex = FUTEX_INITIALIZER; |
link_t plb_head; /**< PLB entry ring buffer. */ |
uint8_t *plb = NULL; |