[2.1.49] /proc/swaps [patch]

Henrik Wallin (henrik@triton.campus.luth.se)
Thu, 14 Aug 1997 22:02:40 +0200 (CEST)


In 2.1.49 and maybe some kernels before that:

root ~ > cat /proc/swaps
Filename Type Size Used Priority
hdc1 file 102540 0 10

hdc1 ( /dev/hdc1 ) and is a _partition_ ...

The following patch fixes this bug. In a correct way I hope :)

/ Henrik Wallin, henrik@triton.campus.luth.se

--- mm/swapfile.c~ Thu Aug 14 21:02:10 1997
+++ mm/swapfile.c Thu Aug 14 21:04:54 1997
@@ -423,7 +423,7 @@
if (ptr->flags & SWP_USED) {
len += sprintf(buf + len, "%-31s ", ptr->swap_file->d_name.name);

- if (ptr->swap_file)
+ if (!ptr->swap_device)
len += sprintf(buf + len, "file\t\t");
else
len += sprintf(buf + len, "partition\t");