dm.c (13f6facf3faeed34ca381aef4c9b153c7aed3972) | dm.c (f7995089c508a5a11b0491c7b348d5c07217a4e8) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 4 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 5 * 6 * This file is released under the GPL. 7 */ 8 --- 1058 unchanged lines hidden (view full) --- 1067static void dm_io_dec_pending(struct dm_io *io, blk_status_t error) 1068{ 1069 if (unlikely(error)) 1070 dm_io_set_error(io, error); 1071 1072 __dm_io_dec_pending(io); 1073} 1074 | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 4 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 5 * 6 * This file is released under the GPL. 7 */ 8 --- 1058 unchanged lines hidden (view full) --- 1067static void dm_io_dec_pending(struct dm_io *io, blk_status_t error) 1068{ 1069 if (unlikely(error)) 1070 dm_io_set_error(io, error); 1071 1072 __dm_io_dec_pending(io); 1073} 1074 |
1075/* 1076 * The queue_limits are only valid as long as you have a reference 1077 * count on 'md'. But _not_ imposing verification to avoid atomic_read(), 1078 */ 1079static inline struct queue_limits *dm_get_queue_limits(struct mapped_device *md) 1080{ 1081 return &md->queue->limits; 1082} 1083 |
|
1075void disable_discard(struct mapped_device *md) 1076{ 1077 struct queue_limits *limits = dm_get_queue_limits(md); 1078 1079 /* device doesn't really support DISCARD, disable it */ 1080 limits->max_discard_sectors = 0; 1081} 1082 --- 1224 unchanged lines hidden (view full) --- 2307} 2308 2309struct target_type *dm_get_immutable_target_type(struct mapped_device *md) 2310{ 2311 return md->immutable_target_type; 2312} 2313 2314/* | 1084void disable_discard(struct mapped_device *md) 1085{ 1086 struct queue_limits *limits = dm_get_queue_limits(md); 1087 1088 /* device doesn't really support DISCARD, disable it */ 1089 limits->max_discard_sectors = 0; 1090} 1091 --- 1224 unchanged lines hidden (view full) --- 2316} 2317 2318struct target_type *dm_get_immutable_target_type(struct mapped_device *md) 2319{ 2320 return md->immutable_target_type; 2321} 2322 2323/* |
2315 * The queue_limits are only valid as long as you have a reference 2316 * count on 'md'. 2317 */ 2318struct queue_limits *dm_get_queue_limits(struct mapped_device *md) 2319{ 2320 BUG_ON(!atomic_read(&md->holders)); 2321 return &md->queue->limits; 2322} 2323EXPORT_SYMBOL_GPL(dm_get_queue_limits); 2324 2325/* | |
2326 * Setup the DM device's queue based on md's type 2327 */ 2328int dm_setup_md_queue(struct mapped_device *md, struct dm_table *t) 2329{ 2330 enum dm_queue_mode type = dm_table_get_type(t); 2331 struct queue_limits limits; 2332 struct table_device *td; 2333 int r; --- 1091 unchanged lines hidden --- | 2324 * Setup the DM device's queue based on md's type 2325 */ 2326int dm_setup_md_queue(struct mapped_device *md, struct dm_table *t) 2327{ 2328 enum dm_queue_mode type = dm_table_get_type(t); 2329 struct queue_limits limits; 2330 struct table_device *td; 2331 int r; --- 1091 unchanged lines hidden --- |