reiserfsprogs: update to 3.6.27.

This commit is contained in:
Rasmus Thomsen 2019-01-08 17:56:15 +01:00 committed by maxice8
parent ae7aaf7b22
commit 9ed466fa4b
8 changed files with 215 additions and 1748 deletions

View file

@ -1,16 +0,0 @@
Add a library check for musl-obstack package
--- configure.ac 2013-08-26 22:55:43.000000000 +0200
+++ configure.ac 2015-09-10 09:21:53.809280964 +0200
@@ -29,6 +29,11 @@
UUID_LIBS="$LIBS"
AC_SUBST(UUID_LIBS)
+# Check for LIBOBSTACK
+AC_CHECK_LIB(obstack, _obstack_begin, , AC_MSG_WARN(libobstack could not be found))
+OBSTACK_LIBS="$LIBS"
+AC_SUBST(OBSTACK_LIBS)
+
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/ioctl.h unistd.h uuid/uuid.h)

File diff suppressed because it is too large Load diff

View file

@ -2,25 +2,17 @@ Define _GNU_SOURCE for the declaration of loff_t in fcntl.h
Add missing typedefs for __compar_fn_t and compare_fn_t for
non __GLIBC__ case.
--- include/misc.h 2013-08-26 22:55:43.000000000 +0200
+++ include/misc.h 2015-09-03 19:44:24.636873860 +0200
@@ -12,6 +12,7 @@
# include "config.h"
#endif
+#define _GNU_SOURCE
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
@@ -34,6 +35,11 @@
#define INVAL_PTR (void *)-1
--- include/misc.h
+++ include/misc.h
@@ -35,6 +35,11 @@
#define INVAL_PTR (void *)-1
+#if !defined(__GLIBC__)
+typedef int (*__compar_fn_t) (const void*, const void*);
+typedef __compar_fn_t comparison_fn_t;
+#endif
+
void check_memory_msg(void);
void die (char * fmt, ...) __attribute__ ((format (printf, 1, 2)));
void * getmem (int size);
void die(const char *fmt, ...) __attribute__ ((format(printf, 1, 2)));
void *getmem(int size);

View file

@ -0,0 +1,14 @@
See https://www.openwall.com/lists/musl/2013/01/23/6
--- include/reiserfs_lib.h
+++ include/reiserfs_lib.h
@@ -3,6 +3,10 @@
* reiserfsprogs/README
*/
+#if !defined(__GLIBC__)
+#define loff_t off_t
+#endif
+
#ifndef REISERFSPROGS_LIB_H
#define REISERFSPROGS_LIB_H

View file

@ -1,8 +1,8 @@
Add definitions for LONG_LONG_MIN and _MAX derived
from the values for int64_t.
--- resize_reiserfs/resize_reiserfs.c 2013-08-26 22:55:43.000000000 +0200
+++ resize_reiserfs/resize_reiserfs.c 2015-09-10 09:30:46.617279386 +0200
--- resize_reiserfs/resize_reiserfs.c
+++ resize_reiserfs/resize_reiserfs.c
@@ -15,6 +15,13 @@
#include "resize.h"
#include <limits.h>
@ -14,6 +14,6 @@ from the values for int64_t.
+#define LONG_LONG_MAX INT64_MAX
+#endif
+
int opt_banner = 0;
static int opt_banner = 0;
static int opt_skipj = 0;
int opt_force = 0;
int opt_verbose = 1; /* now "verbose" option is default */

View file

