dm.c (fe6e91e3387e4f90ed4605a1a538248a31686c16) | dm.c (96b26c8c64c7a30488b8b404f7a63346df4c3bff) |
---|---|
1/* 2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include "dm.h" --- 192 unchanged lines hidden (view full) --- 201 struct hd_geometry geometry; 202 203 /* kobject and completion */ 204 struct dm_kobject_holder kobj_holder; 205 206 /* zero-length flush that will be cloned and submitted to targets */ 207 struct bio flush_bio; 208 | 1/* 2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include "dm.h" --- 192 unchanged lines hidden (view full) --- 201 struct hd_geometry geometry; 202 203 /* kobject and completion */ 204 struct dm_kobject_holder kobj_holder; 205 206 /* zero-length flush that will be cloned and submitted to targets */ 207 struct bio flush_bio; 208 |
209 /* the number of internal suspends */ 210 unsigned internal_suspend_count; 211 |
|
209 struct dm_stats stats; 210}; 211 212/* 213 * For mempools pre-allocation at the table loading time. 214 */ 215struct dm_md_mempools { 216 mempool_t *io_pool; --- 2706 unchanged lines hidden (view full) --- 2923 * until all bios finish and prevents issuing new bios to the target drivers. 2924 * It may be used only from the kernel. 2925 */ 2926 2927static void __dm_internal_suspend(struct mapped_device *md, unsigned suspend_flags) 2928{ 2929 struct dm_table *map = NULL; 2930 | 212 struct dm_stats stats; 213}; 214 215/* 216 * For mempools pre-allocation at the table loading time. 217 */ 218struct dm_md_mempools { 219 mempool_t *io_pool; --- 2706 unchanged lines hidden (view full) --- 2926 * until all bios finish and prevents issuing new bios to the target drivers. 2927 * It may be used only from the kernel. 2928 */ 2929 2930static void __dm_internal_suspend(struct mapped_device *md, unsigned suspend_flags) 2931{ 2932 struct dm_table *map = NULL; 2933 |
2931 if (dm_suspended_internally_md(md)) | 2934 if (md->internal_suspend_count++) |
2932 return; /* nested internal suspend */ 2933 2934 if (dm_suspended_md(md)) { 2935 set_bit(DMF_SUSPENDED_INTERNALLY, &md->flags); 2936 return; /* nest suspend */ 2937 } 2938 2939 map = rcu_dereference_protected(md->map, lockdep_is_held(&md->suspend_lock)); --- 8 unchanged lines hidden (view full) --- 2948 2949 set_bit(DMF_SUSPENDED_INTERNALLY, &md->flags); 2950 2951 dm_table_postsuspend_targets(map); 2952} 2953 2954static void __dm_internal_resume(struct mapped_device *md) 2955{ | 2935 return; /* nested internal suspend */ 2936 2937 if (dm_suspended_md(md)) { 2938 set_bit(DMF_SUSPENDED_INTERNALLY, &md->flags); 2939 return; /* nest suspend */ 2940 } 2941 2942 map = rcu_dereference_protected(md->map, lockdep_is_held(&md->suspend_lock)); --- 8 unchanged lines hidden (view full) --- 2951 2952 set_bit(DMF_SUSPENDED_INTERNALLY, &md->flags); 2953 2954 dm_table_postsuspend_targets(map); 2955} 2956 2957static void __dm_internal_resume(struct mapped_device *md) 2958{ |
2956 if (!dm_suspended_internally_md(md)) | 2959 BUG_ON(!md->internal_suspend_count); 2960 2961 if (--md->internal_suspend_count) |
2957 return; /* resume from nested internal suspend */ 2958 2959 if (dm_suspended_md(md)) 2960 goto done; /* resume from nested suspend */ 2961 2962 /* 2963 * NOTE: existing callers don't need to call dm_table_resume_targets 2964 * (which may fail -- so best to avoid it for now by passing NULL map) --- 234 unchanged lines hidden --- | 2962 return; /* resume from nested internal suspend */ 2963 2964 if (dm_suspended_md(md)) 2965 goto done; /* resume from nested suspend */ 2966 2967 /* 2968 * NOTE: existing callers don't need to call dm_table_resume_targets 2969 * (which may fail -- so best to avoid it for now by passing NULL map) --- 234 unchanged lines hidden --- |