]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs/rdwr.c uses platform specific memalign paramater.
authorMadan Valluri <mvalluri@sgi.com>
Tue, 4 Jul 2006 14:51:22 +0000 (14:51 +0000)
committerMadan Valluri <mvalluri@sgi.com>
Tue, 4 Jul 2006 14:51:22 +0000 (14:51 +0000)
Implement platform_memalignment function.

libxfs/darwin.c
libxfs/freebsd.c
libxfs/init.h
libxfs/irix.c
libxfs/linux.c
libxfs/rdwr.c

index 4cdbe7e900f6d35ea088bb3d87d08ed6694d8607..60780b049a55efa95e0907f6c9c3c468c0288fa4 100644 (file)
@@ -100,3 +100,9 @@ platform_findrawpath(char *path)
 {
        return (path);
 }
+
+size_t
+platform_memalignment(void)
+{
+       return sizeof(void *);
+}
index 845533b0bfcfc34eb441392415467ac4ee1aee8c..26ef3a10f095953b8700003af97cbd216e7d75be 100644 (file)
@@ -160,3 +160,9 @@ platform_findrawpath(char *path)
 {
        return (path);
 }
+
+size_t
+platform_memalignment(void)
+{
+       return sizeof(void *);
+}
index d54d8d4dc42553ace755c984a82f9bea4d618ee0..4fc62841c2d1c1f6c5fd5b4299c0ca298e2a0679 100644 (file)
@@ -29,4 +29,5 @@ extern void platform_set_blocksize (int fd, char *path, int blocksize);
 extern void platform_flush_device (int fd, dev_t device);
 extern char *platform_findrawpath(char *path);
 extern int platform_aio_init(int aio_count);
+extern size_t platform_memalignment(void);
 #endif /* LIBXFS_INIT_H */
index 28f471d91e5b299724797cc154195c2f0aaf4a19..d37a9783ae95fdc643d33551e317ace1f7c3ba72 100644 (file)
@@ -84,3 +84,9 @@ platform_findrawpath(char *path)
 {
        return findrawpath(path);
 }
+
+size_t
+platform_memalignment(void)
+{
+       return sizeof(void *);
+}
index 2b2d59440ac88a5ebeba44e65c150391b1fa8bc8..8189049328685156f167b5afd143342127e6abf0 100644 (file)
@@ -180,3 +180,9 @@ platform_findrawpath(char *path)
 {
        return (path);
 }
+
+size_t
+platform_memalignment(void)
+{
+       return getpagesize();
+}
index 24648c1762e30ea00750f5e52b8a1bb76b980be9..9c9be01b0ae39798ce0388f30b27360d2c029bd8 100644 (file)
@@ -19,6 +19,7 @@
 #include <xfs/libxfs.h>
 #include <xfs/xfs_log.h>
 #include <xfs/xfs_log_priv.h>
+#include "init.h"
 
 #define BDSTRAT_SIZE   (256 * 1024)
 #define min(x, y)      ((x) < (y) ? (x) : (y))
 static inline void *
 libxfs_memalign(size_t size)
 {
-       static size_t   pagealign;
+       static size_t   memalignment;
 
-       if (!pagealign)
-               pagealign = getpagesize();
-       return memalign(pagealign, size);
+       if (!memalignment)
+               memalignment = platform_memalignment();
+       return memalign(memalignment, size);
 }
 
 void