NULL);
CDEBUG(D_INODE, "%s: add %s:%lu to remote parent %lu.\n", osd_name(osd),
name, obj->oo_inode->i_ino, parent->d_inode->i_ino);
- LASSERTF(parent->d_inode->i_nlink > 1, "%s: %lu nlink %d",
- osd_name(osd), parent->d_inode->i_ino,
- parent->d_inode->i_nlink);
- parent->d_inode->i_nlink++;
+ ldiskfs_inc_count(oh->ot_handle, parent->d_inode);
mark_inode_dirty(parent->d_inode);
mutex_unlock(&parent->d_inode->i_mutex);
RETURN(rc);
dentry = osd_child_dentry_by_inode(env, parent->d_inode,
name, strlen(name));
mutex_lock(&parent->d_inode->i_mutex);
- bh = osd_ldiskfs_find_entry(parent->d_inode, dentry, &de, NULL);
+ bh = osd_ldiskfs_find_entry(parent->d_inode, &dentry->d_name, &de,
+ NULL, NULL);
if (bh == NULL) {
mutex_unlock(&parent->d_inode->i_mutex);
RETURN(-ENOENT);
CDEBUG(D_INODE, "%s: el %s:%lu to remote parent %lu.\n", osd_name(osd),
name, obj->oo_inode->i_ino, parent->d_inode->i_ino);
rc = ldiskfs_delete_entry(oh->ot_handle, parent->d_inode, de, bh);
- LASSERTF(parent->d_inode->i_nlink > 1, "%s: %lu nlink %d",
- osd_name(osd), parent->d_inode->i_ino,
- parent->d_inode->i_nlink);
- parent->d_inode->i_nlink--;
+ ldiskfs_dec_count(oh->ot_handle, parent->d_inode);
mark_inode_dirty(parent->d_inode);
mutex_unlock(&parent->d_inode->i_mutex);
brelse(bh);
dentry = osd_child_dentry_by_inode(oti->oti_env, parent->d_inode,
name, strlen(name));
mutex_lock(&parent->d_inode->i_mutex);
- bh = osd_ldiskfs_find_entry(parent->d_inode, dentry, &de, NULL);
+ bh = osd_ldiskfs_find_entry(parent->d_inode, &dentry->d_name, &de,
+ NULL, NULL);
if (bh == NULL) {
rc = -ENOENT;
} else {
ll_vfs_dq_init(parent);
mutex_lock(&parent->i_mutex);
- bh = osd_ldiskfs_find_entry(parent, child, &de, NULL);
+ bh = osd_ldiskfs_find_entry(parent, &child->d_name, &de, NULL, NULL);
if (bh == NULL)
GOTO(out, rc = -ENOENT);
ll_vfs_dq_init(dir);
mutex_lock(&dir->i_mutex);
rc = -ENOENT;
- bh = osd_ldiskfs_find_entry(dir, child, &de, NULL);
+ bh = osd_ldiskfs_find_entry(dir, &child->d_name, &de, NULL, NULL);
if (bh) {
rc = ldiskfs_delete_entry(oh->ot_handle, dir, de, bh);
brelse(bh);
dir = d_seq->d_inode;
mutex_lock(&dir->i_mutex);
- bh = osd_ldiskfs_find_entry(dir, child, &de, NULL);
+ bh = osd_ldiskfs_find_entry(dir, &child->d_name, &de, NULL, NULL);
mutex_unlock(&dir->i_mutex);
if (bh == NULL)
tgt_child->d_inode = inode;
/* The non-initialized src_child may be destroyed. */
- jh = ldiskfs_journal_start_sb(osd_sb(osd),
+ jh = osd_journal_start_sb(osd_sb(osd), LDISKFS_HT_MISC,
osd_dto_credits_noquota[DTO_INDEX_DELETE] +
osd_dto_credits_noquota[DTO_INDEX_INSERT] +
osd_dto_credits_noquota[DTO_OBJECT_DELETE]);
mutex_lock(&src_parent->i_mutex);
mutex_lock(&dir->i_mutex);
- bh = osd_ldiskfs_find_entry(dir, tgt_child, &de, NULL);
+ bh = osd_ldiskfs_find_entry(dir, &tgt_child->d_name, &de, NULL, NULL);
if (bh != NULL) {
/* XXX: If some other object occupied the same slot. And If such
* inode is zero-sized and with SUID+SGID, then means it is
/* If the src object has never been modified, then remove it. */
if (inode->i_size == 0 && inode->i_mode & S_ISUID &&
inode->i_mode & S_ISGID) {
- bh = osd_ldiskfs_find_entry(src_parent, src_child, &de,
- NULL);
+ bh = osd_ldiskfs_find_entry(src_parent, &src_child->d_name,
+ &de, NULL, NULL);
if (unlikely(bh == NULL)) {
mutex_unlock(&src_parent->i_mutex);
ldiskfs_journal_stop(jh);
RETURN(rc);
}
- bh = osd_ldiskfs_find_entry(src_parent, src_child, &de, NULL);
+ bh = osd_ldiskfs_find_entry(src_parent, &src_child->d_name, &de,
+ NULL, NULL);
if (unlikely(bh == NULL))
GOTO(unlock, rc = -ENOENT);