/linux/drivers/md/dm-vdo/ |
H A D | vdo.c | 7 * This file contains the main entry points for normal operations on a vdo as well as functions for 8 * constructing and destroying vdo instances (in memory). 20 * When vdo_enter_read_only_mode() is called from some vdo thread, if the read_only_error field 25 * notifications are currently disallowed, generally due to the vdo being suspended. In this case, 26 * the nothing more will be done until the vdo is resumed, at which point the notification will be 27 * performed. In any other case, the vdo is already read-only, and there is nothing more to do. 30 #include "vdo.h" 87 static bool vdo_is_equal(struct vdo *vdo, const void *context) in vdo_is_equal() argument 89 return (vdo == context); in vdo_is_equal() 93 * filter_vdos_locked() - Find a vdo in the registry if it exists there. [all …]
|
H A D | dm-vdo-target.c | 39 #include "vdo.h" 151 * O(n) run time isn't ideal, but if we have 1000 VDO devices in use simultaneously we still only 890 static struct vdo *get_vdo_for_target(struct dm_target *ti) in get_vdo_for_target() 892 return ((struct device_config *) ti->private)->vdo; in get_vdo_for_target() 898 struct vdo *vdo = get_vdo_for_target(ti); in vdo_map_bio() local 900 const struct admin_state_code *code = vdo_get_admin_state_code(&vdo->admin.state); in vdo_map_bio() 902 VDO_ASSERT_LOG_ONLY(code->normal, "vdo should not receive bios while in state %s", in vdo_map_bio() 906 vdo_count_bios(&vdo->stats.bios_in, bio); in vdo_map_bio() 911 vdo_launch_flush(vdo, bio); in vdo_map_bio() 918 (vdo == vdo_get_work_queue_owner(current_work_queue)->vdo)); in vdo_map_bio() [all …]
|
H A D | vdo.h | 37 * typedef vdo_read_only_notification_fn - A function to notify a listener that the VDO has gone 45 * An object to be notified when the VDO enters read-only mode 57 struct vdo *vdo; member 61 * Each thread maintains its own notion of whether the VDO is read-only so that the 63 * synchronization or thread safety. This does mean that knowledge of the VDO going 64 * read-only does not occur simultaneously across the VDO's threads, but that does not seem 69 * A list of objects waiting to be notified on this thread that the VDO has entered 115 /* The code of the error which put the VDO into read-only mode */ 122 * The thread ID returned when the current thread is not a vdo thread, or can not be determined 166 struct vdo { struct [all …]
|
H A D | flush.c | 21 #include "vdo.h" 25 /* The vdo to which this flusher belongs */ 26 struct vdo *vdo; member 29 /* The current flush generation of the vdo */ 117 vdo_initialize_completion(&flush->completion, flusher->vdo, in allocate_flush() 130 * vdo_make_flusher() - Make a flusher for a vdo. 131 * @vdo: The vdo which owns the flusher. 135 int vdo_make_flusher(struct vdo *vdo) in vdo_make_flusher() argument 137 int result = vdo_allocate(1, struct flusher, __func__, &vdo->flusher); in vdo_make_flusher() 142 vdo->flusher->vdo = vdo; in vdo_make_flusher() [all …]
|
H A D | repair.c | 24 #include "vdo.h" 207 const struct thread_config *thread_config = &completion->vdo->thread_config; in prepare_repair_completion() 242 repair->completion.vdo->block_map->zones[0].page_cache.rebuilding = false; in free_repair_completion() 253 struct vdo *vdo = completion->vdo; in finish_repair() local 256 vdo_assert_on_admin_thread(vdo, __func__); in finish_repair() 258 if (vdo->load_state != VDO_REBUILD_FOR_UPGRADE) in finish_repair() 259 vdo->states.vdo.complete_recoveries++; in finish_repair() 261 vdo_initialize_recovery_journal_post_repair(vdo->recovery_journal, in finish_repair() 262 vdo->states.vdo.complete_recoveries, in finish_repair() 268 if (vdo_state_requires_read_only_rebuild(vdo->load_state)) { in finish_repair() [all …]
|
H A D | logical-zone.c | 22 #include "vdo.h" 54 struct vdo *vdo = zones->vdo; in initialize_zone() local 62 if (zone_number < vdo->thread_config.logical_zone_count - 1) in initialize_zone() 65 vdo_initialize_completion(&zone->completion, vdo, in initialize_zone() 69 zone->thread_id = vdo->thread_config.logical_threads[zone_number]; in initialize_zone() 70 zone->block_map_zone = &vdo->block_map->zones[zone_number]; in initialize_zone() 74 allocation_zone_number = zone->thread_id % vdo->thread_config.physical_zone_count; in initialize_zone() 75 zone->allocation_zone = &vdo->physical_zones->zones[allocation_zone_number]; in initialize_zone() 77 return vdo_make_default_thread(vdo, zone->thread_id); in initialize_zone() 82 * @vdo: The vdo to which the zones will belong. [all …]
|
H A D | dump.c | 20 #include "vdo.h" 55 static void do_dump(struct vdo *vdo, unsigned int dump_options_requested, in do_dump() argument 62 active = get_data_vio_pool_active_requests(vdo->data_vio_pool); in do_dump() 63 maximum = get_data_vio_pool_maximum_requests(vdo->data_vio_pool); in do_dump() 64 outstanding = (atomic64_read(&vdo->stats.bios_submitted) - in do_dump() 65 atomic64_read(&vdo->stats.bios_completed)); in do_dump() 68 vdo_get_device_name(vdo->device_config->owning_target)); in do_dump() 69 if (((dump_options_requested & FLAG_SHOW_QUEUES) != 0) && (vdo->threads != NULL)) { in do_dump() 72 for (id = 0; id < vdo->thread_config.thread_count; id++) in do_dump() 73 vdo_dump_work_queue(vdo->threads[id].queue); in do_dump() [all …]
|
H A D | vio.h | 18 #include "vdo.h" 58 return vio->completion.vdo->thread_config.bio_threads[vio->bio_zone]; in get_vio_bio_zone_thread_id() 80 int allocate_vio_components(struct vdo *vdo, enum vio_type vio_type, 83 int __must_check create_multi_block_metadata_vio(struct vdo *vdo, enum vio_type vio_type, 88 static inline int __must_check create_metadata_vio(struct vdo *vdo, enum vio_type vio_type, in create_metadata_vio() argument 93 return create_multi_block_metadata_vio(vdo, vio_type, priority, parent, 1, data, in create_metadata_vio() 104 * @block_count: The size of this vio in vdo blocks. 107 * @vdo: The vdo for this vio. 111 enum vio_priority priority, struct vdo *vdo) in initialize_vio() argument 120 vdo_initialize_completion(&vio->completion, vdo, VIO_COMPLETION); in initialize_vio() [all …]
|
H A D | completion.c | 16 #include "vdo.h" 19 * DOC: vdo completions. 21 * Most of vdo's data structures are lock free, each either belonging to a single "zone," or 52 struct vdo *vdo, in vdo_initialize_completion() argument 56 completion->vdo = vdo; in vdo_initialize_completion() 111 struct vdo *vdo = completion->vdo; in vdo_enqueue_completion() local 114 if (VDO_ASSERT(thread_id < vdo->thread_config.thread_count, in vdo_enqueue_completion() 117 vdo->thread_config.thread_count) != VDO_SUCCESS) in vdo_enqueue_completion() 123 vdo_enqueue_work_queue(vdo->threads[thread_id].queue, completion); in vdo_enqueue_completion()
|
H A D | io-submitter.c | 18 #include "vdo.h" 76 struct atomic_statistics *stats = &vio->completion.vdo->stats; in count_all_bios() 109 struct vdo *vdo = vio->completion.vdo; in send_bio_to_device() local 112 atomic64_inc(&vdo->stats.bios_submitted); in send_bio_to_device() 114 bio_set_dev(bio, vdo_get_backing_device(vdo)); in send_bio_to_device() 141 struct io_submitter *submitter = vio->completion.vdo->io_submitter; in get_bio_list() 273 struct vdo *vdo = vio->completion.vdo; in try_bio_map_merge() local 275 &vdo->io_submitter->bio_queue_data[vio->bio_zone]; in try_bio_map_merge() 332 * The vio is enqueued on a vdo bio queue so that bio submission (which may block) does not block 333 * other vdo threads. [all …]
|
H A D | types.h | 33 /* The type of the nonce used to identify instances of VDO. */ 69 /* typedef thread_id_t - A thread ID, vdo threads are numbered sequentially from 0. */ 77 /* The current operating mode of the VDO. */ 105 * vdo_state_requires_recovery() - Check whether a vdo state indicates that recovery is needed. 132 /* Metadata types for the vdo. */ 211 struct vdo *vdo; member 219 * This is the number of logical blocks from VDO's internal point of view. It is the number 256 * typedef vdo_action_fn - An asynchronous VDO operation. 297 * be used by waiters external to the VDO base as it is used to gate calling the callback. 313 /* The VDO on which this completion operates */ [all …]
|
H A D | statistics.h | 146 /** Counts of error conditions in VDO. */ 148 /* number of times VDO got an invalid dedupe advice PBN from UDS */ 198 /** The statistics of the vdo service. */ 203 /* Number of blocks used for VDO metadata */ 215 /* Number of times the VDO has successfully recovered */ 217 /* Number of times the VDO has recovered from read-only mode */ 219 /* String describing the operating mode of the VDO */ 221 /* Whether the VDO is in recovery mode */ 243 /* The VDO instance */ 255 /* Bios submitted into VDO from above */
|
H A D | message-stats.h | 11 int vdo_write_config(struct vdo *vdo, char **buf, unsigned int *maxlen); 12 int vdo_write_stats(struct vdo *vdo, char *buf, unsigned int maxlen);
|
H A D | dump.h | 11 int vdo_dump(struct vdo *vdo, unsigned int argc, char *const *argv, const char *why); 13 void vdo_dump_all(struct vdo *vdo, const char *why);
|
H A D | status-codes.h | 17 /* VDO-specific status codes. */ 19 /* base of all VDO errors */ 51 /* the VDO is in read-only mode */ 53 /* the VDO is shutting down */ 73 /* the VDO is not in a state to perform an admin operation */
|
H A D | logical-zone.h | 56 /* The vdo whose zones these are */ 57 struct vdo *vdo; member 66 int __must_check vdo_make_logical_zones(struct vdo *vdo,
|
H A D | message-stats.c | 13 #include "vdo.h" 250 /* number of times VDO got an invalid dedupe advice PBN from UDS */ in write_error_statistics() 322 /* Number of blocks used for VDO metadata */ in write_vdo_statistics() 338 /* Number of times the VDO has successfully recovered */ in write_vdo_statistics() 341 /* Number of times the VDO has recovered from read-only mode */ in write_vdo_statistics() 344 /* String describing the operating mode of the VDO */ in write_vdo_statistics() 346 /* Whether the VDO is in recovery mode */ in write_vdo_statistics() 373 /* The VDO instance */ in write_vdo_statistics() 387 /* Bios submitted into VDO from above */ in write_vdo_statistics() 418 int vdo_write_stats(struct vdo *vdo, char *buf, unsigned int maxlen) in vdo_write_stats() argument [all …]
|
H A D | flush.h | 28 int __must_check vdo_make_flusher(struct vdo *vdo); 38 void vdo_launch_flush(struct vdo *vdo, struct bio *bio);
|
H A D | encodings.c | 38 * else in VDO. 51 * else in VDO. 110 * is a change to encoding of the component data of any VDO component. 846 * vdo_initialize_layout() - Lay out the partitions of a vdo. 847 * @size: The entire size of the vdo. 866 "Not enough space to make a VDO"); in vdo_initialize_layout() 1079 * @config: The vdo config to convert. 1096 * @component: The VDO component data to convert. 1124 * @config: The packed vdo config to convert. 1126 * Return: The native in-memory representation of the vdo config. [all …]
|
H A D | Makefile | 5 obj-$(CONFIG_DM_VDO) += dm-vdo.o 7 dm-vdo-objs := \ 14 dm-vdo-target.o \ 40 vdo.o \
|
/linux/include/linux/usb/ |
H A D | pd_vdo.h | 13 * VDO : Vendor Defined Message Object 32 #define VDO(vid, type, ver, custom) \ macro 78 #define PD_VDO_VID(vdo) ((vdo) >> 16) argument 79 #define PD_VDO_SVDM(vdo) (((vdo) >> 15) & 1) argument 80 #define PD_VDO_SVDM_VER(vdo) (((vdo) >> 13) & 0x3) argument 81 #define PD_VDO_OPOS(vdo) (((vdo) >> 8) & 0x7) argument 82 #define PD_VDO_CMD(vdo) ((vdo) & 0x1f) argument 83 #define PD_VDO_CMDT(vdo) (((vdo) >> 6) & 0x3) argument 94 * [2] :: Cert Stat VDO 95 * [3] :: (Product | Cable) VDO [all …]
|
H A D | typec_altmode.h | 19 * @vdo: VDO returned by Discover Modes USB PD command 29 u32 vdo; member 60 int (*enter)(struct typec_altmode *altmode, u32 *vdo); 62 void (*attention)(struct typec_altmode *altmode, u32 vdo); 64 const u32 *vdo, int cnt); 70 int typec_altmode_enter(struct typec_altmode *altmode, u32 *vdo); 72 int typec_altmode_attention(struct typec_altmode *altmode, u32 vdo); 74 const u32 header, const u32 *vdo, int count); 87 int (*enter)(struct typec_altmode *altmode, enum typec_plug_index sop, u32 *vdo); 90 const u32 hdr, const u32 *vdo, int cnt); [all …]
|
/linux/drivers/usb/typec/ |
H A D | bus.c | 119 * @vdo: VDO for the Enter Mode command 123 * Enter Mode command. If the alternate mode does not require VDO, @vdo must be 126 int typec_altmode_enter(struct typec_altmode *adev, u32 *vdo) in typec_altmode_enter() argument 147 return pdev->ops->enter(pdev, vdo); in typec_altmode_enter() 182 * @vdo: VDO for the Attention command 186 int typec_altmode_attention(struct typec_altmode *adev, u32 vdo) in typec_altmode_attention() argument 197 pdev->ops->attention(pdev, vdo); in typec_altmode_attention() 207 * @vdo: Array of Vendor Defined Data Objects 215 const u32 header, const u32 *vdo, int count) in typec_altmode_vdm() argument 233 return pdev->ops->vdm(pdev, header, vdo, count); in typec_altmode_vdm() [all …]
|
/linux/include/dt-bindings/usb/ |
H A D | pd.h | 138 * Cert Stat VDO 145 * Product VDO 153 * UFP VDO (PD Revision 3.0+ only) 155 * <31:29> :: UFP VDO version 166 /* UFP VDO Version */ 214 * DFP VDO (PD Revision 3.0+ only) 216 * <31:29> :: DFP VDO version 235 * Cable VDO (for both Passive and Active Cable VDO in PD Rev2.0) 253 * Passive Cable VDO (PD Rev3.0+) 257 * <23:21> :: VDO version [all …]
|
/linux/drivers/usb/typec/altmodes/ |
H A D | displayport.c | 20 #define DP_HEADER(_dp, ver, cmd) (VDO((_dp)->alt->svid, 1, ver, cmd) \ 112 pin_assign = DP_CAP_UFP_D_PIN_ASSIGN(dp->alt->vdo) & in dp_altmode_configure() 113 DP_CAP_DFP_D_PIN_ASSIGN(dp->port->vdo); in dp_altmode_configure() 116 pin_assign &= DP_CAP_DFP_D_PIN_ASSIGN(dp->plug_prime->vdo); in dp_altmode_configure() 121 pin_assign = DP_CAP_PIN_ASSIGN_UFP_D(dp->alt->vdo) & in dp_altmode_configure() 122 DP_CAP_PIN_ASSIGN_DFP_D(dp->port->vdo); in dp_altmode_configure() 125 pin_assign &= DP_CAP_UFP_D_PIN_ASSIGN(dp->plug_prime->vdo); in dp_altmode_configure() 265 u32 vdo; in dp_altmode_work() local 294 vdo = 1; in dp_altmode_work() 295 ret = typec_altmode_vdm(dp->alt, header, &vdo, 2); in dp_altmode_work() [all …]
|