Commit d1e14142 authored by Alasdair G. Kergon's avatar Alasdair G. Kergon Committed by Linus Torvalds

[PATCH] device-mapper: optionally bypass a bdget

Improve performance by optionally bypassing some code that uses bdget.
Signed-Off-By: default avatarAlasdair G Kergon <agk@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0c4b76ba
/*
* Copyright (C) 2001, 2002 Sistina Software (UK) Limited.
* Copyright (C) 2004 Red Hat, Inc. All rights reserved.
* Copyright (C) 2004 - 2005 Red Hat, Inc. All rights reserved.
*
* This file is released under the GPL.
*/
......@@ -520,19 +520,22 @@ static int __dev_status(struct mapped_device *md, struct dm_ioctl *param)
if (dm_suspended(md))
param->flags |= DM_SUSPEND_FLAG;
bdev = bdget_disk(disk, 0);
if (!bdev)
return -ENXIO;
param->dev = huge_encode_dev(MKDEV(disk->major, disk->first_minor));
/*
* Yes, this will be out of date by the time it gets back
* to userland, but it is still very useful ofr
* debugging.
*/
param->open_count = bdev->bd_openers;
bdput(bdev);
if (!(param->flags & DM_SKIP_BDGET_FLAG)) {
bdev = bdget_disk(disk, 0);
if (!bdev)
return -ENXIO;
/*
* Yes, this will be out of date by the time it gets back
* to userland, but it is still very useful for
* debugging.
*/
param->open_count = bdev->bd_openers;
bdput(bdev);
} else
param->open_count = -1;
if (disk->policy)
param->flags |= DM_READONLY_FLAG;
......
/*
* Copyright (C) 2001 - 2003 Sistina Software (UK) Limited.
* Copyright (C) 2004 Red Hat, Inc. All rights reserved.
* Copyright (C) 2004 - 2005 Red Hat, Inc. All rights reserved.
*
* This file is released under the LGPL.
*/
......@@ -272,9 +272,9 @@ typedef char ioctl_struct[308];
#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)
#define DM_VERSION_MAJOR 4
#define DM_VERSION_MINOR 3
#define DM_VERSION_MINOR 4
#define DM_VERSION_PATCHLEVEL 0
#define DM_VERSION_EXTRA "-ioctl (2004-09-30)"
#define DM_VERSION_EXTRA "-ioctl (2005-01-12)"
/* Status bits */
#define DM_READONLY_FLAG (1 << 0) /* In/Out */
......@@ -300,4 +300,9 @@ typedef char ioctl_struct[308];
*/
#define DM_BUFFER_FULL_FLAG (1 << 8) /* Out */
/*
* Set this to improve performance when you aren't going to use open_count
*/
#define DM_SKIP_BDGET_FLAG (1 << 9) /* In */
#endif /* _LINUX_DM_IOCTL_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment