[gfs2-utils] 03/03: README: Remove kernel headers requirement
by pagure@pagure.io
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 7a83f72de78b7dfa9c2160ae4ec72515642932ad
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Thu Aug 18 17:24:56 2022 +0100
README: Remove kernel headers requirement
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
README.md | 3 ---
1 file changed, 3 deletions(-)
diff --git a/README.md b/README.md
index 499934eb..1921e28f 100644
--- a/README.md
+++ b/README.md
@@ -24,9 +24,6 @@ The following development packages are required to build gfs2-utils:
* libuuid
* check (optional, enables unit tests)
-The kernel header `include/linux/gfs2-ondisk.h` and its dependencies are also
-required.
-
### How to build
To build gfs2-utils, run the following commands:
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
1 year, 8 months
[gfs2-utils] 02/03: Remove dependency on linux/limits.h
by pagure@pagure.io
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 86269738dbe92ef2efbf59cc144b61284d1d6289
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Thu Aug 18 17:21:37 2022 +0100
Remove dependency on linux/limits.h
The uses of PATH_MAX and NAME_MAX can be replaced by GFS2_FNAMESIZE in
some cases and just by declaring a sensibly sized string in another.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
configure.ac | 1 -
gfs2/fsck/main.c | 7 ++++---
gfs2/fsck/metawalk.c | 2 +-
gfs2/fsck/pass1.c | 2 +-
gfs2/libgfs2/libgfs2.h | 1 -
5 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index 11b9a66d..031d1014 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/limits.h], [], [AC_MSG_ERROR([Unable to find linux/limits.h])])
# *FLAGS handling
ENV_CFLAGS="$CFLAGS"
diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c
index 42114e53..fa8870c1 100644
--- a/gfs2/fsck/main.c
+++ b/gfs2/fsck/main.c
@@ -124,12 +124,13 @@ static int read_cmdline(int argc, char **argv, struct fsck_options *gopts)
static void interrupt(int sig)
{
char response;
- char progress[PATH_MAX];
+ char progress[1024];
if (!last_reported_block || last_reported_block == last_fs_block)
- sprintf(progress, _("progress unknown.\n"));
+ snprintf(progress, sizeof(progress), _("progress unknown.\n"));
else
- sprintf(progress, _("processing block %"PRIu64" out of %"PRIu64"\n"),
+ snprintf(progress, sizeof(progress),
+ _("processing block %"PRIu64" out of %"PRIu64"\n"),
last_reported_block, last_fs_block);
response = generic_interrupt("fsck.gfs2", pass_name, progress,
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 9fb36aac..78adeb41 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -341,7 +341,7 @@ static int dirent_repair(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
/* There can often be noise at the end, so only */
/* Trust the shorter of the two in case we have too much */
/* Or rather, only trust ours if it's shorter. */
- if (!d->dr_name_len || d->dr_name_len > NAME_MAX ||
+ if (!d->dr_name_len || d->dr_name_len > GFS2_FNAMESIZE ||
calc_de_name_len < d->dr_name_len) /* if dent is hosed */
d->dr_name_len = calc_de_name_len; /* use ours */
d->dr_rec_len = GFS2_DIRENT_SIZE(d->dr_name_len);
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index deac85cf..528a400b 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -181,7 +181,7 @@ static int resuscitate_dentry(struct fsck_cx *cx, struct lgfs2_inode *ip, struct
{
struct lgfs2_sbd *sdp = ip->i_sbd;
struct lgfs2_dirent d;
- char tmp_name[PATH_MAX];
+ char tmp_name[GFS2_FNAMESIZE];
uint64_t block;
lgfs2_dirent_in(&d, dent);
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 77753bfc..34c9dfa1 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -8,7 +8,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/uio.h>
-#include <linux/limits.h>
#include <endian.h>
#include <byteswap.h>
#include <mntent.h>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
1 year, 8 months
[gfs2-utils] 01/03: Remove dependency on linux/fs.h
by pagure@pagure.io
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.
1 year, 8 months
[gfs2-utils] branch andyp-portability created (now 7a83f72d)
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a change to branch andyp-portability
in repository gfs2-utils.
at 7a83f72d README: Remove kernel headers requirement
This branch includes the following new commits:
new e1280458 Remove dependency on linux/fs.h
new 86269738 Remove dependency on linux/limits.h
new 7a83f72d README: Remove kernel headers requirement
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
1 year, 8 months