FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 07-15-2011, 07:23 PM
Mike Snitzer
 
Default dm table: fold __table_get_device into dm_get_device

There is no need for __table_get_device to be factored out.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
drivers/md/dm-table.c | 42 ++++++++++++++++++------------------------
1 files changed, 18 insertions(+), 24 deletions(-)

diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 15c9ff4..e966a40 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -451,13 +451,14 @@ static int upgrade_mode(struct dm_dev_internal *dd, fmode_t new_mode,
* Add a device to the list, or just increment the usage count if
* it's already present.
*/
-static int __table_get_device(struct dm_table *t, struct dm_target *ti,
- const char *path, fmode_t mode, struct dm_dev **result)
+int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode,
+ struct dm_dev **result)
{
int r;
dev_t uninitialized_var(dev);
struct dm_dev_internal *dd;
unsigned int major, minor;
+ struct dm_table *t = ti->table;

BUG_ON(!t);

@@ -506,6 +507,21 @@ static int __table_get_device(struct dm_table *t, struct dm_target *ti,
return 0;
}

+/*
+ * Decrement a devices use count and remove it if necessary.
+ */
+void dm_put_device(struct dm_target *ti, struct dm_dev *d)
+{
+ struct dm_dev_internal *dd = container_of(d, struct dm_dev_internal,
+ dm_dev);
+
+ if (atomic_dec_and_test(&dd->count)) {
+ close_dev(dd, ti->table->md);
+ list_del(&dd->list);
+ kfree(dd);
+ }
+}
+
int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
sector_t start, sector_t len, void *data)
{
@@ -542,28 +558,6 @@ int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
}
EXPORT_SYMBOL_GPL(dm_set_device_limits);

-int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode,
- struct dm_dev **result)
-{
- return __table_get_device(ti->table, ti, path, mode, result);
-}
-
-
-/*
- * Decrement a devices use count and remove it if necessary.
- */
-void dm_put_device(struct dm_target *ti, struct dm_dev *d)
-{
- struct dm_dev_internal *dd = container_of(d, struct dm_dev_internal,
- dm_dev);
-
- if (atomic_dec_and_test(&dd->count)) {
- close_dev(dd, ti->table->md);
- list_del(&dd->list);
- kfree(dd);
- }
-}
-
/*
* Checks to see if the target joins onto the end of the table.
*/
--
1.7.1

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 12:17 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org