From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boaz Harrosh Subject: Re: [RFC 5/9] SQUASHME: prd: Last fixes for partitions Date: Thu, 14 Aug 2014 16:04:53 +0300 Message-ID: <53ECB3F5.9020001@plexistor.com> References: <53EB5536.8020702@gmail.com> <53EB5709.4090401@plexistor.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit To: Boaz Harrosh , Ross Zwisler , linux-fsdevel , Andrew Morton , linux-mm@kvack.org, Matthew Wilcox , Sagi Manole , Yigal Korman Return-path: In-Reply-To: <53EB5709.4090401@plexistor.com> Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On 08/13/2014 03:16 PM, Boaz Harrosh wrote: > From: Boaz Harrosh > > This streamlines prd with the latest brd code. > > In prd we do not allocate new devices dynamically on devnod > access, because we need parameterization of each device. So > the dynamic allocation in prd_init_one is removed. > > Therefor prd_init_one only called from prd_prob is moved > there, now that it is small. > > And other small fixes regarding partitions > > Signed-off-by: Boaz Harrosh > --- > drivers/block/prd.c | 47 ++++++++++++++++++++++++----------------------- > 1 file changed, 24 insertions(+), 23 deletions(-) > > diff --git a/drivers/block/prd.c b/drivers/block/prd.c > index 62af81e..c4aeba7 100644 > --- a/drivers/block/prd.c > +++ b/drivers/block/prd.c > @@ -218,13 +218,13 @@ static long prd_direct_access(struct block_device *bdev, sector_t sector, > { > struct prd_device *prd = bdev->bd_disk->private_data; > > - if (!prd) > + if (unlikely(!prd)) > return -ENODEV; > > *kaddr = prd_lookup_pg_addr(prd, sector); > *pfn = prd_lookup_pfn(prd, sector); > > - return size; > + return min_t(long, size, prd->size); This is off course a BUG need to subtract offset, will send version 2 Boaz <> -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org