Lines Matching refs:args

45 STATIC int xfs_attr_shortform_addname(xfs_da_args_t *args);
50 STATIC int xfs_attr_leaf_get(xfs_da_args_t *args);
51 STATIC int xfs_attr_leaf_removename(xfs_da_args_t *args);
52 STATIC int xfs_attr_leaf_hasname(struct xfs_da_args *args, struct xfs_buf **bp);
53 STATIC int xfs_attr_leaf_try_add(struct xfs_da_args *args);
58 STATIC int xfs_attr_node_get(xfs_da_args_t *args);
59 STATIC void xfs_attr_restore_rmt_blk(struct xfs_da_args *args);
63 STATIC int xfs_attr_node_lookup(struct xfs_da_args *args,
125 trace_xfs_attr_fillstate(state->args);
173 trace_xfs_attr_refillstate(state->args);
183 error = xfs_da3_node_read_mapped(state->args->trans,
184 state->args->dp, blk->disk_blkno,
201 error = xfs_da3_node_read_mapped(state->args->trans,
202 state->args->dp, blk->disk_blkno,
227 struct xfs_da_args *args) in xfs_attr_get_ilocked() argument
229 ASSERT(xfs_isilocked(args->dp, XFS_ILOCK_SHARED | XFS_ILOCK_EXCL)); in xfs_attr_get_ilocked()
231 if (!xfs_inode_hasattr(args->dp)) in xfs_attr_get_ilocked()
234 if (args->dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL) in xfs_attr_get_ilocked()
235 return xfs_attr_shortform_getvalue(args); in xfs_attr_get_ilocked()
236 if (xfs_attr_is_leaf(args->dp)) in xfs_attr_get_ilocked()
237 return xfs_attr_leaf_get(args); in xfs_attr_get_ilocked()
238 return xfs_attr_node_get(args); in xfs_attr_get_ilocked()
259 struct xfs_da_args *args) in xfs_attr_get() argument
264 XFS_STATS_INC(args->dp->i_mount, xs_attr_get); in xfs_attr_get()
266 if (xfs_is_shutdown(args->dp->i_mount)) in xfs_attr_get()
269 args->geo = args->dp->i_mount->m_attr_geo; in xfs_attr_get()
270 args->whichfork = XFS_ATTR_FORK; in xfs_attr_get()
271 args->hashval = xfs_da_hashname(args->name, args->namelen); in xfs_attr_get()
274 args->op_flags = XFS_DA_OP_OKNOENT; in xfs_attr_get()
276 lock_mode = xfs_ilock_attr_map_shared(args->dp); in xfs_attr_get()
277 error = xfs_attr_get_ilocked(args); in xfs_attr_get()
278 xfs_iunlock(args->dp, lock_mode); in xfs_attr_get()
288 struct xfs_da_args *args, in xfs_attr_calc_size() argument
291 struct xfs_mount *mp = args->dp->i_mount; in xfs_attr_calc_size()
299 size = xfs_attr_leaf_newentsize(args, local); in xfs_attr_calc_size()
302 if (size > (args->geo->blksize / 2)) { in xfs_attr_calc_size()
311 uint dblocks = xfs_attr3_rmt_blocks(mp, args->valuelen); in xfs_attr_calc_size()
322 struct xfs_da_args *args, in xfs_init_attr_trans() argument
326 struct xfs_mount *mp = args->dp->i_mount; in xfs_init_attr_trans()
328 if (args->value) { in xfs_init_attr_trans()
331 args->total; in xfs_init_attr_trans()
334 *total = args->total; in xfs_init_attr_trans()
349 struct xfs_da_args *args) in xfs_attr_try_sf_addname() argument
358 xfs_attr_shortform_create(args); in xfs_attr_try_sf_addname()
360 error = xfs_attr_shortform_addname(args); in xfs_attr_try_sf_addname()
368 if (!error && !(args->op_flags & XFS_DA_OP_NOTIME)) in xfs_attr_try_sf_addname()
369 xfs_trans_ichgtime(args->trans, dp, XFS_ICHGTIME_CHG); in xfs_attr_try_sf_addname()
372 xfs_trans_set_sync(args->trans); in xfs_attr_try_sf_addname()
381 struct xfs_da_args *args = attr->xattri_da_args; in xfs_attr_sf_addname() local
382 struct xfs_inode *dp = args->dp; in xfs_attr_sf_addname()
385 error = xfs_attr_try_sf_addname(dp, args); in xfs_attr_sf_addname()
396 error = xfs_attr_shortform_to_leaf(args); in xfs_attr_sf_addname()
402 trace_xfs_attr_sf_addname_return(attr->xattri_dela_state, args->dp); in xfs_attr_sf_addname()
422 struct xfs_da_args *args = attr->xattri_da_args; in xfs_attr_complete_op() local
423 bool do_replace = args->op_flags & XFS_DA_OP_REPLACE; in xfs_attr_complete_op()
425 args->op_flags &= ~XFS_DA_OP_REPLACE; in xfs_attr_complete_op()
427 args->attr_filter &= ~XFS_ATTR_INCOMPLETE; in xfs_attr_complete_op()
437 struct xfs_da_args *args = attr->xattri_da_args; in xfs_attr_leaf_addname() local
440 ASSERT(xfs_attr_is_leaf(args->dp)); in xfs_attr_leaf_addname()
446 error = xfs_attr_leaf_try_add(args); in xfs_attr_leaf_addname()
449 error = xfs_attr3_leaf_to_node(args); in xfs_attr_leaf_addname()
468 if (args->rmtblkno) in xfs_attr_leaf_addname()
474 trace_xfs_attr_leaf_addname_return(attr->xattri_dela_state, args->dp); in xfs_attr_leaf_addname()
489 struct xfs_da_args *args = attr->xattri_da_args; in xfs_attr_node_addname() local
498 error = xfs_attr3_leaf_to_node(args); in xfs_attr_node_addname()
510 if (args->rmtblkno) in xfs_attr_node_addname()
516 trace_xfs_attr_node_addname_return(attr->xattri_dela_state, args->dp); in xfs_attr_node_addname()
524 struct xfs_da_args *args = attr->xattri_da_args; in xfs_attr_rmtval_alloc() local
542 error = xfs_attr_rmtval_set_value(args); in xfs_attr_rmtval_alloc()
554 error = xfs_attr3_leaf_clearflag(args); in xfs_attr_rmtval_alloc()
556 trace_xfs_attr_rmtval_alloc(attr->xattri_dela_state, args->dp); in xfs_attr_rmtval_alloc()
566 struct xfs_da_args *args, in xfs_attr_leaf_mark_incomplete() argument
583 return xfs_attr3_leaf_setflag(args); in xfs_attr_leaf_mark_incomplete()
591 struct xfs_da_args *args = attr->xattri_da_args; in xfs_attr_item_init_da_state() local
594 attr->xattri_da_state = xfs_da_state_alloc(args); in xfs_attr_item_init_da_state()
596 xfs_da_state_reset(attr->xattri_da_state, args); in xfs_attr_item_init_da_state()
608 struct xfs_da_args *args = attr->xattri_da_args; in xfs_attr_node_removename_setup() local
613 error = xfs_attr_node_lookup(args, attr->xattri_da_state); in xfs_attr_node_removename_setup()
623 error = xfs_attr_leaf_mark_incomplete(args, state); in xfs_attr_node_removename_setup()
626 if (args->rmtblkno > 0) in xfs_attr_node_removename_setup()
627 error = xfs_attr_rmtval_invalidate(args); in xfs_attr_node_removename_setup()
646 struct xfs_da_args *args = attr->xattri_da_args; in xfs_attr_leaf_remove_attr() local
647 struct xfs_inode *dp = args->dp; in xfs_attr_leaf_remove_attr()
652 error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno, in xfs_attr_leaf_remove_attr()
657 xfs_attr3_leaf_remove(bp, args); in xfs_attr_leaf_remove_attr()
661 error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); in xfs_attr_leaf_remove_attr()
674 struct xfs_da_args *args) in xfs_attr_leaf_shrink() argument
676 struct xfs_inode *dp = args->dp; in xfs_attr_leaf_shrink()
684 error = xfs_attr3_leaf_read(args->trans, args->dp, 0, &bp); in xfs_attr_leaf_shrink()
690 error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); in xfs_attr_leaf_shrink()
693 xfs_trans_brelse(args->trans, bp); in xfs_attr_leaf_shrink()
711 struct xfs_da_args *args = attr->xattri_da_args; in xfs_attr_set_iter() local
728 error = xfs_attr_sf_removename(args); in xfs_attr_set_iter()
730 xfs_attr_init_add_state(args)); in xfs_attr_set_iter()
733 error = xfs_attr_leaf_removename(args); in xfs_attr_set_iter()
735 xfs_attr_init_add_state(args)); in xfs_attr_set_iter()
740 (args->op_flags & XFS_DA_OP_RECOVERY)) { in xfs_attr_set_iter()
742 xfs_attr_init_add_state(args)); in xfs_attr_set_iter()
749 if (args->rmtblkno == 0) in xfs_attr_set_iter()
777 error = xfs_attr3_leaf_flipflags(args); in xfs_attr_set_iter()
796 xfs_attr_restore_rmt_blk(args); in xfs_attr_set_iter()
797 if (args->rmtblkno) { in xfs_attr_set_iter()
798 error = xfs_attr_rmtval_invalidate(args); in xfs_attr_set_iter()
832 xfs_attr_init_add_state(args)); in xfs_attr_set_iter()
838 error = xfs_attr_leaf_shrink(args); in xfs_attr_set_iter()
840 xfs_attr_init_add_state(args)); in xfs_attr_set_iter()
847 trace_xfs_attr_set_iter_return(attr->xattri_dela_state, args->dp); in xfs_attr_set_iter()
857 struct xfs_da_args *args) in xfs_attr_lookup() argument
859 struct xfs_inode *dp = args->dp; in xfs_attr_lookup()
868 return xfs_attr_sf_findname(args, NULL, NULL); in xfs_attr_lookup()
871 error = xfs_attr_leaf_hasname(args, &bp); in xfs_attr_lookup()
874 xfs_trans_brelse(args->trans, bp); in xfs_attr_lookup()
879 state = xfs_da_state_alloc(args); in xfs_attr_lookup()
880 error = xfs_attr_node_lookup(args, state); in xfs_attr_lookup()
887 struct xfs_da_args *args, in xfs_attr_intent_init() argument
896 new->xattri_da_args = args; in xfs_attr_intent_init()
905 struct xfs_da_args *args) in xfs_attr_defer_add() argument
910 error = xfs_attr_intent_init(args, XFS_ATTRI_OP_FLAGS_SET, &new); in xfs_attr_defer_add()
914 new->xattri_dela_state = xfs_attr_init_add_state(args); in xfs_attr_defer_add()
915 xfs_defer_add(args->trans, XFS_DEFER_OPS_TYPE_ATTR, &new->xattri_list); in xfs_attr_defer_add()
916 trace_xfs_attr_defer_add(new->xattri_dela_state, args->dp); in xfs_attr_defer_add()
924 struct xfs_da_args *args) in xfs_attr_defer_replace() argument
929 error = xfs_attr_intent_init(args, XFS_ATTRI_OP_FLAGS_REPLACE, &new); in xfs_attr_defer_replace()
933 new->xattri_dela_state = xfs_attr_init_replace_state(args); in xfs_attr_defer_replace()
934 xfs_defer_add(args->trans, XFS_DEFER_OPS_TYPE_ATTR, &new->xattri_list); in xfs_attr_defer_replace()
935 trace_xfs_attr_defer_replace(new->xattri_dela_state, args->dp); in xfs_attr_defer_replace()
943 struct xfs_da_args *args) in xfs_attr_defer_remove() argument
949 error = xfs_attr_intent_init(args, XFS_ATTRI_OP_FLAGS_REMOVE, &new); in xfs_attr_defer_remove()
953 new->xattri_dela_state = xfs_attr_init_remove_state(args); in xfs_attr_defer_remove()
954 xfs_defer_add(args->trans, XFS_DEFER_OPS_TYPE_ATTR, &new->xattri_list); in xfs_attr_defer_remove()
955 trace_xfs_attr_defer_remove(new->xattri_dela_state, args->dp); in xfs_attr_defer_remove()
966 struct xfs_da_args *args) in xfs_attr_set() argument
968 struct xfs_inode *dp = args->dp; in xfs_attr_set()
971 bool rsvd = (args->attr_filter & XFS_ATTR_ROOT); in xfs_attr_set()
983 args->geo = mp->m_attr_geo; in xfs_attr_set()
984 args->whichfork = XFS_ATTR_FORK; in xfs_attr_set()
985 args->hashval = xfs_da_hashname(args->name, args->namelen); in xfs_attr_set()
993 args->op_flags = XFS_DA_OP_OKNOENT | in xfs_attr_set()
994 (args->op_flags & XFS_DA_OP_LOGGED); in xfs_attr_set()
996 if (args->value) { in xfs_attr_set()
998 args->total = xfs_attr_calc_size(args, &local); in xfs_attr_set()
1006 xfs_attr_sf_entsize_byname(args->namelen, in xfs_attr_set()
1007 args->valuelen); in xfs_attr_set()
1015 rmt_blks = xfs_attr3_rmt_blocks(mp, args->valuelen); in xfs_attr_set()
1025 xfs_init_attr_trans(args, &tres, &total); in xfs_attr_set()
1026 error = xfs_trans_alloc_inode(dp, &tres, total, 0, rsvd, &args->trans); in xfs_attr_set()
1030 if (args->value || xfs_inode_hasattr(dp)) { in xfs_attr_set()
1034 error = xfs_iext_count_upgrade(args->trans, dp, in xfs_attr_set()
1040 error = xfs_attr_lookup(args); in xfs_attr_set()
1044 if (!args->value) { in xfs_attr_set()
1045 error = xfs_attr_defer_remove(args); in xfs_attr_set()
1049 if (args->attr_flags & XATTR_CREATE) in xfs_attr_set()
1052 error = xfs_attr_defer_replace(args); in xfs_attr_set()
1056 if (!args->value) in xfs_attr_set()
1060 if (args->attr_flags & XATTR_REPLACE) in xfs_attr_set()
1063 error = xfs_attr_defer_add(args); in xfs_attr_set()
1076 xfs_trans_set_sync(args->trans); in xfs_attr_set()
1078 if (!(args->op_flags & XFS_DA_OP_NOTIME)) in xfs_attr_set()
1079 xfs_trans_ichgtime(args->trans, dp, XFS_ICHGTIME_CHG); in xfs_attr_set()
1084 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE); in xfs_attr_set()
1085 error = xfs_trans_commit(args->trans); in xfs_attr_set()
1091 if (args->trans) in xfs_attr_set()
1092 xfs_trans_cancel(args->trans); in xfs_attr_set()
1114 struct xfs_da_args *args) in xfs_attr_shortform_addname() argument
1119 trace_xfs_attr_sf_addname(args); in xfs_attr_shortform_addname()
1121 error = xfs_attr_shortform_lookup(args); in xfs_attr_shortform_addname()
1124 if (args->op_flags & XFS_DA_OP_REPLACE) in xfs_attr_shortform_addname()
1128 if (!(args->op_flags & XFS_DA_OP_REPLACE)) in xfs_attr_shortform_addname()
1131 error = xfs_attr_sf_removename(args); in xfs_attr_shortform_addname()
1141 args->op_flags &= ~XFS_DA_OP_REPLACE; in xfs_attr_shortform_addname()
1149 if (args->namelen >= XFS_ATTR_SF_ENTSIZE_MAX || in xfs_attr_shortform_addname()
1150 args->valuelen >= XFS_ATTR_SF_ENTSIZE_MAX) in xfs_attr_shortform_addname()
1153 newsize = xfs_attr_sf_totsize(args->dp); in xfs_attr_shortform_addname()
1154 newsize += xfs_attr_sf_entsize_byname(args->namelen, args->valuelen); in xfs_attr_shortform_addname()
1156 forkoff = xfs_attr_shortform_bytesfit(args->dp, newsize); in xfs_attr_shortform_addname()
1160 xfs_attr_shortform_add(args, forkoff); in xfs_attr_shortform_addname()
1172 struct xfs_da_args *args) in xfs_attr_save_rmt_blk() argument
1174 args->blkno2 = args->blkno; in xfs_attr_save_rmt_blk()
1175 args->index2 = args->index; in xfs_attr_save_rmt_blk()
1176 args->rmtblkno2 = args->rmtblkno; in xfs_attr_save_rmt_blk()
1177 args->rmtblkcnt2 = args->rmtblkcnt; in xfs_attr_save_rmt_blk()
1178 args->rmtvaluelen2 = args->rmtvaluelen; in xfs_attr_save_rmt_blk()
1179 args->rmtblkno = 0; in xfs_attr_save_rmt_blk()
1180 args->rmtblkcnt = 0; in xfs_attr_save_rmt_blk()
1181 args->rmtvaluelen = 0; in xfs_attr_save_rmt_blk()
1187 struct xfs_da_args *args) in xfs_attr_restore_rmt_blk() argument
1189 args->blkno = args->blkno2; in xfs_attr_restore_rmt_blk()
1190 args->index = args->index2; in xfs_attr_restore_rmt_blk()
1191 args->rmtblkno = args->rmtblkno2; in xfs_attr_restore_rmt_blk()
1192 args->rmtblkcnt = args->rmtblkcnt2; in xfs_attr_restore_rmt_blk()
1193 args->rmtvaluelen = args->rmtvaluelen2; in xfs_attr_restore_rmt_blk()
1208 struct xfs_da_args *args) in xfs_attr_leaf_try_add() argument
1213 error = xfs_attr3_leaf_read(args->trans, args->dp, 0, &bp); in xfs_attr_leaf_try_add()
1220 error = xfs_attr3_leaf_lookup_int(bp, args); in xfs_attr_leaf_try_add()
1223 if (args->op_flags & XFS_DA_OP_REPLACE) in xfs_attr_leaf_try_add()
1227 if (!(args->op_flags & XFS_DA_OP_REPLACE)) in xfs_attr_leaf_try_add()
1230 trace_xfs_attr_leaf_replace(args); in xfs_attr_leaf_try_add()
1236 xfs_attr_save_rmt_blk(args); in xfs_attr_leaf_try_add()
1244 return xfs_attr3_leaf_add(bp, args); in xfs_attr_leaf_try_add()
1247 xfs_trans_brelse(args->trans, bp); in xfs_attr_leaf_try_add()
1256 struct xfs_da_args *args, in xfs_attr_leaf_hasname() argument
1261 error = xfs_attr3_leaf_read(args->trans, args->dp, 0, bp); in xfs_attr_leaf_hasname()
1265 error = xfs_attr3_leaf_lookup_int(*bp, args); in xfs_attr_leaf_hasname()
1267 xfs_trans_brelse(args->trans, *bp); in xfs_attr_leaf_hasname()
1280 struct xfs_da_args *args) in xfs_attr_leaf_removename() argument
1286 trace_xfs_attr_leaf_removename(args); in xfs_attr_leaf_removename()
1291 dp = args->dp; in xfs_attr_leaf_removename()
1293 error = xfs_attr_leaf_hasname(args, &bp); in xfs_attr_leaf_removename()
1295 xfs_trans_brelse(args->trans, bp); in xfs_attr_leaf_removename()
1296 if (args->op_flags & XFS_DA_OP_RECOVERY) in xfs_attr_leaf_removename()
1302 xfs_attr3_leaf_remove(bp, args); in xfs_attr_leaf_removename()
1309 return xfs_attr3_leaf_to_shortform(bp, args, forkoff); in xfs_attr_leaf_removename()
1324 xfs_attr_leaf_get(xfs_da_args_t *args) in xfs_attr_leaf_get() argument
1329 trace_xfs_attr_leaf_get(args); in xfs_attr_leaf_get()
1331 error = xfs_attr_leaf_hasname(args, &bp); in xfs_attr_leaf_get()
1334 xfs_trans_brelse(args->trans, bp); in xfs_attr_leaf_get()
1340 error = xfs_attr3_leaf_getvalue(bp, args); in xfs_attr_leaf_get()
1341 xfs_trans_brelse(args->trans, bp); in xfs_attr_leaf_get()
1348 struct xfs_da_args *args, in xfs_attr_node_lookup() argument
1371 struct xfs_da_args *args = attr->xattri_da_args; in xfs_attr_node_addname_find_attr() local
1379 error = xfs_attr_node_lookup(args, attr->xattri_da_state); in xfs_attr_node_addname_find_attr()
1382 if (args->op_flags & XFS_DA_OP_REPLACE) in xfs_attr_node_addname_find_attr()
1386 if (!(args->op_flags & XFS_DA_OP_REPLACE)) in xfs_attr_node_addname_find_attr()
1390 trace_xfs_attr_node_replace(args); in xfs_attr_node_addname_find_attr()
1396 xfs_attr_save_rmt_blk(args); in xfs_attr_node_addname_find_attr()
1428 trace_xfs_attr_node_addname(state->args); in xfs_attr_node_try_addname()
1433 error = xfs_attr3_leaf_add(blk->bp, state->args); in xfs_attr_node_try_addname()
1468 struct xfs_da_args *args, in xfs_attr_node_removename() argument
1479 retval = xfs_attr3_leaf_remove(blk->bp, args); in xfs_attr_node_removename()
1489 struct xfs_da_args *args = attr->xattri_da_args; in xfs_attr_node_remove_attr() local
1490 struct xfs_da_state *state = xfs_da_state_alloc(args); in xfs_attr_node_remove_attr()
1499 args->attr_filter |= XFS_ATTR_INCOMPLETE; in xfs_attr_node_remove_attr()
1504 error = xfs_attr_node_removename(args, state); in xfs_attr_node_remove_attr()
1534 struct xfs_da_args *args) in xfs_attr_node_get() argument
1541 trace_xfs_attr_node_get(args); in xfs_attr_node_get()
1546 state = xfs_da_state_alloc(args); in xfs_attr_node_get()
1547 error = xfs_attr_node_lookup(args, state); in xfs_attr_node_get()
1555 error = xfs_attr3_leaf_getvalue(blk->bp, args); in xfs_attr_node_get()
1562 xfs_trans_brelse(args->trans, state->path.blk[i].bp); in xfs_attr_node_get()