Lines Matching refs:snapshot

62 	struct devlink_snapshot *snapshot;  in devlink_region_snapshot_get_by_id()  local
64 list_for_each_entry(snapshot, &region->snapshot_list, list) in devlink_region_snapshot_get_by_id()
65 if (snapshot->id == id) in devlink_region_snapshot_get_by_id()
66 return snapshot; in devlink_region_snapshot_get_by_id()
73 struct devlink_snapshot *snapshot) in devlink_nl_region_snapshot_id_put() argument
82 err = nla_put_u32(msg, DEVLINK_ATTR_REGION_SNAPSHOT_ID, snapshot->id); in devlink_nl_region_snapshot_id_put()
98 struct devlink_snapshot *snapshot; in devlink_nl_region_snapshots_id_put() local
107 list_for_each_entry(snapshot, &region->snapshot_list, list) { in devlink_nl_region_snapshots_id_put()
108 err = devlink_nl_region_snapshot_id_put(msg, devlink, snapshot); in devlink_nl_region_snapshots_id_put()
173 struct devlink_snapshot *snapshot, in devlink_nl_region_notify_build() argument
207 if (snapshot) { in devlink_nl_region_notify_build()
209 snapshot->id); in devlink_nl_region_notify_build()
230 struct devlink_snapshot *snapshot, in devlink_nl_region_notify() argument
240 msg = devlink_nl_region_notify_build(region, snapshot, cmd, 0, 0); in devlink_nl_region_notify()
421 struct devlink_snapshot *snapshot; in __devlink_region_snapshot_create() local
433 snapshot = kzalloc(sizeof(*snapshot), GFP_KERNEL); in __devlink_region_snapshot_create()
434 if (!snapshot) in __devlink_region_snapshot_create()
441 snapshot->id = snapshot_id; in __devlink_region_snapshot_create()
442 snapshot->region = region; in __devlink_region_snapshot_create()
443 snapshot->data = data; in __devlink_region_snapshot_create()
445 list_add_tail(&snapshot->list, &region->snapshot_list); in __devlink_region_snapshot_create()
449 devlink_nl_region_notify(region, snapshot, DEVLINK_CMD_REGION_NEW); in __devlink_region_snapshot_create()
453 kfree(snapshot); in __devlink_region_snapshot_create()
458 struct devlink_snapshot *snapshot) in devlink_region_snapshot_del() argument
464 devlink_nl_region_notify(region, snapshot, DEVLINK_CMD_REGION_DEL); in devlink_region_snapshot_del()
466 list_del(&snapshot->list); in devlink_region_snapshot_del()
467 region->ops->destructor(snapshot->data); in devlink_region_snapshot_del()
468 __devlink_snapshot_id_decrement(devlink, snapshot->id); in devlink_region_snapshot_del()
469 kfree(snapshot); in devlink_region_snapshot_del()
594 struct devlink_snapshot *snapshot; in devlink_nl_cmd_region_del() local
625 snapshot = devlink_region_snapshot_get_by_id(region, snapshot_id); in devlink_nl_cmd_region_del()
626 if (!snapshot) { in devlink_nl_cmd_region_del()
631 devlink_region_snapshot_del(region, snapshot); in devlink_nl_cmd_region_del()
639 struct devlink_snapshot *snapshot; in devlink_nl_cmd_region_new() local
674 if (!region->ops->snapshot) { in devlink_nl_cmd_region_new()
709 err = region->port_ops->snapshot(port, region->port_ops, in devlink_nl_cmd_region_new()
712 err = region->ops->snapshot(devlink, region->ops, in devlink_nl_cmd_region_new()
724 snapshot = devlink_region_snapshot_get_by_id(region, in devlink_nl_cmd_region_new()
726 if (WARN_ON(!snapshot)) { in devlink_nl_cmd_region_new()
731 msg = devlink_nl_region_notify_build(region, snapshot, in devlink_nl_cmd_region_new()
755 devlink_region_snapshot_del(region, snapshot); in devlink_nl_cmd_region_new()
839 struct devlink_snapshot *snapshot = cb_priv; in devlink_region_snapshot_fill() local
841 memcpy(chunk, &snapshot->data[curr_offset], chunk_size); in devlink_region_snapshot_fill()
940 struct devlink_snapshot *snapshot; in devlink_nl_cmd_region_read_dumpit() local
950 snapshot = devlink_region_snapshot_get_by_id(region, snapshot_id); in devlink_nl_cmd_region_read_dumpit()
951 if (!snapshot) { in devlink_nl_cmd_region_read_dumpit()
957 region_cb_priv = snapshot; in devlink_nl_cmd_region_read_dumpit()
1166 struct devlink_snapshot *snapshot, *ts; in devl_region_destroy() local
1172 list_for_each_entry_safe(snapshot, ts, &region->snapshot_list, list) in devl_region_destroy()
1173 devlink_region_snapshot_del(region, snapshot); in devl_region_destroy()