X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fpartmap.h;h=1be70ded414e3977e2863be99b8c049120da0c32;hb=f635f4d406f772b54455331cdf23cc10a361392a;hp=b5c480996e988945726f6304c0135829f2016f96;hpb=a372c96ccaa1c49942947b6a13b2b915a4318f19;p=libucw.git diff --git a/lib/partmap.h b/lib/partmap.h index b5c48099..1be70ded 100644 --- a/lib/partmap.h +++ b/lib/partmap.h @@ -1,7 +1,7 @@ /* * UCW Library -- Mapping of File Parts * - * (c) 2003 Martin Mares + * (c) 2003--2006 Martin Mares * (c) 2003--2005 Robert Spalek * * This software may be freely distributed and used according to the terms @@ -25,18 +25,22 @@ sh_off_t partmap_size(struct partmap *p); void partmap_load(struct partmap *p, sh_off_t start, uns size); static inline void * -partmap_map(struct partmap *p, sh_off_t start, uns size) +partmap_map(struct partmap *p, sh_off_t start, uns size UNUSED) { +#ifndef CONFIG_PARTMAP_IS_MMAP if (unlikely(!p->start_map || start < p->start_off || (sh_off_t) (start+size) > p->end_off)) partmap_load(p, start, size); +#endif return p->start_map + (start - p->start_off); } static inline void * -partmap_map_forward(struct partmap *p, sh_off_t start, uns size) +partmap_map_forward(struct partmap *p, sh_off_t start, uns size UNUSED) { +#ifndef CONFIG_PARTMAP_IS_MMAP if (unlikely((sh_off_t) (start+size) > p->end_off)) partmap_load(p, start, size); +#endif return p->start_map + (start - p->start_off); }