PKGBUILDs/extra/evms/evms-2.5.5-pagesize.patch
2009-10-09 21:23:22 -05:00

58 lines
2.2 KiB
Diff

Index: evms-2.5.5/plugins/swap/swapfs.c
===================================================================
--- evms-2.5.5.orig/plugins/swap/swapfs.c
+++ evms-2.5.5/plugins/swap/swapfs.c
@@ -27,7 +27,6 @@
#include <plugin.h>
#include <fcntl.h>
#include <sys/wait.h>
-#include <asm/page.h> /* to get PAGE_SIZE */
#include <sys/swap.h>
#include "swapfs.h"
@@ -341,7 +340,7 @@ static int swap_get_fs_limits(logical_vo
*max_volume_size = (sector_count_t)-1; /* No limit. */
*max_object_size = (sector_count_t)-1; /* No limit. */
- *min_size = (sector_count_t)(PAGE_SIZE * 10); /* 10 page minimum. */
+ *min_size = (sector_count_t)(sysconf(_SC_PAGESIZE) * 10); /* 10 page minimum. */
LOG_EXTRA("Volume: %s, min: %"PRIu64", max: %"PRIu64"\n",
volume->name, *min_size, *max_volume_size);
Index: evms-2.5.5/plugins/swap/swapfs.h
===================================================================
--- evms-2.5.5.orig/plugins/swap/swapfs.h
+++ evms-2.5.5/plugins/swap/swapfs.h
@@ -47,8 +47,8 @@ extern engine_functions_t *EngFncs;
#define PUT 1
#define SWAPFS_MAGIC_STRING "SWAP_SPACE"
#define SWAPFS_MAGIC_STRING2 "SWAPSPACE2"
-#define SWAPFS_MIN_SIZE (PAGE_SIZE / EVMS_VSECTOR_SIZE * 10)
-#define SWAP_MAGIC_OFFSET_IN_BYTES (PAGE_SIZE - 10) /* last 10 bytes of first page */
+#define SWAPFS_MIN_SIZE (sysconf(_SC_PAGESIZE) / EVMS_VSECTOR_SIZE * 10)
+#define SWAP_MAGIC_OFFSET_IN_BYTES (sysconf(_SC_PAGESIZE) - 10) /* last 10 bytes of first page */
#define EVMS_Task_swapon EVMS_Task_Plugin_Function + 1
#define EVMS_Task_swapoff EVMS_Task_Plugin_Function + 2
Index: evms-2.5.5/plugins/xfs/fsimxfs.h
===================================================================
--- evms-2.5.5.orig/plugins/xfs/fsimxfs.h
+++ evms-2.5.5/plugins/xfs/fsimxfs.h
@@ -19,7 +19,7 @@
*/
#include <uuid/uuid.h>
-#include <asm/page.h>
+#include <unistd.h>
extern plugin_record_t xfs_plugin_record;
extern plugin_record_t * my_plugin_record;
@@ -165,7 +165,7 @@ typedef struct xfs_volume {
* superblock. This is not the same as the superblock structure, since all of
* this space is not currently being used.
*/
-#define SIZE_OF_SUPER PAGE_SIZE
+#define SIZE_OF_SUPER sysconf(_SC_PAGESIZE)
/* Fixed byte offset of primary superblock */
#define XFS_SUPER1_OFF 0x00