Lines Matching refs:osb

69 static int ocfs2_mknod_locked(struct ocfs2_super *osb,
78 static int ocfs2_prepare_orphan_dir(struct ocfs2_super *osb,
85 static int ocfs2_orphan_add(struct ocfs2_super *osb,
94 static int ocfs2_create_symlink_data(struct ocfs2_super *osb,
99 static int ocfs2_double_lock(struct ocfs2_super *osb,
220 static void ocfs2_cleanup_add_entry_failure(struct ocfs2_super *osb, in ocfs2_cleanup_add_entry_failure() argument
225 ocfs2_simple_drop_lockres(osb, &dl->dl_lockres); in ocfs2_cleanup_add_entry_failure()
243 struct ocfs2_super *osb; in ocfs2_mknod() local
269 osb = OCFS2_SB(dir->i_sb); in ocfs2_mknod()
278 if (S_ISDIR(mode) && (dir->i_nlink >= ocfs2_link_max(osb))) { in ocfs2_mknod()
296 status = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh, in ocfs2_mknod()
305 status = ocfs2_reserve_new_inode(osb, &inode_ac); in ocfs2_mknod()
340 if (S_ISDIR(mode) && !ocfs2_supports_inline_data(osb)) { in ocfs2_mknod()
344 if (ocfs2_supports_indexed_dirs(osb)) in ocfs2_mknod()
348 status = ocfs2_reserve_new_metadata_blocks(osb, want_meta, &meta_ac); in ocfs2_mknod()
355 status = ocfs2_reserve_clusters(osb, want_clusters, &data_ac); in ocfs2_mknod()
362 handle = ocfs2_start_trans(osb, ocfs2_mknod_credits(osb->sb, in ocfs2_mknod()
382 status = ocfs2_mknod_locked(osb, dir, inode, dev, in ocfs2_mknod()
391 status = ocfs2_fill_new_dir(osb, handle, dir, inode, in ocfs2_mknod()
456 ocfs2_commit_trans(osb, handle); in ocfs2_mknod()
484 ocfs2_cleanup_add_entry_failure(osb, dentry, inode); in ocfs2_mknod()
507 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in __ocfs2_mknod_locked() local
518 inode->i_ino = ino_from_blkno(osb->sb, fe_blkno); in __ocfs2_mknod_locked()
520 spin_lock(&osb->osb_lock); in __ocfs2_mknod_locked()
521 inode->i_generation = osb->s_next_generation++; in __ocfs2_mknod_locked()
522 spin_unlock(&osb->osb_lock); in __ocfs2_mknod_locked()
524 *new_fe_bh = sb_getblk(osb->sb, fe_blkno); in __ocfs2_mknod_locked()
541 memset(fe, 0, osb->sb->s_blocksize); in __ocfs2_mknod_locked()
544 fe->i_fs_generation = cpu_to_le32(osb->fs_generation); in __ocfs2_mknod_locked()
571 if (S_ISDIR(inode->i_mode) && ocfs2_supports_inline_data(osb)) { in __ocfs2_mknod_locked()
575 ocfs2_max_inline_data_with_xattr(osb->sb, fe)); in __ocfs2_mknod_locked()
580 fel->l_count = cpu_to_le16(ocfs2_extent_recs_per_inode(osb->sb)); in __ocfs2_mknod_locked()
586 ocfs2_ci_set_new(osb, INODE_CACHE(inode)); in __ocfs2_mknod_locked()
587 if (!ocfs2_mount_local(osb)) { in __ocfs2_mknod_locked()
609 static int ocfs2_mknod_locked(struct ocfs2_super *osb, in ocfs2_mknod_locked() argument
680 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in ocfs2_link() local
694 err = ocfs2_double_lock(osb, &old_dir_bh, old_dir, in ocfs2_link()
709 mlog(ML_ERROR, "%s: no old_dir_bh!\n", osb->uuid_str); in ocfs2_link()
741 err = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh, in ocfs2_link()
757 if (ocfs2_read_links_count(fe) >= ocfs2_link_max(osb)) { in ocfs2_link()
762 handle = ocfs2_start_trans(osb, ocfs2_link_credits(osb->sb)); in ocfs2_link()
807 ocfs2_commit_trans(osb, handle); in ocfs2_link()
865 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in ocfs2_unlink() local
884 if (inode == osb->root_inode) in ocfs2_unlink()
938 status = ocfs2_prepare_orphan_dir(osb, &orphan_dir, in ocfs2_unlink()
949 handle = ocfs2_start_trans(osb, ocfs2_unlink_credits(osb->sb)); in ocfs2_unlink()
992 status = ocfs2_orphan_add(osb, handle, inode, fe_bh, in ocfs2_unlink()
1000 ocfs2_commit_trans(osb, handle); in ocfs2_unlink()
1026 static int ocfs2_check_if_ancestor(struct ocfs2_super *osb, in ocfs2_check_if_ancestor() argument
1036 child_inode = ocfs2_iget(osb, child_inode_no, 0, 0); in ocfs2_check_if_ancestor()
1064 if (parent_inode_no == osb->root_inode->i_ino) { in ocfs2_check_if_ancestor()
1089 static int ocfs2_double_lock(struct ocfs2_super *osb, in ocfs2_double_lock() argument
1114 inode1_is_ancestor = ocfs2_check_if_ancestor(osb, oi2->ip_blkno, in ocfs2_double_lock()
1121 inode2_is_ancestor = ocfs2_check_if_ancestor(osb, oi1->ip_blkno, in ocfs2_double_lock()
1200 struct ocfs2_super *osb = NULL; in ocfs2_rename() local
1224 osb = OCFS2_SB(old_dir->i_sb); in ocfs2_rename()
1243 status = ocfs2_rename_lock(osb); in ocfs2_rename()
1252 status = ocfs2_check_if_ancestor(osb, new_dir->i_ino, in ocfs2_rename()
1267 status = ocfs2_double_lock(osb, &old_dir_bh, old_dir, in ocfs2_rename()
1327 new_dir->i_nlink >= ocfs2_link_max(osb)) { in ocfs2_rename()
1427 status = ocfs2_prepare_orphan_dir(osb, &orphan_dir, in ocfs2_rename()
1446 status = ocfs2_prepare_dir_for_insert(osb, new_dir, new_dir_bh, in ocfs2_rename()
1456 handle = ocfs2_start_trans(osb, ocfs2_rename_credits(osb->sb)); in ocfs2_rename()
1495 status = ocfs2_orphan_add(osb, handle, new_inode, in ocfs2_rename()
1600 ocfs2_rename_unlock(osb); in ocfs2_rename()
1603 ocfs2_commit_trans(osb, handle); in ocfs2_rename()
1648 static int ocfs2_create_symlink_data(struct ocfs2_super *osb, in ocfs2_create_symlink_data() argument
1655 struct super_block *sb = osb->sb; in ocfs2_create_symlink_data()
1752 struct ocfs2_super *osb = NULL; in ocfs2_symlink() local
1780 osb = OCFS2_SB(sb); in ocfs2_symlink()
1806 status = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh, in ocfs2_symlink()
1814 status = ocfs2_reserve_new_inode(osb, &inode_ac); in ocfs2_symlink()
1853 status = ocfs2_reserve_clusters(osb, want_clusters, &data_ac); in ocfs2_symlink()
1860 handle = ocfs2_start_trans(osb, credits + xattr_credits); in ocfs2_symlink()
1882 status = ocfs2_mknod_locked(osb, dir, inode, in ocfs2_symlink()
1898 ocfs2_clusters_to_bytes(osb->sb, 1)); in ocfs2_symlink()
1903 status = ocfs2_add_inode_data(osb, inode, &offset, 1, 0, in ocfs2_symlink()
1933 status = ocfs2_create_symlink_data(osb, handle, inode, in ocfs2_symlink()
1976 ocfs2_clusters_to_bytes(osb->sb, 1)); in ocfs2_symlink()
1980 ocfs2_commit_trans(osb, handle); in ocfs2_symlink()
1998 ocfs2_cleanup_add_entry_failure(osb, dentry, inode); in ocfs2_symlink()
2040 static int ocfs2_lookup_lock_orphan_dir(struct ocfs2_super *osb, in ocfs2_lookup_lock_orphan_dir() argument
2048 orphan_dir_inode = ocfs2_get_system_file_inode(osb, in ocfs2_lookup_lock_orphan_dir()
2050 osb->slot_num); in ocfs2_lookup_lock_orphan_dir()
2082 struct ocfs2_super *osb = OCFS2_SB(orphan_dir_inode->i_sb); in __ocfs2_prepare_orphan_dir() local
2105 ret = ocfs2_prepare_dir_for_insert(osb, orphan_dir_inode, in __ocfs2_prepare_orphan_dir()
2130 static int ocfs2_prepare_orphan_dir(struct ocfs2_super *osb, in ocfs2_prepare_orphan_dir() argument
2141 ret = ocfs2_lookup_lock_orphan_dir(osb, &orphan_dir_inode, in ocfs2_prepare_orphan_dir()
2171 static int ocfs2_orphan_add(struct ocfs2_super *osb, in ocfs2_orphan_add() argument
2243 fe->i_dio_orphaned_slot = cpu_to_le16(osb->slot_num); in ocfs2_orphan_add()
2251 fe->i_orphaned_slot = cpu_to_le16(osb->slot_num); in ocfs2_orphan_add()
2257 osb->slot_num); in ocfs2_orphan_add()
2273 int ocfs2_orphan_del(struct ocfs2_super *osb, in ocfs2_orphan_del() argument
2382 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in ocfs2_prep_new_orphaned_file() local
2387 ret = ocfs2_lookup_lock_orphan_dir(osb, &orphan_dir, &orphan_dir_bh); in ocfs2_prep_new_orphaned_file()
2394 ret = ocfs2_reserve_new_inode(osb, &inode_ac); in ocfs2_prep_new_orphaned_file()
2448 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in ocfs2_create_inode_in_orphan() local
2482 handle = ocfs2_start_trans(osb, ocfs2_mknod_credits(osb->sb, 0, 0)); in ocfs2_create_inode_in_orphan()
2515 status = ocfs2_orphan_add(osb, handle, inode, new_di_bh, orphan_name, in ocfs2_create_inode_in_orphan()
2532 ocfs2_commit_trans(osb, handle); in ocfs2_create_inode_in_orphan()
2582 int ocfs2_add_inode_to_orphan(struct ocfs2_super *osb, in ocfs2_add_inode_to_orphan() argument
2614 status = ocfs2_prepare_orphan_dir(osb, &orphan_dir_inode, in ocfs2_add_inode_to_orphan()
2624 handle = ocfs2_start_trans(osb, in ocfs2_add_inode_to_orphan()
2631 status = ocfs2_orphan_add(osb, handle, inode, di_bh, orphan_name, in ocfs2_add_inode_to_orphan()
2636 ocfs2_commit_trans(osb, handle); in ocfs2_add_inode_to_orphan()
2653 int ocfs2_del_inode_from_orphan(struct ocfs2_super *osb, in ocfs2_del_inode_from_orphan() argument
2671 orphan_dir_inode = ocfs2_get_system_file_inode(osb, in ocfs2_del_inode_from_orphan()
2689 handle = ocfs2_start_trans(osb, in ocfs2_del_inode_from_orphan()
2698 status = ocfs2_orphan_del(osb, handle, orphan_dir_inode, in ocfs2_del_inode_from_orphan()
2725 ocfs2_commit_trans(osb, handle); in ocfs2_del_inode_from_orphan()
2748 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in ocfs2_mv_orphaned_inode_to_new() local
2780 status = ocfs2_prepare_dir_for_insert(osb, dir, parent_di_bh, in ocfs2_mv_orphaned_inode_to_new()
2788 orphan_dir_inode = ocfs2_get_system_file_inode(osb, in ocfs2_mv_orphaned_inode_to_new()
2790 osb->slot_num); in ocfs2_mv_orphaned_inode_to_new()
2813 handle = ocfs2_start_trans(osb, ocfs2_rename_credits(osb->sb)); in ocfs2_mv_orphaned_inode_to_new()
2828 status = ocfs2_orphan_del(osb, handle, orphan_dir_inode, inode, in ocfs2_mv_orphaned_inode_to_new()
2861 ocfs2_commit_trans(osb, handle); in ocfs2_mv_orphaned_inode_to_new()