child->d_parent = dird;
child->d_inode = NULL;
- LOCK_INODE_MUTEX(dir);
- rc = -ENOENT;
- bh = osd_ldiskfs_find_entry(dir, child, &de, NULL);
- if (bh) {
- rc = ldiskfs_delete_entry(oh->ot_handle, dir, de, bh);
- brelse(bh);
- }
- UNLOCK_INODE_MUTEX(dir);
+ mutex_lock(&dir->i_mutex);
+ rc = -ENOENT;
+ bh = osd_ldiskfs_find_entry(dir, child, &de, NULL);
+ if (bh) {
+ rc = ldiskfs_delete_entry(oh->ot_handle, dir, de, bh);
+ brelse(bh);
+ }
+ mutex_unlock(&dir->i_mutex);
- RETURN(rc);
+ RETURN(rc);
}
int osd_compat_add_entry(struct osd_thread_info *info, struct osd_device *osd,
child->d_parent = dir;
child->d_inode = inode;
- LOCK_INODE_MUTEX(dir->d_inode);
- rc = osd_ldiskfs_add_entry(oh->ot_handle, child, inode, NULL);
- UNLOCK_INODE_MUTEX(dir->d_inode);
+ mutex_lock(&dir->d_inode->i_mutex);
+ rc = osd_ldiskfs_add_entry(oh->ot_handle, child, inode, NULL);
+ mutex_unlock(&dir->d_inode->i_mutex);
- RETURN(rc);
+ RETURN(rc);
}
int osd_compat_objid_lookup(struct osd_thread_info *info,
/* XXX: we can use rc from sprintf() instead of strlen() */
d_seq->d_name.len = strlen(name);
- dir = d->d_inode;
- LOCK_INODE_MUTEX(dir);
- bh = osd_ldiskfs_find_entry(dir, d_seq, &de, NULL);
- UNLOCK_INODE_MUTEX(dir);
+ dir = d->d_inode;
+ mutex_lock(&dir->i_mutex);
+ bh = osd_ldiskfs_find_entry(dir, d_seq, &de, NULL);
+ mutex_unlock(&dir->i_mutex);
if (bh == NULL)
RETURN(-ENOENT);