Lines Matching refs:dp
75 static int xfs_dir_isempty(struct xfs_inode *dp);
82 struct xfs_inode *dp,
91 struct xfs_inode *dp,
97 struct xfs_inode *dp,
106 struct xfs_inode *dp,
111 struct xfs_inode *dp,
120 struct xfs_inode *dp,
147 STATIC int xfs_dir_leaf_getdents(xfs_trans_t *trans, xfs_inode_t *dp,
159 STATIC int xfs_dir_node_getdents(xfs_trans_t *trans, xfs_inode_t *dp,
215 xfs_dir_isempty(xfs_inode_t *dp) in xfs_dir_isempty() argument
219 ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR); in xfs_dir_isempty()
220 if (dp->i_d.di_size == 0) in xfs_dir_isempty()
222 if (dp->i_d.di_size > XFS_IFORK_DSIZE(dp)) in xfs_dir_isempty()
224 hdr = (xfs_dir_sf_hdr_t *)dp->i_df.if_u1.if_data; in xfs_dir_isempty()
238 args.dp = dir; in xfs_dir_init()
253 xfs_dir_createname(xfs_trans_t *trans, xfs_inode_t *dp, char *name, in xfs_dir_createname() argument
260 ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR); in xfs_dir_createname()
273 args.dp = dp; in xfs_dir_createname()
286 if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL) { in xfs_dir_createname()
288 if ((dp->i_d.di_size + newsize) <= XFS_IFORK_DSIZE(dp)) { in xfs_dir_createname()
298 if (!done && xfs_bmap_one_block(dp, XFS_DATA_FORK)) { in xfs_dir_createname()
319 xfs_dir_canenter(xfs_trans_t *trans, xfs_inode_t *dp, char *name, int namelen) in xfs_dir_canenter() argument
324 ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR); in xfs_dir_canenter()
332 args.dp = dp; in xfs_dir_canenter()
343 if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL) { in xfs_dir_canenter()
345 if ((dp->i_d.di_size + newsize) <= XFS_IFORK_DSIZE(dp)) in xfs_dir_canenter()
349 } else if (xfs_bmap_one_block(dp, XFS_DATA_FORK)) { in xfs_dir_canenter()
362 xfs_dir_removename(xfs_trans_t *trans, xfs_inode_t *dp, char *name, in xfs_dir_removename() argument
369 ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR); in xfs_dir_removename()
378 args.dp = dp; in xfs_dir_removename()
389 if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL) { in xfs_dir_removename()
391 } else if (xfs_bmap_one_block(dp, XFS_DATA_FORK)) { in xfs_dir_removename()
395 if (newsize <= XFS_IFORK_DSIZE(dp)) { in xfs_dir_removename()
406 xfs_dir_lookup(xfs_trans_t *trans, xfs_inode_t *dp, char *name, int namelen, in xfs_dir_lookup() argument
412 ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR); in xfs_dir_lookup()
422 args.dp = dp; in xfs_dir_lookup()
434 if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL) { in xfs_dir_lookup()
436 } else if (xfs_bmap_one_block(dp, XFS_DATA_FORK)) { in xfs_dir_lookup()
451 xfs_dir_getdents(xfs_trans_t *trans, xfs_inode_t *dp, uio_t *uio, int *eofp) in xfs_dir_getdents() argument
458 ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR); in xfs_dir_getdents()
481 if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL) { in xfs_dir_getdents()
482 retval = xfs_dir_shortform_getdents(dp, uio, eofp, dbp, put); in xfs_dir_getdents()
483 } else if (xfs_bmap_one_block(dp, XFS_DATA_FORK)) { in xfs_dir_getdents()
484 retval = xfs_dir_leaf_getdents(trans, dp, uio, eofp, dbp, put); in xfs_dir_getdents()
486 retval = xfs_dir_node_getdents(trans, dp, uio, eofp, dbp, put); in xfs_dir_getdents()
495 xfs_dir_replace(xfs_trans_t *trans, xfs_inode_t *dp, char *name, int namelen, in xfs_dir_replace() argument
502 ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR); in xfs_dir_replace()
514 args.dp = dp; in xfs_dir_replace()
525 if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL) { in xfs_dir_replace()
527 } else if (xfs_bmap_one_block(dp, XFS_DATA_FORK)) { in xfs_dir_replace()
537 xfs_dir_shortform_validate_ondisk(xfs_mount_t *mp, xfs_dinode_t *dp) in xfs_dir_shortform_validate_ondisk() argument
548 if ((INT_GET(dp->di_core.di_mode, ARCH_CONVERT) & S_IFMT) != S_IFDIR) { in xfs_dir_shortform_validate_ondisk()
551 if (INT_GET(dp->di_core.di_format, ARCH_CONVERT) != XFS_DINODE_FMT_LOCAL) { in xfs_dir_shortform_validate_ondisk()
554 if (INT_GET(dp->di_core.di_size, ARCH_CONVERT) < sizeof(sf->hdr)) { in xfs_dir_shortform_validate_ondisk()
556 dp); in xfs_dir_shortform_validate_ondisk()
559 sf = (xfs_dir_shortform_t *)(&dp->di_u.di_dirsf); in xfs_dir_shortform_validate_ondisk()
567 "Invalid shortform count: dp 0x%p", dp); in xfs_dir_shortform_validate_ondisk()
582 "Invalid shortform namelen: dp 0x%p", dp); in xfs_dir_shortform_validate_ondisk()
590 "Invalid shortform namelen: dp 0x%p", dp); in xfs_dir_shortform_validate_ondisk()
611 retval = xfs_da_read_buf(args->trans, args->dp, 0, -1, &bp, in xfs_dir_leaf_addname()
635 retval = xfs_da_read_buf(args->trans, args->dp, 0, -1, &bp, in xfs_dir_leaf_removename()
663 retval = xfs_da_read_buf(args->trans, args->dp, 0, -1, &bp, in xfs_dir_leaf_lookup()
677 xfs_dir_leaf_getdents(xfs_trans_t *trans, xfs_inode_t *dp, uio_t *uio, in xfs_dir_leaf_getdents() argument
683 retval = xfs_da_read_buf(dp->i_transp, dp, 0, -1, &bp, XFS_DATA_FORK); in xfs_dir_leaf_getdents()
687 retval = xfs_dir_leaf_getdents_int(bp, dp, 0, uio, &eob, dbp, put, -1); in xfs_dir_leaf_getdents()
708 retval = xfs_da_read_buf(args->trans, args->dp, 0, -1, &bp, in xfs_dir_leaf_replace()
753 state->mp = args->dp->i_mount; in xfs_dir_node_addname()
807 state->mp = args->dp->i_mount; in xfs_dir_node_removename()
856 state->mp = args->dp->i_mount; in xfs_dir_node_lookup()
882 xfs_dir_node_getdents(xfs_trans_t *trans, xfs_inode_t *dp, uio_t *uio, in xfs_dir_node_getdents() argument
898 mp = dp->i_mount; in xfs_dir_node_getdents()
903 xfs_dir_trace_g_du("node: start", dp, uio); in xfs_dir_node_getdents()
914 error = xfs_da_read_buf(trans, dp, bno, -2, &bp, XFS_DATA_FORK); in xfs_dir_node_getdents()
921 dp, uio, bno); in xfs_dir_node_getdents()
927 dp, uio, bno); in xfs_dir_node_getdents()
934 dp, uio, bno); in xfs_dir_node_getdents()
946 xfs_dir_trace_g_du("node: start at root" , dp, uio); in xfs_dir_node_getdents()
949 error = xfs_da_read_buf(trans, dp, bno, -1, &bp, in xfs_dir_node_getdents()
959 xfs_dir_trace_g_dun("node: node detail", dp, uio, node); in xfs_dir_node_getdents()
969 dp, uio); in xfs_dir_node_getdents()
976 dp, uio, bno); in xfs_dir_node_getdents()
990 xfs_dir_trace_g_dul("node: not a leaf", dp, uio, leaf); in xfs_dir_node_getdents()
996 xfs_dir_trace_g_dul("node: leaf detail", dp, uio, leaf); in xfs_dir_node_getdents()
998 nextda = xfs_da_reada_buf(trans, dp, nextbno, in xfs_dir_node_getdents()
1002 error = xfs_dir_leaf_getdents_int(bp, dp, bno, uio, &eob, dbp, in xfs_dir_node_getdents()
1007 xfs_dir_trace_g_dub("node: E-O-B", dp, uio, bno); in xfs_dir_node_getdents()
1013 error = xfs_da_read_buf(trans, dp, bno, nextda, &bp, in xfs_dir_node_getdents()
1024 xfs_dir_trace_g_du("node: E-O-F", dp, uio); in xfs_dir_node_getdents()
1046 state->mp = args->dp->i_mount; in xfs_dir_node_replace()
1093 xfs_dir_trace_g_du(char *where, xfs_inode_t *dp, uio_t *uio) in xfs_dir_trace_g_du() argument
1096 (void *)dp, (void *)dp->i_mount, in xfs_dir_trace_g_du()
1107 xfs_dir_trace_g_dub(char *where, xfs_inode_t *dp, uio_t *uio, xfs_dablk_t bno) in xfs_dir_trace_g_dub() argument
1110 (void *)dp, (void *)dp->i_mount, in xfs_dir_trace_g_dub()
1122 xfs_dir_trace_g_dun(char *where, xfs_inode_t *dp, uio_t *uio, in xfs_dir_trace_g_dun() argument
1128 (void *)dp, (void *)dp->i_mount, in xfs_dir_trace_g_dun()
1147 xfs_dir_trace_g_dul(char *where, xfs_inode_t *dp, uio_t *uio, in xfs_dir_trace_g_dul() argument
1153 (void *)dp, (void *)dp->i_mount, in xfs_dir_trace_g_dul()
1172 xfs_dir_trace_g_due(char *where, xfs_inode_t *dp, uio_t *uio, in xfs_dir_trace_g_due() argument
1176 (void *)dp, (void *)dp->i_mount, in xfs_dir_trace_g_due()
1189 xfs_dir_trace_g_duc(char *where, xfs_inode_t *dp, uio_t *uio, xfs_off_t cookie) in xfs_dir_trace_g_duc() argument
1192 (void *)dp, (void *)dp->i_mount, in xfs_dir_trace_g_duc()