static void yaffs_gross_lock(struct yaffs_dev *dev)
{
T(YAFFS_TRACE_LOCK, (TSTR("yaffs locking %p\n"), current));
- down(&(yaffs_dev_to_lc(dev)->gross_lock));
+ mutex_lock(&(yaffs_dev_to_lc(dev)->gross_lock));
T(YAFFS_TRACE_LOCK, (TSTR("yaffs locked %p\n"), current));
}
static void yaffs_gross_unlock(struct yaffs_dev *dev)
{
T(YAFFS_TRACE_LOCK, (TSTR("yaffs unlocking %p\n"), current));
- up(&(yaffs_dev_to_lc(dev)->gross_lock));
+ mutex_unlock(&(yaffs_dev_to_lc(dev)->gross_lock));
}
/* ExportFS support */
}
static LIST_HEAD(yaffs_context_list);
-struct semaphore yaffs_context_lock;
+struct mutex yaffs_context_lock;
static void yaffs_put_super(struct super_block *sb)
{
yaffs_deinitialise(dev);
yaffs_gross_unlock(dev);
-
- down(&yaffs_context_lock);
+ mutex_lock(&yaffs_context_lock);
list_del_init(&(yaffs_dev_to_lc(dev)->context_list));
- up(&yaffs_context_lock);
+ mutex_unlock(&yaffs_context_lock);
if (yaffs_dev_to_lc(dev)->spare_buffer) {
YFREE(yaffs_dev_to_lc(dev)->spare_buffer);
param->skip_checkpt_rd = options.skip_checkpoint_read;
param->skip_checkpt_wr = options.skip_checkpoint_write;
- down(&yaffs_context_lock);
+ mutex_lock(&yaffs_context_lock);
/* Get a mount id */
found = 0;
for (mount_id = 0; !found; mount_id++) {
list_add_tail(&(yaffs_dev_to_lc(dev)->context_list),
&yaffs_context_list);
- up(&yaffs_context_lock);
+ mutex_unlock(&yaffs_context_lock);
/* Directory search handling... */
INIT_LIST_HEAD(&(yaffs_dev_to_lc(dev)->search_contexts));
param->remove_obj_fn = yaffs_remove_obj_callback;
- init_MUTEX(&(yaffs_dev_to_lc(dev)->gross_lock));
+ mutex_init(&(yaffs_dev_to_lc(dev)->gross_lock));
yaffs_gross_lock(dev);
else {
step -= 2;
- down(&yaffs_context_lock);
+ mutex_lock(&yaffs_context_lock);
/* Locate and print the Nth entry. Order N-squared but N is small. */
list_for_each(item, &yaffs_context_list) {
break;
}
- up(&yaffs_context_lock);
+ mutex_unlock(&yaffs_context_lock);
}
return buf - page < count ? buf - page : count;
char *buf = page;
int n = 0;
- down(&yaffs_context_lock);
+ mutex_lock(&yaffs_context_lock);
/* Locate and print the Nth entry. Order N-squared but N is small. */
list_for_each(item, &yaffs_context_list) {
dev->bg_gcs, dev->oldest_dirty_gc_count,
dev->n_obj, dev->n_tnodes);
}
- up(&yaffs_context_lock);
+ mutex_unlock(&yaffs_context_lock);
return buf - page < count ? buf - page : count;
}
(" \n\n\n\nYAFFS-WARNING CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED selected.\n\n\n\n")));
#endif
- init_MUTEX(&yaffs_context_lock);
+ mutex_init(&yaffs_context_lock);
/* Install the proc_fs entries */
my_proc_entry = create_proc_entry("yaffs",