@ -1,13 +1,5 @@
--- reiserfscore/prints.c 2013-08-26 22:55:43.000000000 +0200
+++ reiserfscore/prints.c 2015-09-10 19:22:02.791317465 +0200
@@ -1,5 +1,5 @@
-/*
- * Copyright 1996-2004 by Hans Reiser, licensing governed by
+/*
+ * Copyright 1996-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
--- reiserfscore/prints.c
+++ reiserfscore/prints.c
@@ -7,8 +7,11 @@
#include "includes.h"
@ -20,7 +12,7 @@
#include <limits.h>
#include <time.h>
@@ -16,6 +19,37 @@
@@ -16,6 +19,38 @@
# include <uuid/uuid.h>
#endif
@ -28,19 +20,19 @@
+char ftypelet (mode_t mode)
+{
+ if (S_ISBLK (mode))
+ return 'b';
+ return 'b';
+ if (S_ISCHR (mode))
+ return 'c';
+ return 'c';
+ if (S_ISDIR (mode))
+ return 'd';
+ return 'd';
+ if (S_ISREG (mode))
+ return '-';
+ return '-';
+ if (S_ISFIFO (mode))
+ return 'p';
+ return 'p';
+ if (S_ISLNK (mode))
+ return 'l';
+ return 'l';
+ if (S_ISSOCK (mode))
+ return 's';
+ return 's';
+ return '?';
+}
+
@ -48,536 +40,189 @@
+static int rwx (FILE * stream, mode_t mode)
+{
+ return fprintf (stream, "%c%c%c",
+ (mode & S_IRUSR) ? 'r' : '-',
+ (mode & S_IWUSR) ? 'w' : '-',
+ (mode & S_IXUSR) ? 'x' : '-');
+ (mode & S_IRUSR) ? 'r' : '-',
+ (mode & S_IWUSR) ? 'w' : '-',
+ (mode & S_IXUSR) ? 'x' : '-');
+}
+
+#if defined(__GLIBC__)
+
+
#ifndef HAVE_REGISTER_PRINTF_SPECIFIER
#define register_printf_specifier(x, y, z) register_printf_function(x, y, z)
static int arginfo_ptr (const struct printf_info *info, size_t n,
@@ -86,7 +120,7 @@
int len;
key = *((const struct key **)(args[0]));
- len = asprintf (&buffer, "[%u %u 0x%Lx %s (%d)]",
+ len = asprintf (&buffer, "[%u %u 0x%Lx %s (%d)]",
get_key_dirid (key), get_key_objectid (key),
(unsigned long long)get_offset (key), key_of_what (key), get_type (key));
FPRINTF;
@@ -109,7 +143,7 @@
(unsigned long long)get_offset (&ih->ih_key), key_of_what (&ih->ih_key),
get_type (&ih->ih_key), get_ih_item_len (ih), get_ih_location (ih),
get_ih_entry_count (ih), get_ih_flags (ih),
- get_ih_key_format (ih) == KEY_FORMAT_2 ? "new" :
+ get_ih_key_format (ih) == KEY_FORMAT_2 ? "new" :
((get_ih_key_format (ih) == KEY_FORMAT_1) ? "old" : "BAD"));
FPRINTF;
}
@@ -130,35 +164,6 @@
static int arginfo_ptr(const struct printf_info *info, size_t n, int *argtypes)
@@ -129,33 +164,6 @@ static int print_disk_child(FILE * stream,
FPRINTF;
}
-char ftypelet (mode_t mode)
-char ftypelet(mode_t mode)
-{
- if (S_ISBLK (mode))
- return 'b';
- if (S_ISCHR (mode))
- return 'c';
- if (S_ISDIR (mode))
- return 'd';
- if (S_ISREG (mode))
- return '-';
- if (S_ISFIFO (mode))
- return 'p';
- if (S_ISLNK (mode))
- return 'l';
- if (S_ISSOCK (mode))
- return 's';
- return '?';
- if (S_ISBLK(mode))
- return 'b';
- if (S_ISCHR(mode))
- return 'c';
- if (S_ISDIR(mode))
- return 'd';
- if (S_ISREG(mode))
- return '-';
- if (S_ISFIFO(mode))
- return 'p';
- if (S_ISLNK(mode))
- return 'l';
- if (S_ISSOCK(mode))
- return 's';
- return '?';
-}
-
-
-static int rwx (FILE * stream, mode_t mode)
-static int rwx(FILE * stream, mode_t mode)
-{
- return fprintf (stream, "%c%c%c",
- (mode & S_IRUSR) ? 'r' : '-',
- (mode & S_IWUSR) ? 'w' : '-',
- (mode & S_IXUSR) ? 'x' : '-');
- return fprintf(stream, "%c%c%c",
- (mode & S_IRUSR) ? 'r' : '-',
- (mode & S_IWUSR) ? 'w' : '-',
- (mode & S_IXUSR) ? 'x' : '-');
-}
-
-
/* %M */
static int print_sd_mode (FILE * stream,
const struct printf_info *info,
@@ -192,14 +197,14 @@
#endif
static int print_sd_mode(FILE * stream,
const struct printf_info *info,
@@ -211,6 +219,140 @@ void reiserfs_warning(FILE * fp, const char *fmt, ...)
va_end(args);
}
-void reiserfs_warning (FILE * fp, const char * fmt, ...)
+void reiserfs_warning (FILE * fp, const char * fmt, ...)
{
static int registered = 0;
va_list args;
if (!registered) {
registered = 1;
-
+
register_printf_specifier ('K', print_short_key, arginfo_ptr);
register_printf_specifier ('k', print_key, arginfo_ptr);
register_printf_specifier ('H', print_item_head, arginfo_ptr);
@@ -214,6 +219,140 @@
va_end (args);
}
+#else /* defined(__GLIBC__) */
+#else /* defined(__GLIBC__) */
+
+typedef void* void_ptr;
+
+void reiserfs_warning (FILE * fp, const char * fmt, ...)
+{
+ char * buffer;
+ int len;
+ char format_buf[32];
+ char* dst = format_buf;
+ char* end = &dst[30];
+ const struct buffer_head * bh;
+ const struct item_head * ih;
+ const struct disk_child * dc;
+ const struct key * key;
+ uint16_t mode;
+ char * buffer;
+ int len;
+ char format_buf[32];
+ char* dst = format_buf;
+ char* end = &dst[30];
+ const struct buffer_head * bh;
+ const struct item_head * ih;
+ const struct disk_child * dc;
+ const struct reiserfs_key * key;
+ uint16_t mode;
+#if defined(HAVE_LIBUUID) && defined(HAVE_UUID_UUID_H)
+ const unsigned char *uuid;
+ char uuid_buf[37];
+ const unsigned char *uuid;
+ char uuid_buf[37];
+#endif
+ va_list args;
+ int esc = 0;
+ va_list args;
+ int esc = 0;
+
+ va_start (args, fmt);
+ while (*fmt) {
+ int ch = *fmt++;
+ if (esc) {
+ switch (ch) {
+ case '%':
+ fputc(ch, fp);
+ esc = 0;
+ break;
+ case 'b': // block head
+ bh = (const struct buffer_head *) va_arg(args, void_ptr);
+ len = asprintf(&buffer, "level=%d, nr_items=%d, free_space=%d rdkey",
+ B_LEVEL (bh), B_NR_ITEMS (bh), B_FREE_SPACE (bh));
+ *dst++ = 's';
+ *dst = '\0';
+ fprintf(fp, format_buf, buffer);
+ esc = 0;
+ break;
+ case 'K': // short key
+ key = (const struct key *) va_arg(args, void_ptr);
+ len = asprintf(&buffer, "[%u %u]", get_key_dirid (key),
+ get_key_objectid (key));
+ *dst++ = 's';
+ *dst = '\0';
+ fprintf(fp, format_buf, buffer);
+ esc = 0;
+ break;
+ case 'k': // key
+ key = (const struct key *) va_arg(args, void_ptr);
+ len = asprintf(&buffer, "[%u %u 0x%Lx %s (%d)]",
+ get_key_dirid (key), get_key_objectid (key),
+ (unsigned long long)get_offset (key), key_of_what (key), get_type (key));
+ *dst++ = 's';
+ *dst = '\0';
+ fprintf(fp, format_buf, buffer);
+ esc = 0;
+ break;
+ case 'H': // item head
+ ih = (const struct item_head *) va_arg(args, void_ptr);
+ len = asprintf(&buffer, "%u %u 0x%Lx %s (%d), "
+ "len %u, location %u entry count %u, fsck need %u, format %s",
+ get_key_dirid (&ih->ih_key), get_key_objectid (&ih->ih_key),
+ (unsigned long long)get_offset (&ih->ih_key), key_of_what (&ih->ih_key),
+ get_type (&ih->ih_key), get_ih_item_len (ih), get_ih_location (ih),
+ get_ih_entry_count (ih), get_ih_flags (ih),
+ get_ih_key_format (ih) == KEY_FORMAT_2 ?
+ "new" :
+ ((get_ih_key_format (ih) == KEY_FORMAT_1) ? "old" : "BAD"));
+ *dst++ = 's';
+ *dst = '\0';
+ fprintf(fp, format_buf, buffer);
+ esc = 0;
+ break;
+ case 'y': // disk child
+ dc = (const struct disk_child *) va_arg(args, void_ptr);
+ len = asprintf(&buffer, "[dc_number=%u, dc_size=%u]", get_dc_child_blocknr (dc),
+ get_dc_child_size (dc));
+ *dst++ = 's';
+ *dst = '\0';
+ fprintf(fp, format_buf, buffer);
+ esc = 0;
+ break;
+ case 'M': // sd mode
+ mode = (mode_t) va_arg(args, void_ptr);
+ fputc(ftypelet (mode), fp);
+ rwx (fp, (mode & 0700) << 0);
+ rwx (fp, (mode & 0070) << 3);
+ rwx (fp, (mode & 0007) << 6);
+ esc = 0;
+ break;
+ case 'U': // UUID
+ va_start (args, fmt);
+ while (*fmt) {
+ int ch = *fmt++;
+ if (esc) {
+ switch (ch) {
+ case '%':
+ fputc(ch, fp);
+ esc = 0;
+ break;
+ case 'b': // block head
+ bh = (const struct buffer_head *) va_arg(args, void_ptr);
+ len = asprintf(&buffer, "level=%d, nr_items=%d, free_space=%d rdkey",
+ B_LEVEL (bh), B_NR_ITEMS (bh), B_FREE_SPACE (bh));
+ *dst++ = 's';
+ *dst = '\0';
+ fprintf(fp, format_buf, buffer);
+ esc = 0;
+ break;
+ case 'K': // short key
+ key = (const struct reiserfs_key *) va_arg(args, void_ptr);
+ len = asprintf(&buffer, "[%u %u]", get_key_dirid (key),
+ get_key_objectid (key));
+ *dst++ = 's';
+ *dst = '\0';
+ fprintf(fp, format_buf, buffer);
+ esc = 0;
+ break;
+ case 'k': // key
+ key = (const struct reiserfs_key *) va_arg(args, void_ptr);
+ len = asprintf(&buffer, "[%u %u 0x%Lx %s (%d)]",
+ get_key_dirid (key), get_key_objectid (key),
+ (unsigned long long)get_offset (key), key_of_what (key), get_type (key));
+ *dst++ = 's';
+ *dst = '\0';
+ fprintf(fp, format_buf, buffer);
+ esc = 0;
+ break;
+ case 'H': // item head
+ ih = (const struct item_head *) va_arg(args, void_ptr);
+ len = asprintf(&buffer, "%u %u 0x%Lx %s (%d), "
+ "len %u, location %u entry count %u, fsck need %u, format %s",
+ get_key_dirid (&ih->ih_key), get_key_objectid (&ih->ih_key),
+ (unsigned long long)get_offset (&ih->ih_key), key_of_what (&ih->ih_key),
+ get_type (&ih->ih_key), get_ih_item_len (ih), get_ih_location (ih),
+ get_ih_entry_count (ih), get_ih_flags (ih),
+ get_ih_key_format (ih) == KEY_FORMAT_2 ?
+ "new" :
+ ((get_ih_key_format (ih) == KEY_FORMAT_1) ? "old" : "BAD"));
+ *dst++ = 's';
+ *dst = '\0';
+ fprintf(fp, format_buf, buffer);
+ esc = 0;
+ break;
+ case 'y': // disk child
+ dc = (const struct disk_child *) va_arg(args, void_ptr);
+ len = asprintf(&buffer, "[dc_number=%u, dc_size=%u]", get_dc_child_blocknr (dc),
+ get_dc_child_size (dc));
+ *dst++ = 's';
+ *dst = '\0';
+ fprintf(fp, format_buf, buffer);
+ esc = 0;
+ break;
+ case 'M': // sd mode
+ mode = (mode_t) va_arg(args, void_ptr);
+ fputc(ftypelet (mode), fp);
+ rwx (fp, (mode & 0700) << 0);
+ rwx (fp, (mode & 0070) << 3);
+ rwx (fp, (mode & 0007) << 6);
+ esc = 0;
+ break;
+ case 'U': // UUID
+#if defined(HAVE_LIBUUID) && defined(HAVE_UUID_UUID_H)
+ uuid = (const unsigned char *) va_arg(args, void_ptr);
+ uuid_buf[36] = '\0';
+ uuid_unparse(uuid, uuid_buf);
+ fprintf(fp, "%s", uuid_buf);
+ uuid = (const unsigned char *) va_arg(args, void_ptr);
+ uuid_buf[36] = '\0';
+ uuid_unparse(uuid, uuid_buf);
+ fprintf(fp, "%s", uuid_buf);
+#else
+ fprintf(fp, "<no libuuid installed>");
+ fprintf(fp, "<no libuuid installed>");
+#endif
+ esc = 0;
+ break;
+ case '-': case '+': case '#': case '.':
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ case 'l': case 'L': case 'h':
+ // non-terminal format modifiers
+ if (dst < end)
+ *dst++ = ch;
+ break;
+ default:
+ *dst++ = ch;
+ *dst = '\0';
+ fprintf(fp, format_buf, va_arg(args, void_ptr));
+ esc = 0;
+ break;
+ }
+ } else if (ch == '%') {
+ esc = 1;
+ dst = format_buf;
+ end = &dst[30]; // leave room for final "s\0"
+ *dst++ = ch;
+ } else {
+ fputc(ch, fp);
+ }
+ }
+ esc = 0;
+ break;
+ case '-': case '+': case '#': case '.':
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ case 'l': case 'L': case 'h':
+ // non-terminal format modifiers
+ if (dst < end)
+ *dst++ = ch;
+ break;
+ default:
+ *dst++ = ch;
+ *dst = '\0';
+ fprintf(fp, format_buf, va_arg(args, void_ptr));
+ esc = 0;
+ break;
+ }
+ } else if (ch == '%') {
+ esc = 1;
+ dst = format_buf;
+ end = &dst[30]; // leave room for final "s\0"
+ *dst++ = ch;
+ } else {
+ fputc(ch, fp);
+ }
+ }
+
+ va_end (args);
+ va_end (args);
+}
+
+#endif /* !defined(__GLIBC__) */
+#endif /* !defined(__GLIBC__) */
+
static char * vi_type (struct virtual_item * vi)
static void print_directory_item(FILE *fp, reiserfs_filsys_t fs,
struct buffer_head *bh, struct item_head *ih)
{
@@ -236,10 +374,10 @@
void print_virtual_node (struct virtual_node * vn)
{
int i, j;
-
+
printf ("VIRTUAL NODE CONTAINS %d items, has size %d,%s,%s, ITEM_POS=%d POS_IN_ITEM=%d MODE=\'%c\'\n",
vn->vn_nr_item, vn->vn_size,
- (vn->vn_vi[0].vi_type & VI_TYPE_LEFT_MERGEABLE )? "left mergeable" : "",
+ (vn->vn_vi[0].vi_type & VI_TYPE_LEFT_MERGEABLE )? "left mergeable" : "",
(vn->vn_vi[vn->vn_nr_item - 1].vi_type & VI_TYPE_RIGHT_MERGEABLE) ? "right mergeable" : "",
vn->vn_affected_item_num, vn->vn_pos_in_item, vn->vn_mode);
@@ -265,10 +403,10 @@
printf ("Offset Bh (b_blocknr, b_count) Position Nr_item\n");
while ( offset > ILLEGAL_PATH_ELEMENT_OFFSET ) {
bh = PATH_OFFSET_PBUFFER (path, offset);
- printf ("%6d %10p (%9lu, %7d) %8d %7d\n", offset,
+ printf ("%6d %10p (%9lu, %7d) %8d %7d\n", offset,
bh, bh ? bh->b_blocknr : 0, bh ? bh->b_count : 0,
PATH_OFFSET_POSITION (path, offset), bh ? B_NR_ITEMS (bh) : -1);
-
+
offset --;
}
}
@@ -298,13 +436,13 @@
}
if (i && dir_entry_bad_location (deh - 1, ih, ((i - 1) == 0) ? 1 : 0))
/* previous entry has bad location so we can not calculate entry
- length */
+ length */
namelen = 25;
else
namelen = name_in_entry_length (ih, deh, i);
name = name_in_entry (deh, i);
- reiserfs_warning (fp, "%3d: \"%-25.*s\"(%3d)%20K%12d%5d, loc %u, state %x %s\n",
+ reiserfs_warning (fp, "%3d: \"%-25.*s\"(%3d)%20K%12d%5d, loc %u, state %x %s\n",
i, namelen, name, namelen,
(struct key *)&(deh->deh2_dir_id),
GET_HASH_VALUE (get_deh_offset (deh)),
@@ -366,10 +504,10 @@
unp = (__u32 *)B_I_PITEM (bh, ih);
if (get_ih_item_len (ih) % UNFM_P_SIZE)
- reiserfs_warning (fp, "print_indirect_item: invalid item len");
+ reiserfs_warning (fp, "print_indirect_item: invalid item len");
reiserfs_warning (fp, "%d pointer%s\n[", I_UNFM_NUM (ih),
- I_UNFM_NUM (ih) != 1 ? "s" : "" );
+ I_UNFM_NUM (ih) != 1 ? "s" : "" );
for (j = 0; j < I_UNFM_NUM (ih); j ++) {
if (sequence_finished (prev, &num, d32_get(unp, j))) {
print_sequence (fp, prev, num);
@@ -392,29 +530,29 @@
static int print_stat_data (FILE * fp, struct buffer_head * bh, struct item_head * ih, int alltimes)
{
int retval;
-
+
/* we cannot figure out if it is new stat data or old by key_format
macro. Stat data's key looks identical in both formats */
if (get_ih_key_format (ih) == KEY_FORMAT_1) {
- struct stat_data_v1 * sd_v1 = (struct stat_data_v1 *)B_I_PITEM (bh, ih);
+ struct stat_data_v1 * sd_v1 = (struct stat_data_v1 *)B_I_PITEM (bh, ih);
reiserfs_warning (fp, "(OLD SD), mode %M, size %u, nlink %u, uid %u, FDB %u, mtime %s blocks %u",
sd_v1_mode(sd_v1), sd_v1_size(sd_v1), sd_v1_nlink(sd_v1),
- sd_v1_uid(sd_v1), sd_v1_first_direct_byte(sd_v1), timestamp
- (sd_v1_mtime(sd_v1)), sd_v1_blocks(sd_v1));
+ sd_v1_uid(sd_v1), sd_v1_first_direct_byte(sd_v1), timestamp
+ (sd_v1_mtime(sd_v1)), sd_v1_blocks(sd_v1));
retval = (S_ISLNK (sd_v1_mode(sd_v1))) ? 1 : 0;
- if (alltimes)
- reiserfs_warning (fp, "%s %s\n", timestamp (sd_v1_ctime(sd_v1)),
- timestamp (sd_v1_atime(sd_v1)));
+ if (alltimes)
+ reiserfs_warning (fp, "%s %s\n", timestamp (sd_v1_ctime(sd_v1)),
+ timestamp (sd_v1_atime(sd_v1)));
} else {
- struct stat_data * sd = (struct stat_data *)B_I_PITEM (bh, ih);
+ struct stat_data * sd = (struct stat_data *)B_I_PITEM (bh, ih);
reiserfs_warning (fp, "(NEW SD), mode %M, size %Lu, nlink %u, mtime %s blocks %u, uid %u",
sd_v2_mode(sd), sd_v2_size(sd), sd_v2_nlink(sd),
timestamp (sd_v2_mtime(sd)), sd_v2_blocks(sd), sd_v2_uid(sd));
retval = (S_ISLNK (sd_v2_mode(sd))) ? 1 : 0;
- if (alltimes)
- reiserfs_warning (fp, "%s %s\n", timestamp (sd_v2_ctime(sd)),
- timestamp (sd_v2_atime(sd)));
+ if (alltimes)
+ reiserfs_warning (fp, "%s %s\n", timestamp (sd_v2_ctime(sd)),
+ timestamp (sd_v2_atime(sd)));
}
reiserfs_warning (fp, "\n");
@@ -442,7 +580,7 @@
return;
}
- print_directory_item (fp, 0, bh, ih);
+ print_directory_item (fp, 0, bh, ih);
}
@@ -494,7 +632,7 @@
if (!is_tree_node (bh, DISK_LEAF_NODE_LEVEL))
return 1;
-
+
ih = B_N_PITEM_HEAD (bh,0);
real_nr = leaf_count_ih(bh->b_data, bh->b_size);
nr = get_blkh_nr_items((struct block_head *)bh->b_data);
@@ -510,9 +648,9 @@
return 0;
}
- if (first < 0 || first > real_nr - 1)
+ if (first < 0 || first > real_nr - 1)
from = 0;
- else
+ else
from = first;
if (last < 0 || last > real_nr)
@@ -601,11 +739,11 @@
switch (get_reiserfs_format (sb)) {
case REISERFS_FORMAT_3_5:
reiserfs_warning (fp, "format 3.5 with ");
- format = 1;
+ format = 1;
break;
case REISERFS_FORMAT_3_6:
reiserfs_warning (fp, "format 3.6 with ");
- format = 2;
+ format = 2;
break;
default:
reiserfs_warning (fp, "unknown format with ");
@@ -631,7 +769,7 @@
(get_sb_umount_state (sb) == FS_CLEANLY_UMOUNTED) ? "" : "NOT ");
if (short_print)
- return 0;
+ return 0;
reiserfs_warning (fp, "Tree height: %d\n", get_sb_tree_height (sb));
reiserfs_warning (fp, "Hash function used to sort names: %s\n",
code2name (get_sb_hash_code (sb)));
@@ -652,10 +790,10 @@
reiserfs_warning (fp, "sb_version: %u\n", get_sb_version (sb));
if (format == 2) {
- reiserfs_warning (fp, "inode generation number: %u\n", get_sb_v2_inode_generation (sb));
- reiserfs_warning (fp, "UUID: %U\n", sb->s_uuid);
- reiserfs_warning (fp, "LABEL: %.16s\n", sb->s_label);
- reiserfs_warning (fp, "Set flags in SB:\n");
+ reiserfs_warning (fp, "inode generation number: %u\n", get_sb_v2_inode_generation (sb));
+ reiserfs_warning (fp, "UUID: %U\n", sb->s_uuid);
+ reiserfs_warning (fp, "LABEL: %.16s\n", sb->s_label);
+ reiserfs_warning (fp, "Set flags in SB:\n");
if ((get_sb_v2_flag (sb, reiserfs_attrs_cleared)))
reiserfs_warning (fp, "\tATTRIBUTES CLEAN\n");
reiserfs_warning(fp, "Mount count: %u\n",
@@ -713,7 +851,7 @@
}
-void print_block (FILE * fp, reiserfs_filsys_t * fs,
+void print_block (FILE * fp, reiserfs_filsys_t * fs,
struct buffer_head * bh, ...)//int print_mode, int first, int last)
{
va_list args;
@@ -732,7 +870,7 @@
last = va_arg (args, int);
file_name = (fs) ? fs->fs_file_name : NULL ;
if (print_desc_block (fp, bh))
- if (print_super_block (fp, fs, file_name, bh, 0))
+ if (print_super_block (fp, fs, file_name, bh, 0))
if (print_leaf (fp, fs, bh, mode, first, last))
if (print_internal (fp, bh, first, last))
reiserfs_warning (fp, "Block %lu contains unformatted data\n", bh->b_blocknr);
@@ -758,21 +896,21 @@
1 2 3 4 5 6 7 8
printk ("*********************************************************************\n");
*/
-
-
+
+
for (h = 0; h < sizeof(tb->insert_size) / sizeof (tb->insert_size[0]); h ++) {
- if (PATH_H_PATH_OFFSET (tb->tb_path, h) <= tb->tb_path->path_length &&
+ if (PATH_H_PATH_OFFSET (tb->tb_path, h) <= tb->tb_path->path_length &&
PATH_H_PATH_OFFSET (tb->tb_path, h) > ILLEGAL_PATH_ELEMENT_OFFSET) {
tbSh = PATH_H_PBUFFER (tb->tb_path, h);
tbFh = PATH_H_PPARENT (tb->tb_path, h);
} else {
- /* printk ("print_tb: h=%d, PATH_H_PATH_OFFSET=%d, path_length=%d\n",
+ /* printk ("print_tb: h=%d, PATH_H_PATH_OFFSET=%d, path_length=%d\n",
h, PATH_H_PATH_OFFSET (tb->tb_path, h), tb->tb_path->path_length);*/
tbSh = 0;
tbFh = 0;
}
printf ("* %u * %3lu(%2lu) * %3lu(%2lu) * %3lu(%2lu) * %5lu * %5lu * %5lu * %5lu * %5lu *\n",
- h,
+ h,
tbSh ? tbSh->b_blocknr : ~0ul,
tbSh ? tbSh->b_count : ~0ul,
tb->L[h] ? tb->L[h]->b_blocknr : ~0ul,
@@ -793,7 +931,7 @@
h = 0;
printf ("* h * size * ln * lb * rn * rb * blkn * s0 * s1 * s1b * s2 * s2b * curb * lk * rk *\n");
printf ("* %d * %4d * %2d * %2d * %2d * %2d * %4d * %2d * %2d * %3d * %2d * %3d * %4d * %2d * %2d *\n",
- h, tb->insert_size[h], tb->lnum[h], tb->lbytes, tb->rnum[h],tb->rbytes, tb->blknum[h],
+ h, tb->insert_size[h], tb->lnum[h], tb->lbytes, tb->rnum[h],tb->rbytes, tb->blknum[h],
tb->s0num, tb->s1num,tb->s1bytes, tb->s2num, tb->s2bytes, tb->cur_blknum, tb->lkey[h], tb->rkey[h]);
@@ -822,7 +960,7 @@
int j, k;
int bits = blocksize * 8;
int zeros = 0, ones = 0;
-
+
reiserfs_warning (fp, "#%d: block %lu: ", i, block);
@@ -882,7 +1020,7 @@
zeros += k;
if (!silent)
reiserfs_warning (fp, "%d) Busy(%d-", j - 1 + i * bits, j + i * bits);
-
+
k = 0;
while (misc_test_bit (j, map)) {
ones ++;
@@ -897,7 +1035,7 @@
ones += k;
if (!silent)
reiserfs_warning (fp, "%d) Free(%d-", j - 1 + i * bits, j + i * bits);
-
+
j --;
end2:
/* to make gcc 3.2 do not sware here */;
@@ -943,7 +1081,7 @@
block = (block / (fs->fs_blocksize * 8) + 1) * (fs->fs_blocksize * 8);
else
block ++;
-
+
}
}
@@ -965,26 +1103,26 @@
reiserfs_warning (fp, "print_objectid_map: proper signature is not found\n");
return;
}
-
+
reiserfs_warning (fp, "Map of objectids (super block size %d)\n",
(char *)omap - (char *)sb);
-
+
for (i = 0; i < get_sb_oid_cursize (sb); i ++) {
if (i % 2 == 0) {
reiserfs_warning(fp, "busy(%u-%u) ", le32_to_cpu (omap[i]),
- le32_to_cpu (omap[i+1]) - 1);
+ le32_to_cpu (omap[i+1]) - 1);
} else {
reiserfs_warning(fp, "free(%u-%u) ", le32_to_cpu (omap[i]),
- ((i+1) == get_sb_oid_cursize (sb)) ?
+ ((i+1) == get_sb_oid_cursize (sb)) ?
~(__u32)0 : (le32_to_cpu (omap[i+1]) - 1));
}
}
- reiserfs_warning (fp, "\nObject id array has size %d (max %d):",
+ reiserfs_warning (fp, "\nObject id array has size %d (max %d):",
get_sb_oid_cursize (sb), get_sb_oid_maxsize (sb));
-
+
for (i = 0; i < get_sb_oid_cursize (sb); i ++)
- reiserfs_warning (fp, "%s%u ", i % 2 ? "" : "*", le32_to_cpu (omap[i]));
+ reiserfs_warning (fp, "%s%u ", i % 2 ? "" : "*", le32_to_cpu (omap[i]));
reiserfs_warning (fp, "\n");
}
@@ -999,7 +1137,7 @@
reiserfs_warning (stdout, "Journal header (block #%lu of %s):\n"
"\tj_last_flush_trans_id %ld\n"
"\tj_first_unflushed_offset %ld\n"
- "\tj_mount_id %ld\n",
+ "\tj_mount_id %ld\n",
fs->fs_jh_bh->b_blocknr, fs->fs_j_file_name,
get_jh_last_flushed (j_head),
get_jh_replay_start_offset (j_head),
@@ -1009,7 +1147,7 @@
static void print_trans_element (reiserfs_filsys_t * fs, reiserfs_trans_t * trans,
- unsigned int index, unsigned long in_journal,
+ unsigned int index, unsigned long in_journal,
unsigned long in_place)
{
if (index % 8 == 0)
@@ -1043,4 +1181,3 @@
for_each_transaction (fs, print_one_transaction);
}
-

View file

@ -0,0 +1,16 @@
glibc-2.28 did hide loff_t indef system-specific macros:
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=663e7d784977f6b15c0cab73f754f9f39c9c0c2c
This caused build failure:
../include/reiserfs_lib.h:300:55: error: unknown type name 'loff_t'; did you mean 'off_t'?
Re-enable extensions to pull loff_t back.
https://bugs.gentoo.org/663930
--- configure.ac
+++ configure.ac
@@ -23,2 +23,4 @@ AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
+dnl pull in loff_t from glibc
+AC_USE_SYSTEM_EXTENSIONS

View file

@ -1,26 +1,26 @@
# Template file for 'reiserfsprogs'
pkgname=reiserfsprogs
version=3.6.24
revision=3
version=3.6.27
revision=1
build_style=gnu-configure
hostmakedepends="automake pkg-config"
makedepends="libuuid-devel"
hostmakedepends="automake libtool pkg-config"
makedepends="libuuid-devel e2fsprogs-devel acl-devel"
short_desc="Reiserfs utilities"
maintainer="Alexander Mamay <alexander@mamay.su>"
license="GPL-2"
license="GPL-2.0-or-later"
homepage="https://www.kernel.org/pub/linux/kernel/people/jeffm/reiserfsprogs/"
distfiles="${KERNEL_SITE}/kernel/people/jeffm/${pkgname}/v${version}/${pkgname}-${version}.tar.xz"
checksum=7e44fefe557d68a642191428210f3d64d80283b9ad0e45c24130f6ce936b0760
checksum=0e95b67fa7746a3c2d59145e9b9c2feb4a6be52853e83b497b182eae508e62e3
case "$XBPS_TARGET_MACHINE" in
*-musl) makedepends+=" musl-obstack" ;;
*-musl)
makedepends+=" musl-obstack"
LDFLAGS="-lobstack"
;;
esac
CFLAGS="-fgnu89-inline"
pre_configure() {
case "$XBPS_TARGET_MACHINE" in
*-musl) patch -p0 < ${FILESDIR}/musl-configure_ac.patch
esac
autoreconf -if
}