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, in ocfs2_cleanup_add_entry_failure() argument
214 ocfs2_simple_drop_lockres(osb, &dl->dl_lockres); in ocfs2_cleanup_add_entry_failure()
233 struct ocfs2_super *osb; in ocfs2_mknod() local
264 osb = OCFS2_SB(dir->i_sb); in ocfs2_mknod()
273 if (S_ISDIR(mode) && (dir->i_nlink >= ocfs2_link_max(osb))) { in ocfs2_mknod()
291 status = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh, in ocfs2_mknod()
300 status = ocfs2_reserve_new_inode(osb, &inode_ac); in ocfs2_mknod()
336 if (S_ISDIR(mode) && !ocfs2_supports_inline_data(osb)) { in ocfs2_mknod()
340 if (ocfs2_supports_indexed_dirs(osb)) in ocfs2_mknod()
344 status = ocfs2_reserve_new_metadata_blocks(osb, want_meta, &meta_ac); in ocfs2_mknod()
351 status = ocfs2_reserve_clusters(osb, want_clusters, &data_ac); in ocfs2_mknod()
358 handle = ocfs2_start_trans(osb, ocfs2_mknod_credits(osb->sb, in ocfs2_mknod()
378 status = ocfs2_mknod_locked(osb, dir, inode, dev, in ocfs2_mknod()
388 status = ocfs2_fill_new_dir(osb, handle, dir, inode, in ocfs2_mknod()
462 ocfs2_commit_trans(osb, handle); in ocfs2_mknod()
491 ocfs2_cleanup_add_entry_failure(osb, dentry, inode); in ocfs2_mknod()
514 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in __ocfs2_mknod_locked() local
526 inode->i_ino = ino_from_blkno(osb->sb, fe_blkno); in __ocfs2_mknod_locked()
528 spin_lock(&osb->osb_lock); in __ocfs2_mknod_locked()
529 inode->i_generation = osb->s_next_generation++; in __ocfs2_mknod_locked()
530 spin_unlock(&osb->osb_lock); in __ocfs2_mknod_locked()
532 *new_fe_bh = sb_getblk(osb->sb, fe_blkno); in __ocfs2_mknod_locked()
549 memset(fe, 0, osb->sb->s_blocksize); in __ocfs2_mknod_locked()
552 fe->i_fs_generation = cpu_to_le32(osb->fs_generation); in __ocfs2_mknod_locked()
580 if (S_ISDIR(inode->i_mode) && ocfs2_supports_inline_data(osb)) { in __ocfs2_mknod_locked()
584 ocfs2_max_inline_data_with_xattr(osb->sb, fe)); in __ocfs2_mknod_locked()
589 fel->l_count = cpu_to_le16(ocfs2_extent_recs_per_inode(osb->sb)); in __ocfs2_mknod_locked()
595 ocfs2_ci_set_new(osb, INODE_CACHE(inode)); in __ocfs2_mknod_locked()
596 if (!ocfs2_mount_local(osb)) { in __ocfs2_mknod_locked()
617 static int ocfs2_mknod_locked(struct ocfs2_super *osb, in ocfs2_mknod_locked() argument
690 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in ocfs2_link() local
708 err = ocfs2_double_lock(osb, &old_dir_bh, old_dir, in ocfs2_link()
723 mlog(ML_ERROR, "%s: no old_dir_bh!\n", osb->uuid_str); in ocfs2_link()
755 err = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh, in ocfs2_link()
771 if (ocfs2_read_links_count(fe) >= ocfs2_link_max(osb)) { in ocfs2_link()
776 handle = ocfs2_start_trans(osb, ocfs2_link_credits(osb->sb)); in ocfs2_link()
821 ocfs2_commit_trans(osb, handle); in ocfs2_link()
879 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in ocfs2_unlink() local
902 if (inode == osb->root_inode) in ocfs2_unlink()
956 status = ocfs2_prepare_orphan_dir(osb, &orphan_dir, in ocfs2_unlink()
967 handle = ocfs2_start_trans(osb, ocfs2_unlink_credits(osb->sb)); in ocfs2_unlink()
1010 status = ocfs2_orphan_add(osb, handle, inode, fe_bh, in ocfs2_unlink()
1018 ocfs2_commit_trans(osb, handle); in ocfs2_unlink()
1044 static int ocfs2_check_if_ancestor(struct ocfs2_super *osb, in ocfs2_check_if_ancestor() argument
1054 child_inode = ocfs2_iget(osb, child_inode_no, 0, 0); in ocfs2_check_if_ancestor()
1082 if (parent_inode_no == osb->root_inode->i_ino) { in ocfs2_check_if_ancestor()
1107 static int ocfs2_double_lock(struct ocfs2_super *osb, in ocfs2_double_lock() argument
1130 inode1_is_ancestor = ocfs2_check_if_ancestor(osb, oi2->ip_blkno, in ocfs2_double_lock()
1137 inode2_is_ancestor = ocfs2_check_if_ancestor(osb, oi1->ip_blkno, in ocfs2_double_lock()
1213 struct ocfs2_super *osb = NULL; in ocfs2_rename() local
1248 osb = OCFS2_SB(old_dir->i_sb); in ocfs2_rename()
1267 status = ocfs2_rename_lock(osb); in ocfs2_rename()
1276 status = ocfs2_check_if_ancestor(osb, new_dir->i_ino, in ocfs2_rename()
1291 status = ocfs2_double_lock(osb, &old_dir_bh, old_dir, in ocfs2_rename()
1356 new_dir->i_nlink >= ocfs2_link_max(osb)) { in ocfs2_rename()
1456 status = ocfs2_prepare_orphan_dir(osb, &orphan_dir, in ocfs2_rename()
1475 status = ocfs2_prepare_dir_for_insert(osb, new_dir, new_dir_bh, in ocfs2_rename()
1485 handle = ocfs2_start_trans(osb, ocfs2_rename_credits(osb->sb)); in ocfs2_rename()
1524 status = ocfs2_orphan_add(osb, handle, new_inode, in ocfs2_rename()
1565 if (!is_journal_aborted(osb->journal->j_journal)) { in ocfs2_rename()
1566 ocfs2_error(osb->sb, "new entry %.*s is added, but old entry %.*s " in ocfs2_rename()
1577 if (!is_journal_aborted(osb->journal->j_journal)) { in ocfs2_rename()
1578 ocfs2_error(osb->sb, "new entry %.*s is added, but old entry %.*s " in ocfs2_rename()
1642 ocfs2_commit_trans(osb, handle); in ocfs2_rename()
1661 ocfs2_rename_unlock(osb); in ocfs2_rename()
1689 static int ocfs2_create_symlink_data(struct ocfs2_super *osb, in ocfs2_create_symlink_data() argument
1696 struct super_block *sb = osb->sb; in ocfs2_create_symlink_data()
1794 struct ocfs2_super *osb = NULL; in ocfs2_symlink() local
1826 osb = OCFS2_SB(sb); in ocfs2_symlink()
1852 status = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh, in ocfs2_symlink()
1860 status = ocfs2_reserve_new_inode(osb, &inode_ac); in ocfs2_symlink()
1900 status = ocfs2_reserve_clusters(osb, want_clusters, &data_ac); in ocfs2_symlink()
1907 handle = ocfs2_start_trans(osb, credits + xattr_credits); in ocfs2_symlink()
1929 status = ocfs2_mknod_locked(osb, dir, inode, in ocfs2_symlink()
1946 ocfs2_clusters_to_bytes(osb->sb, 1)); in ocfs2_symlink()
1951 status = ocfs2_add_inode_data(osb, inode, &offset, 1, 0, in ocfs2_symlink()
1981 status = ocfs2_create_symlink_data(osb, handle, inode, in ocfs2_symlink()
2024 ocfs2_clusters_to_bytes(osb->sb, 1)); in ocfs2_symlink()
2030 ocfs2_commit_trans(osb, handle); in ocfs2_symlink()
2049 ocfs2_cleanup_add_entry_failure(osb, dentry, inode); in ocfs2_symlink()
2091 static int ocfs2_lookup_lock_orphan_dir(struct ocfs2_super *osb, in ocfs2_lookup_lock_orphan_dir() argument
2099 orphan_dir_inode = ocfs2_get_system_file_inode(osb, in ocfs2_lookup_lock_orphan_dir()
2101 osb->slot_num); in ocfs2_lookup_lock_orphan_dir()
2133 struct ocfs2_super *osb = OCFS2_SB(orphan_dir_inode->i_sb); in __ocfs2_prepare_orphan_dir() local
2156 ret = ocfs2_prepare_dir_for_insert(osb, orphan_dir_inode, in __ocfs2_prepare_orphan_dir()
2181 static int ocfs2_prepare_orphan_dir(struct ocfs2_super *osb, in ocfs2_prepare_orphan_dir() argument
2192 ret = ocfs2_lookup_lock_orphan_dir(osb, &orphan_dir_inode, in ocfs2_prepare_orphan_dir()
2222 static int ocfs2_orphan_add(struct ocfs2_super *osb, in ocfs2_orphan_add() argument
2294 fe->i_dio_orphaned_slot = cpu_to_le16(osb->slot_num); in ocfs2_orphan_add()
2302 fe->i_orphaned_slot = cpu_to_le16(osb->slot_num); in ocfs2_orphan_add()
2308 osb->slot_num); in ocfs2_orphan_add()
2324 int ocfs2_orphan_del(struct ocfs2_super *osb, in ocfs2_orphan_del() argument
2432 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in ocfs2_prep_new_orphaned_file() local
2437 ret = ocfs2_lookup_lock_orphan_dir(osb, &orphan_dir, &orphan_dir_bh); in ocfs2_prep_new_orphaned_file()
2444 ret = ocfs2_reserve_new_inode(osb, &inode_ac); in ocfs2_prep_new_orphaned_file()
2498 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in ocfs2_create_inode_in_orphan() local
2532 handle = ocfs2_start_trans(osb, ocfs2_mknod_credits(osb->sb, 0, 0)); in ocfs2_create_inode_in_orphan()
2564 status = ocfs2_orphan_add(osb, handle, inode, new_di_bh, orphan_name, in ocfs2_create_inode_in_orphan()
2581 ocfs2_commit_trans(osb, handle); in ocfs2_create_inode_in_orphan()
2610 int ocfs2_add_inode_to_orphan(struct ocfs2_super *osb, in ocfs2_add_inode_to_orphan() argument
2640 status = ocfs2_del_inode_from_orphan(osb, inode, di_bh, 0, 0); in ocfs2_add_inode_to_orphan()
2647 status = ocfs2_prepare_orphan_dir(osb, &orphan_dir_inode, in ocfs2_add_inode_to_orphan()
2657 handle = ocfs2_start_trans(osb, in ocfs2_add_inode_to_orphan()
2664 status = ocfs2_orphan_add(osb, handle, inode, di_bh, orphan_name, in ocfs2_add_inode_to_orphan()
2669 ocfs2_commit_trans(osb, handle); in ocfs2_add_inode_to_orphan()
2686 int ocfs2_del_inode_from_orphan(struct ocfs2_super *osb, in ocfs2_del_inode_from_orphan() argument
2696 orphan_dir_inode = ocfs2_get_system_file_inode(osb, in ocfs2_del_inode_from_orphan()
2714 handle = ocfs2_start_trans(osb, in ocfs2_del_inode_from_orphan()
2723 status = ocfs2_orphan_del(osb, handle, orphan_dir_inode, in ocfs2_del_inode_from_orphan()
2750 ocfs2_commit_trans(osb, handle); in ocfs2_del_inode_from_orphan()
2769 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in ocfs2_mv_orphaned_inode_to_new() local
2801 status = ocfs2_prepare_dir_for_insert(osb, dir, parent_di_bh, in ocfs2_mv_orphaned_inode_to_new()
2809 orphan_dir_inode = ocfs2_get_system_file_inode(osb, in ocfs2_mv_orphaned_inode_to_new()
2811 osb->slot_num); in ocfs2_mv_orphaned_inode_to_new()
2834 handle = ocfs2_start_trans(osb, ocfs2_rename_credits(osb->sb)); in ocfs2_mv_orphaned_inode_to_new()
2849 status = ocfs2_orphan_del(osb, handle, orphan_dir_inode, inode, in ocfs2_mv_orphaned_inode_to_new()
2882 ocfs2_commit_trans(osb, handle); in ocfs2_mv_orphaned_inode_to_new()