• Home
  • Raw
  • Download

Lines Matching refs:dip

83 typedef int (*leaf_call_t) (struct gfs2_inode *dip, u32 index, u32 len,
541 static int dirent_first(struct gfs2_inode *dip, struct buffer_head *bh, in dirent_first() argument
547 if (gfs2_meta_check(GFS2_SB(&dip->i_inode), bh)) in dirent_first()
553 if (gfs2_metatype_check(GFS2_SB(&dip->i_inode), bh, GFS2_METATYPE_DI)) in dirent_first()
561 static int dirent_check_reclen(struct gfs2_inode *dip, in dirent_check_reclen() argument
575 gfs2_consist_inode(dip); in dirent_check_reclen()
588 static int dirent_next(struct gfs2_inode *dip, struct buffer_head *bh, in dirent_next() argument
595 ret = dirent_check_reclen(dip, cur, bh_end); in dirent_next()
600 ret = dirent_check_reclen(dip, tmp, bh_end); in dirent_next()
606 gfs2_consist_inode(dip); in dirent_next()
623 static void dirent_del(struct gfs2_inode *dip, struct buffer_head *bh, in dirent_del() argument
629 gfs2_consist_inode(dip); in dirent_del()
633 gfs2_trans_add_bh(dip->i_gl, bh, 1); in dirent_del()
651 gfs2_consist_inode(dip); in dirent_del()
653 gfs2_consist_inode(dip); in dirent_del()
695 static int get_leaf(struct gfs2_inode *dip, u64 leaf_no, in get_leaf() argument
700 error = gfs2_meta_read(dip->i_gl, leaf_no, DIO_WAIT, bhp); in get_leaf()
701 if (!error && gfs2_metatype_check(GFS2_SB(&dip->i_inode), *bhp, GFS2_METATYPE_LF)) { in get_leaf()
718 static int get_leaf_nr(struct gfs2_inode *dip, u32 index, in get_leaf_nr() argument
724 error = gfs2_dir_read_data(dip, (char *)&leaf_no, in get_leaf_nr()
735 static int get_first_leaf(struct gfs2_inode *dip, u32 index, in get_first_leaf() argument
741 error = get_leaf_nr(dip, index, &leaf_no); in get_first_leaf()
743 error = get_leaf(dip, leaf_no, bh_out); in get_first_leaf()
838 struct gfs2_inode *dip = GFS2_I(inode); in dir_make_exhash() local
850 error = gfs2_meta_inode_buffer(dip, &dibh); in dir_make_exhash()
861 gfs2_assert(sdp, dip->i_entries < (1 << 16)); in dir_make_exhash()
862 leaf->lf_entries = cpu_to_be16(dip->i_entries); in dir_make_exhash()
875 dent = gfs2_dirent_scan(&dip->i_inode, bh->b_data, bh->b_size, in dir_make_exhash()
900 gfs2_trans_add_bh(dip->i_gl, dibh, 1); in dir_make_exhash()
908 dip->i_disksize = sdp->sd_sb.sb_bsize / 2; in dir_make_exhash()
909 gfs2_add_inode_blocks(&dip->i_inode, 1); in dir_make_exhash()
910 dip->i_diskflags |= GFS2_DIF_EXHASH; in dir_make_exhash()
913 dip->i_depth = y; in dir_make_exhash()
915 gfs2_dinode_out(dip, dibh->b_data); in dir_make_exhash()
933 struct gfs2_inode *dip = GFS2_I(inode); in dir_split_leaf() local
944 index = name->hash >> (32 - dip->i_depth); in dir_split_leaf()
945 error = get_leaf_nr(dip, index, &leaf_no); in dir_split_leaf()
950 error = get_leaf(dip, leaf_no, &obh); in dir_split_leaf()
955 if (dip->i_depth == be16_to_cpu(oleaf->lf_depth)) { in dir_split_leaf()
960 gfs2_trans_add_bh(dip->i_gl, obh, 1); in dir_split_leaf()
970 len = 1 << (dip->i_depth - be16_to_cpu(oleaf->lf_depth)); in dir_split_leaf()
973 …printk(KERN_WARNING "i_depth %u lf_depth %u index %u\n", dip->i_depth, be16_to_cpu(oleaf->lf_depth… in dir_split_leaf()
974 gfs2_consist_inode(dip); in dir_split_leaf()
989 error = gfs2_dir_write_data(dip, (char *)lp, start * sizeof(u64), in dir_split_leaf()
1000 divider = (start + half_len) << (32 - dip->i_depth); in dir_split_leaf()
1003 dirent_first(dip, obh, &dent); in dir_split_leaf()
1007 if (dirent_next(dip, obh, &next)) in dir_split_leaf()
1026 dirent_del(dip, obh, prev, dent); in dir_split_leaf()
1029 gfs2_consist_inode(dip); in dir_split_leaf()
1044 error = gfs2_meta_inode_buffer(dip, &dibh); in dir_split_leaf()
1045 if (!gfs2_assert_withdraw(GFS2_SB(&dip->i_inode), !error)) { in dir_split_leaf()
1046 gfs2_trans_add_bh(dip->i_gl, dibh, 1); in dir_split_leaf()
1047 gfs2_add_inode_blocks(&dip->i_inode, 1); in dir_split_leaf()
1048 gfs2_dinode_out(dip, dibh->b_data); in dir_split_leaf()
1073 static int dir_double_exhash(struct gfs2_inode *dip) in dir_double_exhash() argument
1075 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); in dir_double_exhash()
1084 hsize = 1 << dip->i_depth; in dir_double_exhash()
1085 if (hsize * sizeof(u64) != dip->i_disksize) { in dir_double_exhash()
1086 gfs2_consist_inode(dip); in dir_double_exhash()
1094 for (block = dip->i_disksize >> sdp->sd_hash_bsize_shift; block--;) { in dir_double_exhash()
1095 error = gfs2_dir_read_data(dip, (char *)buf, in dir_double_exhash()
1112 error = gfs2_dir_write_data(dip, in dir_double_exhash()
1125 error = gfs2_meta_inode_buffer(dip, &dibh); in dir_double_exhash()
1127 dip->i_depth++; in dir_double_exhash()
1128 gfs2_dinode_out(dip, dibh->b_data); in dir_double_exhash()
1199 static int do_filldir_main(struct gfs2_inode *dip, u64 *offset, in do_filldir_main() argument
1362 struct gfs2_inode *dip = GFS2_I(inode); in dir_e_read() local
1372 hsize = 1 << dip->i_depth; in dir_e_read()
1373 if (hsize * sizeof(u64) != dip->i_disksize) { in dir_e_read()
1374 gfs2_consist_inode(dip); in dir_e_read()
1379 index = hash >> (32 - dip->i_depth); in dir_e_read()
1390 error = gfs2_dir_read_data(dip, (char *)lp, in dir_e_read()
1407 len = 1 << (dip->i_depth - depth); in dir_e_read()
1421 struct gfs2_inode *dip = GFS2_I(inode); in gfs2_dir_read() local
1429 if (!dip->i_entries) in gfs2_dir_read()
1432 if (dip->i_diskflags & GFS2_DIF_EXHASH) in gfs2_dir_read()
1435 if (!gfs2_is_stuffed(dip)) { in gfs2_dir_read()
1436 gfs2_consist_inode(dip); in gfs2_dir_read()
1440 error = gfs2_meta_inode_buffer(dip, &dibh); in gfs2_dir_read()
1456 if (dip->i_entries != g.offset) { in gfs2_dir_read()
1459 (unsigned long long)dip->i_no_addr, in gfs2_dir_read()
1460 dip->i_entries, in gfs2_dir_read()
1465 error = do_filldir_main(dip, offset, opaque, filldir, darr, in gfs2_dir_read()
1466 dip->i_entries, &copied); in gfs2_dir_read()
1670 int gfs2_dir_del(struct gfs2_inode *dip, const struct qstr *name) in gfs2_dir_del() argument
1678 dent = gfs2_dirent_search(&dip->i_inode, name, gfs2_dirent_prev, &bh); in gfs2_dir_del()
1680 gfs2_consist_inode(dip); in gfs2_dir_del()
1684 gfs2_consist_inode(dip); in gfs2_dir_del()
1693 dirent_del(dip, bh, prev, dent); in gfs2_dir_del()
1694 if (dip->i_diskflags & GFS2_DIF_EXHASH) { in gfs2_dir_del()
1698 gfs2_consist_inode(dip); in gfs2_dir_del()
1703 error = gfs2_meta_inode_buffer(dip, &bh); in gfs2_dir_del()
1707 if (!dip->i_entries) in gfs2_dir_del()
1708 gfs2_consist_inode(dip); in gfs2_dir_del()
1709 gfs2_trans_add_bh(dip->i_gl, bh, 1); in gfs2_dir_del()
1710 dip->i_entries--; in gfs2_dir_del()
1711 dip->i_inode.i_mtime = dip->i_inode.i_ctime = CURRENT_TIME; in gfs2_dir_del()
1712 gfs2_dinode_out(dip, bh->b_data); in gfs2_dir_del()
1714 mark_inode_dirty(&dip->i_inode); in gfs2_dir_del()
1732 int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename, in gfs2_dir_mvino() argument
1739 dent = gfs2_dirent_search(&dip->i_inode, filename, gfs2_dirent_find, &bh); in gfs2_dir_mvino()
1741 gfs2_consist_inode(dip); in gfs2_dir_mvino()
1747 gfs2_trans_add_bh(dip->i_gl, bh, 1); in gfs2_dir_mvino()
1751 if (dip->i_diskflags & GFS2_DIF_EXHASH) { in gfs2_dir_mvino()
1753 error = gfs2_meta_inode_buffer(dip, &bh); in gfs2_dir_mvino()
1756 gfs2_trans_add_bh(dip->i_gl, bh, 1); in gfs2_dir_mvino()
1759 dip->i_inode.i_mtime = dip->i_inode.i_ctime = CURRENT_TIME; in gfs2_dir_mvino()
1760 gfs2_dinode_out(dip, bh->b_data); in gfs2_dir_mvino()
1774 static int foreach_leaf(struct gfs2_inode *dip, leaf_call_t lc, void *data) in foreach_leaf() argument
1776 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); in foreach_leaf()
1786 hsize = 1 << dip->i_depth; in foreach_leaf()
1787 if (hsize * sizeof(u64) != dip->i_disksize) { in foreach_leaf()
1788 gfs2_consist_inode(dip); in foreach_leaf()
1801 error = gfs2_dir_read_data(dip, (char *)lp, in foreach_leaf()
1814 error = get_leaf(dip, leaf_no, &bh); in foreach_leaf()
1818 len = 1 << (dip->i_depth - be16_to_cpu(leaf->lf_depth)); in foreach_leaf()
1821 error = lc(dip, index, len, leaf_no, data); in foreach_leaf()
1831 gfs2_consist_inode(dip); in foreach_leaf()
1852 static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len, in leaf_dealloc() argument
1855 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); in leaf_dealloc()
1871 if (!gfs2_alloc_get(dip)) { in leaf_dealloc()
1876 error = gfs2_quota_hold(dip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); in leaf_dealloc()
1880 error = gfs2_rindex_hold(sdp, &dip->i_alloc->al_ri_gh); in leaf_dealloc()
1887 error = get_leaf(dip, blk, &bh); in leaf_dealloc()
1917 error = get_leaf(dip, blk, &bh); in leaf_dealloc()
1924 gfs2_free_meta(dip, blk, 1); in leaf_dealloc()
1925 gfs2_add_inode_blocks(&dip->i_inode, -1); in leaf_dealloc()
1928 error = gfs2_dir_write_data(dip, ht, index * sizeof(u64), size); in leaf_dealloc()
1935 error = gfs2_meta_inode_buffer(dip, &dibh); in leaf_dealloc()
1939 gfs2_trans_add_bh(dip->i_gl, dibh, 1); in leaf_dealloc()
1940 gfs2_dinode_out(dip, dibh->b_data); in leaf_dealloc()
1949 gfs2_glock_dq_uninit(&dip->i_alloc->al_ri_gh); in leaf_dealloc()
1951 gfs2_quota_unhold(dip); in leaf_dealloc()
1953 gfs2_alloc_put(dip); in leaf_dealloc()
1969 int gfs2_dir_exhash_dealloc(struct gfs2_inode *dip) in gfs2_dir_exhash_dealloc() argument
1971 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); in gfs2_dir_exhash_dealloc()
1976 error = foreach_leaf(dip, leaf_dealloc, NULL); in gfs2_dir_exhash_dealloc()
1987 error = gfs2_meta_inode_buffer(dip, &bh); in gfs2_dir_exhash_dealloc()
1989 gfs2_trans_add_bh(dip->i_gl, bh, 1); in gfs2_dir_exhash_dealloc()