Lines Matching refs:dip

607 static int dirent_check_reclen(struct gfs2_inode *dip,  in dirent_check_reclen()  argument
614 gfs2_consist_inode(dip); in dirent_check_reclen()
623 gfs2_consist_inode(dip); in dirent_check_reclen()
636 static int dirent_next(struct gfs2_inode *dip, struct buffer_head *bh, in dirent_next() argument
643 ret = dirent_check_reclen(dip, cur, bh_end); in dirent_next()
648 ret = dirent_check_reclen(dip, tmp, bh_end); in dirent_next()
654 gfs2_consist_inode(dip); in dirent_next()
671 static void dirent_del(struct gfs2_inode *dip, struct buffer_head *bh, in dirent_del() argument
677 gfs2_consist_inode(dip); in dirent_del()
681 gfs2_trans_add_meta(dip->i_gl, bh); in dirent_del()
699 gfs2_consist_inode(dip); in dirent_del()
701 gfs2_consist_inode(dip); in dirent_del()
758 static int get_leaf(struct gfs2_inode *dip, u64 leaf_no, in get_leaf() argument
763 error = gfs2_meta_read(dip->i_gl, leaf_no, DIO_WAIT, 0, bhp); in get_leaf()
764 if (!error && gfs2_metatype_check(GFS2_SB(&dip->i_inode), *bhp, GFS2_METATYPE_LF)) { in get_leaf()
781 static int get_leaf_nr(struct gfs2_inode *dip, u32 index, u64 *leaf_out) in get_leaf_nr() argument
786 hash = gfs2_dir_get_hash_table(dip); in get_leaf_nr()
795 static int get_first_leaf(struct gfs2_inode *dip, u32 index, in get_first_leaf() argument
801 error = get_leaf_nr(dip, index, &leaf_no); in get_first_leaf()
803 error = get_leaf(dip, leaf_no, bh_out); in get_first_leaf()
909 struct gfs2_inode *dip = GFS2_I(inode); in dir_make_exhash() local
921 error = gfs2_meta_inode_buffer(dip, &dibh); in dir_make_exhash()
932 gfs2_assert(sdp, dip->i_entries < BIT(16)); in dir_make_exhash()
933 leaf->lf_entries = cpu_to_be16(dip->i_entries); in dir_make_exhash()
946 dent = gfs2_dirent_scan(&dip->i_inode, bh->b_data, bh->b_size, in dir_make_exhash()
971 gfs2_trans_add_meta(dip->i_gl, dibh); in dir_make_exhash()
980 gfs2_add_inode_blocks(&dip->i_inode, 1); in dir_make_exhash()
981 dip->i_diskflags |= GFS2_DIF_EXHASH; in dir_make_exhash()
984 dip->i_depth = y; in dir_make_exhash()
986 gfs2_dinode_out(dip, dibh->b_data); in dir_make_exhash()
1003 struct gfs2_inode *dip = GFS2_I(inode); in dir_split_leaf() local
1014 index = name->hash >> (32 - dip->i_depth); in dir_split_leaf()
1015 error = get_leaf_nr(dip, index, &leaf_no); in dir_split_leaf()
1020 error = get_leaf(dip, leaf_no, &obh); in dir_split_leaf()
1025 if (dip->i_depth == be16_to_cpu(oleaf->lf_depth)) { in dir_split_leaf()
1030 gfs2_trans_add_meta(dip->i_gl, obh); in dir_split_leaf()
1040 len = BIT(dip->i_depth - be16_to_cpu(oleaf->lf_depth)); in dir_split_leaf()
1044 dip->i_depth, be16_to_cpu(oleaf->lf_depth), index); in dir_split_leaf()
1045 gfs2_consist_inode(dip); in dir_split_leaf()
1065 gfs2_dir_hash_inval(dip); in dir_split_leaf()
1067 error = gfs2_dir_write_data(dip, (char *)lp, start * sizeof(u64), in dir_split_leaf()
1078 divider = (start + half_len) << (32 - dip->i_depth); in dir_split_leaf()
1085 if (dirent_next(dip, obh, &next)) in dir_split_leaf()
1105 dirent_del(dip, obh, prev, dent); in dir_split_leaf()
1108 gfs2_consist_inode(dip); in dir_split_leaf()
1121 error = gfs2_meta_inode_buffer(dip, &dibh); in dir_split_leaf()
1122 if (!gfs2_assert_withdraw(GFS2_SB(&dip->i_inode), !error)) { in dir_split_leaf()
1123 gfs2_trans_add_meta(dip->i_gl, dibh); in dir_split_leaf()
1124 gfs2_add_inode_blocks(&dip->i_inode, 1); in dir_split_leaf()
1125 gfs2_dinode_out(dip, dibh->b_data); in dir_split_leaf()
1150 static int dir_double_exhash(struct gfs2_inode *dip) in dir_double_exhash() argument
1160 hsize = BIT(dip->i_depth); in dir_double_exhash()
1163 hc = gfs2_dir_get_hash_table(dip); in dir_double_exhash()
1175 error = gfs2_meta_inode_buffer(dip, &dibh); in dir_double_exhash()
1185 error = gfs2_dir_write_data(dip, (char *)hc2, 0, hsize_bytes * 2); in dir_double_exhash()
1189 gfs2_dir_hash_inval(dip); in dir_double_exhash()
1190 dip->i_hash_cache = hc2; in dir_double_exhash()
1191 dip->i_depth++; in dir_double_exhash()
1192 gfs2_dinode_out(dip, dibh->b_data); in dir_double_exhash()
1198 gfs2_dir_write_data(dip, (char *)hc, 0, hsize_bytes); in dir_double_exhash()
1199 i_size_write(&dip->i_inode, hsize_bytes); in dir_double_exhash()
1200 gfs2_dinode_out(dip, dibh->b_data); in dir_double_exhash()
1266 static int do_filldir_main(struct gfs2_inode *dip, struct dir_context *ctx, in do_filldir_main() argument
1534 struct gfs2_inode *dip = GFS2_I(inode); in dir_e_read() local
1542 hsize = BIT(dip->i_depth); in dir_e_read()
1544 index = hash >> (32 - dip->i_depth); in dir_e_read()
1546 if (dip->i_hash_cache == NULL) in dir_e_read()
1548 lp = gfs2_dir_get_hash_table(dip); in dir_e_read()
1561 len = BIT(dip->i_depth - depth); in dir_e_read()
1573 struct gfs2_inode *dip = GFS2_I(inode); in gfs2_dir_read() local
1581 if (!dip->i_entries) in gfs2_dir_read()
1584 if (dip->i_diskflags & GFS2_DIF_EXHASH) in gfs2_dir_read()
1587 if (!gfs2_is_stuffed(dip)) { in gfs2_dir_read()
1588 gfs2_consist_inode(dip); in gfs2_dir_read()
1592 error = gfs2_meta_inode_buffer(dip, &dibh); in gfs2_dir_read()
1608 if (dip->i_entries != g.offset) { in gfs2_dir_read()
1611 (unsigned long long)dip->i_no_addr, in gfs2_dir_read()
1612 dip->i_entries, in gfs2_dir_read()
1614 gfs2_consist_inode(dip); in gfs2_dir_read()
1618 gfs2_set_cookies(sdp, dibh, 0, darr, dip->i_entries); in gfs2_dir_read()
1619 error = do_filldir_main(dip, ctx, darr, in gfs2_dir_read()
1620 dip->i_entries, 0, &copied); in gfs2_dir_read()
1877 int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry) in gfs2_dir_del() argument
1886 dent = gfs2_dirent_search(&dip->i_inode, name, gfs2_dirent_prev, &bh); in gfs2_dir_del()
1888 gfs2_consist_inode(dip); in gfs2_dir_del()
1892 gfs2_consist_inode(dip); in gfs2_dir_del()
1901 dirent_del(dip, bh, prev, dent); in gfs2_dir_del()
1902 tv = inode_set_ctime_current(&dip->i_inode); in gfs2_dir_del()
1903 if (dip->i_diskflags & GFS2_DIF_EXHASH) { in gfs2_dir_del()
1907 gfs2_consist_inode(dip); in gfs2_dir_del()
1914 if (!dip->i_entries) in gfs2_dir_del()
1915 gfs2_consist_inode(dip); in gfs2_dir_del()
1916 dip->i_entries--; in gfs2_dir_del()
1917 inode_set_mtime_to_ts(&dip->i_inode, tv); in gfs2_dir_del()
1919 drop_nlink(&dip->i_inode); in gfs2_dir_del()
1920 mark_inode_dirty(&dip->i_inode); in gfs2_dir_del()
1939 int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename, in gfs2_dir_mvino() argument
1945 dent = gfs2_dirent_search(&dip->i_inode, filename, gfs2_dirent_find, &bh); in gfs2_dir_mvino()
1947 gfs2_consist_inode(dip); in gfs2_dir_mvino()
1953 gfs2_trans_add_meta(dip->i_gl, bh); in gfs2_dir_mvino()
1958 inode_set_mtime_to_ts(&dip->i_inode, inode_set_ctime_current(&dip->i_inode)); in gfs2_dir_mvino()
1959 mark_inode_dirty_sync(&dip->i_inode); in gfs2_dir_mvino()
1975 static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len, in leaf_dealloc() argument
1979 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); in leaf_dealloc()
2001 error = gfs2_quota_hold(dip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE); in leaf_dealloc()
2010 error = get_leaf(dip, blk, &bh); in leaf_dealloc()
2019 gfs2_rlist_add(dip, &rlist, blk); in leaf_dealloc()
2048 error = get_leaf(dip, blk, &bh); in leaf_dealloc()
2058 gfs2_free_meta(dip, rgd, blk, 1); in leaf_dealloc()
2059 gfs2_add_inode_blocks(&dip->i_inode, -1); in leaf_dealloc()
2062 error = gfs2_dir_write_data(dip, ht, index * sizeof(u64), size); in leaf_dealloc()
2069 error = gfs2_meta_inode_buffer(dip, &dibh); in leaf_dealloc()
2073 gfs2_trans_add_meta(dip->i_gl, dibh); in leaf_dealloc()
2077 dip->i_inode.i_mode = S_IFREG; in leaf_dealloc()
2078 gfs2_dinode_out(dip, dibh->b_data); in leaf_dealloc()
2087 gfs2_quota_unhold(dip); in leaf_dealloc()
2103 int gfs2_dir_exhash_dealloc(struct gfs2_inode *dip) in gfs2_dir_exhash_dealloc() argument
2113 hsize = BIT(dip->i_depth); in gfs2_dir_exhash_dealloc()
2115 lp = gfs2_dir_get_hash_table(dip); in gfs2_dir_exhash_dealloc()
2122 error = get_leaf(dip, leaf_no, &bh); in gfs2_dir_exhash_dealloc()
2126 len = BIT(dip->i_depth - be16_to_cpu(leaf->lf_depth)); in gfs2_dir_exhash_dealloc()
2130 error = leaf_dealloc(dip, index, len, leaf_no, bh, in gfs2_dir_exhash_dealloc()
2141 gfs2_consist_inode(dip); in gfs2_dir_exhash_dealloc()