Commit 0901c174 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] dm: Move to_bytes() and to_sectors() into dm.h

From: Joe Thornber <thornber@redhat.com>

Move to_bytes() and to_sectors() into dm.h
parent c087ec3d
...@@ -233,15 +233,6 @@ static int queue_io(struct mapped_device *md, struct bio *bio) ...@@ -233,15 +233,6 @@ static int queue_io(struct mapped_device *md, struct bio *bio)
* interests of getting something for people to use I give * interests of getting something for people to use I give
* you this clearly demarcated crap. * you this clearly demarcated crap.
*---------------------------------------------------------------*/ *---------------------------------------------------------------*/
static inline sector_t to_sector(unsigned int bytes)
{
return bytes >> SECTOR_SHIFT;
}
static inline unsigned int to_bytes(sector_t sector)
{
return sector << SECTOR_SHIFT;
}
/* /*
* Decrements the number of outstanding ios that a bio has been * Decrements the number of outstanding ios that a bio has been
......
...@@ -151,6 +151,16 @@ static inline unsigned long dm_div_up(unsigned long n, unsigned long size) ...@@ -151,6 +151,16 @@ static inline unsigned long dm_div_up(unsigned long n, unsigned long size)
return dm_round_up(n, size) / size; return dm_round_up(n, size) / size;
} }
static inline sector_t to_sector(unsigned long n)
{
return (n >> 9);
}
static inline unsigned long to_bytes(sector_t n)
{
return (n << 9);
}
/* /*
* The device-mapper can be driven through one of two interfaces; * The device-mapper can be driven through one of two interfaces;
* ioctl or filesystem, depending which patch you have applied. * ioctl or filesystem, depending which patch you have applied.
......
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