Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2766 → Rev 2765

/trunk/uspace/srv/vfs/vfs_ops.c
50,6 → 50,7
#include <ctype.h>
#include <fcntl.h>
#include <assert.h>
#include <atomic.h>
#include <vfs/canonify.h>
 
/* Forward declarations of static functions. */
61,7 → 62,7
*/
RWLOCK_INITIALIZE(namespace_rwlock);
 
futex_t rootfs_futex = FUTEX_INITIALIZER;
atomic_t rootfs_futex = FUTEX_INITIALIZER;
vfs_triplet_t rootfs = {
.fs_handle = 0,
.dev_handle = 0,
685,9 → 686,7
* 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);
811,9 → 810,7
free(new);
return;
}
futex_down(&nodes_futex);
new_node->lnkcnt--;
futex_up(&nodes_futex);
break;
default:
rwlock_write_unlock(&namespace_rwlock);
833,9 → 830,7
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) {
848,9 → 843,7
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 <futex.h>
#include <atomic.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;
futex_t phone_futex; /**< Phone serializing futex. */
atomic_t phone_futex; /**< Phone serializing futex. */
ipcarg_t phone;
} fs_info_t;
 
232,8 → 232,6
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. */
249,7 → 247,7
size_t len; /**< Number of characters in this PLB entry. */
} plb_entry_t;
 
extern futex_t plb_futex; /**< Futex protecting plb and plb_head. */
extern atomic_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_lookup.c
44,11 → 44,12
#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))
 
futex_t plb_futex = FUTEX_INITIALIZER;
atomic_t plb_futex = FUTEX_INITIALIZER;
link_t plb_head; /**< PLB entry ring buffer. */
uint8_t *plb = NULL;
 
/trunk/uspace/srv/vfs/vfs_node.c
38,6 → 38,7
#include "vfs.h"
#include <stdlib.h>
#include <string.h>
#include <atomic.h>
#include <futex.h>
#include <rwlock.h>
#include <libadt/hash_table.h>
46,7 → 47,7
#include <errno.h>
 
/** Futex protecting the VFS node hash table. */
futex_t nodes_futex = FUTEX_INITIALIZER;
atomic_t nodes_futex = FUTEX_INITIALIZER;
 
#define NODES_BUCKETS_LOG 8
#define NODES_BUCKETS (1 << NODES_BUCKETS_LOG)