slabinfo: fall back from /sys/kernel/slab to /sys/slab

I keep running upstream and mm kernels and the location of the slab
directory is different since upstream still uses /sys/slab.  This patch
makes slabinfo check /sys/slab if /sys/kernel/slab is not there.  Makes
slabinfo work on any kernel.

Signed-off-by: Christoph Lameter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
Christoph Lameter 2008-02-04 23:35:48 -08:00 • committed by Greg Kroah-Hartman
commit b6c24de77c

View file

@ -1123,7 +1123,7 @@ void read_slab_dir(void)
char *t;
int count;
if (chdir("/sys/kernel/slab"))
if (chdir("/sys/kernel/slab") && chdir("/sys/slab"))
fatal("SYSFS support for SLUB not active\n");
dir = opendir(".");