FILE *fsxlogf;
int badoff = -1;
-void
+static void
vwarnc(code, fmt, ap)
int code;
const char *fmt;
fprintf(stderr, "%s\n", strerror(code));
}
-void
+static void
__attribute__((format(__printf__, 1, 2)))
warn(const char *fmt, ...)
{
va_end(ap);
}
-void
+static void
__attribute__((format(__printf__, 1, 2)))
prt(char *fmt, ...)
{
* which transparently handles passing of function name.
* This version also keeps checkpatch happy.
*/
-void
+static void
ptrerr_func(const char *func, const char *prefix)
{
prt("%s: %s%s%s\n", func, prefix, prefix ? ": " : "", strerror(errno));
}
#define prterr(prefix) ptrerr_func(__func__, prefix)
-void
+static void
log4(int operation, int arg0, int arg1, int arg2)
{
struct log_entry *le;
logptr = 0;
}
-const char *
+static const char *
fill_tf_buf(const struct test_file *tf)
{
static int max_tf_len;
return tf_buf;
}
-void
+static void
logdump(void)
{
int i, count, down;
}
}
-void
+static void
save_buffer(char *buffer, off_t bufferlength, int fd)
{
off_t ret;
}
}
-void
+static void
report_failure(int status)
{
logdump();
#define short_at(cp) ((unsigned short)((*((unsigned char *)(cp)) << 8) | \
*(((unsigned char *)(cp)) + 1)))
-void
+static void
check_buffers(unsigned int offset, unsigned int size)
{
unsigned char c, t;
}
}
-struct test_file *
+static struct test_file *
get_tf(void)
{
unsigned int index = 0;
return &test_files[index % num_test_files];
}
-void
+static void
assign_fd_policy(char *policy)
{
if (!strcmp(policy, "random")) {
}
}
-int
+static int
get_fd(void)
{
struct test_file *tf = get_tf();
return c ? c++ : path;
}
-void
+static void
open_test_files(char **argv, int argc)
{
struct test_file *tf;
prt("fd %d: %s\n", i, tf->path);
}
-void
+static void
close_test_files(void)
{
int i;
}
}
-void
+static void
check_size(void)
{
struct stat statbuf;
}
}
-void
+static void
check_trunc_hack(void)
{
struct stat statbuf;
}
}
-void
+static void
output_line(struct test_file *tf, int op, unsigned int offset,
unsigned int size)
{
(int)size < 0 ? -(int)size : size);
}
-void
+static void
mirror_output_line(struct test_file *tf, int op, int mirrors, int id)
{
if (!(!quiet &&
}
}
-void output_debug(unsigned int offset, unsigned int size, const char *what)
+static void output_debug(unsigned int offset, unsigned int size,
+ const char *what)
{
struct timeval t;
}
}
-void
+static void
doflush(unsigned int offset, unsigned int size)
{
unsigned int pg_offset;
output_debug(offset, size, "flush done");
}
-void
+static void
doread(unsigned int offset, unsigned int size)
{
off_t ret;
check_buffers(offset, size);
}
-void
+static void
check_eofpage(char *s, unsigned int offset, char *p, int size)
{
long last_page, should_be_zero;
}
}
-void
+static void
domapread(unsigned int offset, unsigned int size)
{
unsigned int pg_offset;
check_buffers(offset, size);
}
-void
+static void
gendata(char *original_buf, char *good_buf, unsigned int offset,
unsigned int size)
{
}
}
-void
+static void
dowrite(unsigned int offset, unsigned int size)
{
off_t ret;
}
}
-void
+static void
domapwrite(unsigned int offset, unsigned int size)
{
unsigned int pg_offset;
output_debug(offset, map_size, "munmap done");
}
-void
+static void
dotruncate(unsigned int size)
{
int oldsize = file_size;
output_debug(size, 0, "truncate done");
}
-void
+static void
do_punch_hole(unsigned int offset, unsigned int length)
{
int max_offset = 0;
memset(good_buf + max_offset, '\0', max_len);
}
-void
+static void
do_zero_range(unsigned int offset, unsigned int length)
{
unsigned int end_offset;
* fallocate is basically a no-op unless extending,
* then a lot like a truncate
*/
-void
+static void
do_preallocate(unsigned int offset, unsigned int length)
{
off_t end_offset;
output_debug(offset, length, "fallocate done");
}
-void
+static void
writefileimage()
{
ssize_t iret;
}
}
-void
+static void
docloseopen(void)
{
int direct = 0;
return rc < 0 ? rc : count;
}
-void
+static void
do_mirror_ops(int op)
{
int mirror_count;
rc = WEXITSTATUS(rc);
if (rc > 0) {
prt("%s: %d\n", cmd, rc);
- report_failure(184);
+ /* mirror split won't delete the last non-stale mirror,
+ * and returns EUCLEAN
+ */
+ if (rc != EUCLEAN)
+ report_failure(184);
}
}
output_debug(monitorstart, 0, cmd);
rc = system(cmd);
if (rc < 0) {
- prt("%s: %d\n", cmd, errno);
+ prt("mirror op %d: %s: %d\n", op, cmd, errno);
report_failure(184);
} else if (WIFEXITED(rc)) {
rc = WEXITSTATUS(rc);
if (rc > 0) {
- prt("%s: %d\n", cmd, rc);
+ prt("mirror op %d: %s: %d\n", op, cmd, rc);
snprintf(cmd, sizeof(cmd),
"lfs mirror verify -v %s", tf->path);
rc = system(cmd);
(len) = (size) - (off); \
} while (0)
-void
+static void
test(void)
{
unsigned long offset;
check_size();
}
-void
+static void
segv(int sig)
{
if (jmpbuf_good) {
report_failure(9999);
}
-void
+static void
cleanup(sig)
int sig;
{
exit(sig);
}
-void
+static void
usage(void)
{
fprintf(stdout,
exit(90);
}
-int
+static int
getnum(char *s, char **e)
{
int ret = -1;
return (ret);
}
-int
+static int
test_fallocate(int mode)
{
int ret = 0;