dm.c (8446fe9255be821cb38ffd306d7e8edc4b9ea662) | dm.c (977115c0f664e016a6b2774d4f97116ade23d732) |
---|---|
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-core.h" --- 2361 unchanged lines hidden (view full) --- 2370} 2371 2372/* 2373 * Functions to lock and unlock any filesystem running on the 2374 * device. 2375 */ 2376static int lock_fs(struct mapped_device *md) 2377{ | 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-core.h" --- 2361 unchanged lines hidden (view full) --- 2370} 2371 2372/* 2373 * Functions to lock and unlock any filesystem running on the 2374 * device. 2375 */ 2376static int lock_fs(struct mapped_device *md) 2377{ |
2378 struct block_device *bdev; | |
2379 int r; 2380 2381 WARN_ON(test_bit(DMF_FROZEN, &md->flags)); 2382 | 2378 int r; 2379 2380 WARN_ON(test_bit(DMF_FROZEN, &md->flags)); 2381 |
2383 bdev = bdget_disk(md->disk, 0); 2384 if (!bdev) 2385 return -ENOMEM; 2386 r = freeze_bdev(bdev); 2387 bdput(bdev); | 2382 r = freeze_bdev(md->disk->part0); |
2388 if (!r) 2389 set_bit(DMF_FROZEN, &md->flags); 2390 return r; 2391} 2392 2393static void unlock_fs(struct mapped_device *md) 2394{ | 2383 if (!r) 2384 set_bit(DMF_FROZEN, &md->flags); 2385 return r; 2386} 2387 2388static void unlock_fs(struct mapped_device *md) 2389{ |
2395 struct block_device *bdev; 2396 | |
2397 if (!test_bit(DMF_FROZEN, &md->flags)) 2398 return; | 2390 if (!test_bit(DMF_FROZEN, &md->flags)) 2391 return; |
2399 2400 bdev = bdget_disk(md->disk, 0); 2401 if (!bdev) 2402 return; 2403 thaw_bdev(bdev); 2404 bdput(bdev); | 2392 thaw_bdev(md->disk->part0); |
2405 clear_bit(DMF_FROZEN, &md->flags); 2406} 2407 2408/* 2409 * @suspend_flags: DM_SUSPEND_LOCKFS_FLAG and/or DM_SUSPEND_NOFLUSH_FLAG 2410 * @task_state: e.g. TASK_INTERRUPTIBLE or TASK_UNINTERRUPTIBLE 2411 * @dmf_suspended_flag: DMF_SUSPENDED or DMF_SUSPENDED_INTERNALLY 2412 * --- 702 unchanged lines hidden --- | 2393 clear_bit(DMF_FROZEN, &md->flags); 2394} 2395 2396/* 2397 * @suspend_flags: DM_SUSPEND_LOCKFS_FLAG and/or DM_SUSPEND_NOFLUSH_FLAG 2398 * @task_state: e.g. TASK_INTERRUPTIBLE or TASK_UNINTERRUPTIBLE 2399 * @dmf_suspended_flag: DMF_SUSPENDED or DMF_SUSPENDED_INTERNALLY 2400 * --- 702 unchanged lines hidden --- |