Lines Matching refs:osb

55 static int ocfs2_mknod_locked(struct ocfs2_super *osb,
64 static int ocfs2_prepare_orphan_dir(struct ocfs2_super *osb,
71 static int ocfs2_orphan_add(struct ocfs2_super *osb,
80 static int ocfs2_create_symlink_data(struct ocfs2_super *osb,
85 static int ocfs2_double_lock(struct ocfs2_super *osb,
209 static void ocfs2_cleanup_add_entry_failure(struct ocfs2_super *osb,
214 ocfs2_simple_drop_lockres(osb, &dl->dl_lockres);
233 struct ocfs2_super *osb;
265 osb = OCFS2_SB(dir->i_sb);
274 if (S_ISDIR(mode) && (dir->i_nlink >= ocfs2_link_max(osb))) {
292 status = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh,
301 status = ocfs2_reserve_new_inode(osb, &inode_ac);
337 if (S_ISDIR(mode) && !ocfs2_supports_inline_data(osb)) {
341 if (ocfs2_supports_indexed_dirs(osb))
345 status = ocfs2_reserve_new_metadata_blocks(osb, want_meta, &meta_ac);
352 status = ocfs2_reserve_clusters(osb, want_clusters, &data_ac);
359 handle = ocfs2_start_trans(osb, ocfs2_mknod_credits(osb->sb,
379 status = ocfs2_mknod_locked(osb, dir, inode, dev,
389 status = ocfs2_fill_new_dir(osb, handle, dir, inode,
463 ocfs2_commit_trans(osb, handle);
492 ocfs2_cleanup_add_entry_failure(osb, dentry, inode);
515 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb);
527 inode->i_ino = ino_from_blkno(osb->sb, fe_blkno);
529 spin_lock(&osb->osb_lock);
530 inode->i_generation = osb->s_next_generation++;
531 spin_unlock(&osb->osb_lock);
533 *new_fe_bh = sb_getblk(osb->sb, fe_blkno);
550 memset(fe, 0, osb->sb->s_blocksize);
553 fe->i_fs_generation = cpu_to_le32(osb->fs_generation);
581 if (S_ISDIR(inode->i_mode) && ocfs2_supports_inline_data(osb)) {
585 ocfs2_max_inline_data_with_xattr(osb->sb, fe));
590 fel->l_count = cpu_to_le16(ocfs2_extent_recs_per_inode(osb->sb));
596 ocfs2_ci_set_new(osb, INODE_CACHE(inode));
597 if (!ocfs2_mount_local(osb)) {
618 static int ocfs2_mknod_locked(struct ocfs2_super *osb,
691 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb);
709 err = ocfs2_double_lock(osb, &old_dir_bh, old_dir,
724 mlog(ML_ERROR, "%s: no old_dir_bh!\n", osb->uuid_str);
756 err = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh,
772 if (ocfs2_read_links_count(fe) >= ocfs2_link_max(osb)) {
777 handle = ocfs2_start_trans(osb, ocfs2_link_credits(osb->sb));
822 ocfs2_commit_trans(osb, handle);
880 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb);
903 if (inode == osb->root_inode)
957 status = ocfs2_prepare_orphan_dir(osb, &orphan_dir,
968 handle = ocfs2_start_trans(osb, ocfs2_unlink_credits(osb->sb));
1011 status = ocfs2_orphan_add(osb, handle, inode, fe_bh,
1019 ocfs2_commit_trans(osb, handle);
1045 static int ocfs2_check_if_ancestor(struct ocfs2_super *osb,
1055 child_inode = ocfs2_iget(osb, child_inode_no, 0, 0);
1083 if (parent_inode_no == osb->root_inode->i_ino) {
1108 static int ocfs2_double_lock(struct ocfs2_super *osb,
1131 inode1_is_ancestor = ocfs2_check_if_ancestor(osb, oi2->ip_blkno,
1138 inode2_is_ancestor = ocfs2_check_if_ancestor(osb, oi1->ip_blkno,
1214 struct ocfs2_super *osb = NULL;
1249 osb = OCFS2_SB(old_dir->i_sb);
1268 status = ocfs2_rename_lock(osb);
1277 status = ocfs2_check_if_ancestor(osb, new_dir->i_ino,
1292 status = ocfs2_double_lock(osb, &old_dir_bh, old_dir,
1356 if (!new_inode && new_dir->i_nlink >= ocfs2_link_max(osb)) {
1456 status = ocfs2_prepare_orphan_dir(osb, &orphan_dir,
1475 status = ocfs2_prepare_dir_for_insert(osb, new_dir, new_dir_bh,
1485 handle = ocfs2_start_trans(osb, ocfs2_rename_credits(osb->sb));
1524 status = ocfs2_orphan_add(osb, handle, new_inode,
1569 if (!is_journal_aborted(osb->journal->j_journal)) {
1570 ocfs2_error(osb->sb, "new entry %.*s is added, but old entry %.*s "
1581 if (!is_journal_aborted(osb->journal->j_journal)) {
1582 ocfs2_error(osb->sb, "new entry %.*s is added, but old entry %.*s "
1658 ocfs2_commit_trans(osb, handle);
1677 ocfs2_rename_unlock(osb);
1705 static int ocfs2_create_symlink_data(struct ocfs2_super *osb,
1712 struct super_block *sb = osb->sb;
1810 struct ocfs2_super *osb = NULL;
1843 osb = OCFS2_SB(sb);
1869 status = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh,
1877 status = ocfs2_reserve_new_inode(osb, &inode_ac);
1917 status = ocfs2_reserve_clusters(osb, want_clusters, &data_ac);
1924 handle = ocfs2_start_trans(osb, credits + xattr_credits);
1946 status = ocfs2_mknod_locked(osb, dir, inode,
1963 ocfs2_clusters_to_bytes(osb->sb, 1));
1968 status = ocfs2_add_inode_data(osb, inode, &offset, 1, 0,
1998 status = ocfs2_create_symlink_data(osb, handle, inode,
2041 ocfs2_clusters_to_bytes(osb->sb, 1));
2047 ocfs2_commit_trans(osb, handle);
2066 ocfs2_cleanup_add_entry_failure(osb, dentry, inode);
2108 static int ocfs2_lookup_lock_orphan_dir(struct ocfs2_super *osb,
2116 orphan_dir_inode = ocfs2_get_system_file_inode(osb,
2118 osb->slot_num);
2150 struct ocfs2_super *osb = OCFS2_SB(orphan_dir_inode->i_sb);
2173 ret = ocfs2_prepare_dir_for_insert(osb, orphan_dir_inode,
2187 * @osb: ocfs2 file system
2198 static int ocfs2_prepare_orphan_dir(struct ocfs2_super *osb,
2209 ret = ocfs2_lookup_lock_orphan_dir(osb, &orphan_dir_inode,
2239 static int ocfs2_orphan_add(struct ocfs2_super *osb,
2311 fe->i_dio_orphaned_slot = cpu_to_le16(osb->slot_num);
2319 fe->i_orphaned_slot = cpu_to_le16(osb->slot_num);
2325 osb->slot_num);
2341 int ocfs2_orphan_del(struct ocfs2_super *osb,
2449 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb);
2454 ret = ocfs2_lookup_lock_orphan_dir(osb, &orphan_dir, &orphan_dir_bh);
2461 ret = ocfs2_reserve_new_inode(osb, &inode_ac);
2515 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb);
2549 handle = ocfs2_start_trans(osb, ocfs2_mknod_credits(osb->sb, 0, 0));
2581 status = ocfs2_orphan_add(osb, handle, inode, new_di_bh, orphan_name,
2598 ocfs2_commit_trans(osb, handle);
2627 int ocfs2_add_inode_to_orphan(struct ocfs2_super *osb,
2657 status = ocfs2_del_inode_from_orphan(osb, inode, di_bh, 0, 0);
2664 status = ocfs2_prepare_orphan_dir(osb, &orphan_dir_inode,
2674 handle = ocfs2_start_trans(osb,
2681 status = ocfs2_orphan_add(osb, handle, inode, di_bh, orphan_name,
2686 ocfs2_commit_trans(osb, handle);
2703 int ocfs2_del_inode_from_orphan(struct ocfs2_super *osb,
2713 orphan_dir_inode = ocfs2_get_system_file_inode(osb,
2731 handle = ocfs2_start_trans(osb,
2740 status = ocfs2_orphan_del(osb, handle, orphan_dir_inode,
2767 ocfs2_commit_trans(osb, handle);
2786 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb);
2818 status = ocfs2_prepare_dir_for_insert(osb, dir, parent_di_bh,
2826 orphan_dir_inode = ocfs2_get_system_file_inode(osb,
2828 osb->slot_num);
2851 handle = ocfs2_start_trans(osb, ocfs2_rename_credits(osb->sb));
2866 status = ocfs2_orphan_del(osb, handle, orphan_dir_inode, inode,
2899 ocfs2_commit_trans(osb, handle);