Skip to content

Commit

Permalink
staging: zcache: fix ppc64 and other arches where PAGE_SIZE!=4K
Browse files Browse the repository at this point in the history
Replace raw constant 12 with PAGE_SHIFT to fix non-x86 arches and
provoke build failure if PAGE_SHIFT is too big

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Dan Magenheimer authored and Greg Kroah-Hartman committed Jan 25, 2013
1 parent c4048c6 commit e49ee36
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/staging/zcache/zbud.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,18 @@ struct zbudpage {
struct {
unsigned long space_for_flags;
struct {
unsigned zbud0_size:12;
unsigned zbud1_size:12;
unsigned zbud0_size: PAGE_SHIFT;
unsigned zbud1_size: PAGE_SHIFT;
unsigned unevictable:2;
};
struct list_head budlist;
struct list_head lru;
};
};
};
#if (PAGE_SHIFT * 2) + 2 > BITS_PER_LONG
#error "zbud won't work for this arch, PAGE_SIZE is too large"
#endif

struct zbudref {
union {
Expand Down

0 comments on commit e49ee36

Please sign in to comment.