This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch andyp-portability
in repository gfs2-utils.
commit e12804581c1a8afd8442277777cb3e0723d6c823
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Thu Aug 18 16:40:06 2022 +0100
Remove dependency on linux/fs.h
We're only using this kernel header for device geometry ioctl
definitions and the latest sys/mount.h provided by glibc provides them.
Make sure we have fallback definitions for all of the ones we use.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
configure.ac | 1 -
gfs2/convert/gfs2_convert.c | 8 ++++----
gfs2/libgfs2/device_geometry.c | 15 ++++++++++-----
3 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/configure.ac b/configure.ac
index 8774b15b..11b9a66d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -141,7 +141,6 @@ AC_SUBST([testvol], [$with_testvol])
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h mntent.h stddef.h sys/file.h
sys/ioctl.h sys/mount.h sys/time.h sys/vfs.h syslog.h termios.h])
-AC_CHECK_HEADER([linux/fs.h], [], [AC_MSG_ERROR([Unable to find linux/fs.h])])
AC_CHECK_HEADER([linux/limits.h], [], [AC_MSG_ERROR([Unable to find linux/limits.h])])
# *FLAGS handling
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 0b8f3d92..de0a9b02 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -1178,10 +1178,10 @@ static int process_dirent_info(struct lgfs2_inode *dip, struct
lgfs2_sbd *sbp,
/* Fix the dirent's filename hash: They are the same as gfs1 */
/* dent->de_hash = cpu_to_be32(gfs2_disk_hash((char *)(dent + 1), */
/* be16_to_cpu(dent->de_name_len))); */
- /* Fix the dirent's file type. Gfs1 used home-grown values. */
- /* Gfs2 uses standard values from include/linux/fs.h */
- /* Only do this if the dent was a true gfs1 dent, and not a */
- /* gfs2 dent converted from a previously aborted run. */
+ /* Fix the dirent's file type. gfs1 used home-grown values.
+ gfs2 uses standard values from include/dirent.h. Only do
+ this if the dent was a true gfs1 dent, and not a gfs2 dent
+ converted from a previously aborted run. */
if (dent_was_gfs1) {
switch (be16_to_cpu(dent->de_type)) {
case GFS_FILE_NON:
diff --git a/gfs2/libgfs2/device_geometry.c b/gfs2/libgfs2/device_geometry.c
index 1950d017..df0c3d95 100644
--- a/gfs2/libgfs2/device_geometry.c
+++ b/gfs2/libgfs2/device_geometry.c
@@ -11,26 +11,31 @@
#include <unistd.h>
#include <errno.h>
#include <sys/ioctl.h>
-#include <linux/fs.h>
+#include <sys/mount.h>
#include "libgfs2.h"
+#ifndef BLKROGET
+#define BLKROGET _IO(0x12, 94) /* ro */
+#endif
+#ifndef BLKRAGET
+#define BLKRAGET _IO(0x12, 99) /* ra_pages */
+#endif
#ifndef BLKSSZGET
#define BLKSSZGET _IO(0x12,104) /* logical_block_size */
#endif
-
+#ifndef BLKBSZGET
+#define BLKBSZGET _IOR(0x12, 112, size_t) /* soft_block_size */
+#endif
#ifndef BLKIOMIN
#define BLKIOMIN _IO(0x12,120) /* minimum_io_size */
#endif
-
#ifndef BLKIOOPT
#define BLKIOOPT _IO(0x12,121) /* optimal_io_size */
#endif
-
#ifndef BLKALIGNOFF
#define BLKALIGNOFF _IO(0x12,122) /* alignment_offset */
#endif
-
#ifndef BLKPBSZGET
#define BLKPBSZGET _IO(0x12,123) /* physical_block_size */
#endif
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date