Changed abuse to buse everywhere it appeared.
This commit is contained in:
parent
fa6dc0152c
commit
67c7f7c04a
6
Makefile
6
Makefile
|
@ -1,5 +1,5 @@
|
||||||
TARGET := abusexmp
|
TARGET := busexmp
|
||||||
OBJS := $(TARGET:=.o) abuse.o
|
OBJS := $(TARGET:=.o) buse.o
|
||||||
|
|
||||||
C := /usr/bin/gcc
|
C := /usr/bin/gcc
|
||||||
CFLAGS := -g -pedantic -Wall -Wextra -std=c99 -I$(HOME)/local/include -I$(HOME)/src/nbd
|
CFLAGS := -g -pedantic -Wall -Wextra -std=c99 -I$(HOME)/local/include -I$(HOME)/src/nbd
|
||||||
|
@ -11,7 +11,7 @@ all: $(TARGET)
|
||||||
$(TARGET): $(OBJS)
|
$(TARGET): $(OBJS)
|
||||||
$(CC) $(LDFLAGS) -o $@ $^
|
$(CC) $(LDFLAGS) -o $@ $^
|
||||||
|
|
||||||
$(OBJS): %.o: %.c abuse.h
|
$(OBJS): %.o: %.c buse.h
|
||||||
$(CC) $(CFLAGS) -o $@ -c $<
|
$(CC) $(CFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "abuse.h"
|
#include "buse.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These helper functions were taken from cliserv.h in the nbd distribution.
|
* These helper functions were taken from cliserv.h in the nbd distribution.
|
||||||
|
@ -31,7 +31,7 @@ u_int64_t ntohll(u_int64_t a) {
|
||||||
#endif
|
#endif
|
||||||
#define htonll ntohll
|
#define htonll ntohll
|
||||||
|
|
||||||
int abuse_main(int argc, char *argv[], const struct abuse_operations *aop, void *userdata)
|
int buse_main(int argc, char *argv[], const struct buse_operations *aop, void *userdata)
|
||||||
{
|
{
|
||||||
int sp[2];
|
int sp[2];
|
||||||
int nbd, sk, err, tmp_fd;
|
int nbd, sk, err, tmp_fd;
|
|
@ -1,9 +1,9 @@
|
||||||
#ifndef ABUSE_H_INCLUDED
|
#ifndef BUSE_H_INCLUDED
|
||||||
#define ABUSE_H_INCLUDED
|
#define BUSE_H_INCLUDED
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
struct abuse_operations {
|
struct buse_operations {
|
||||||
int (*read)(void *buf, u_int32_t len, u_int64_t offset);
|
int (*read)(void *buf, u_int32_t len, u_int64_t offset);
|
||||||
int (*write)(const void *buf, u_int32_t len, u_int64_t offset);
|
int (*write)(const void *buf, u_int32_t len, u_int64_t offset);
|
||||||
int (*disc)();
|
int (*disc)();
|
||||||
|
@ -13,7 +13,7 @@ struct abuse_operations {
|
||||||
u_int64_t size;
|
u_int64_t size;
|
||||||
};
|
};
|
||||||
|
|
||||||
int abuse_main(int argc, char *argv[], const struct abuse_operations *aop,
|
int buse_main(int argc, char *argv[], const struct buse_operations *aop,
|
||||||
void *userdata);
|
void *userdata);
|
||||||
|
|
||||||
#endif /* ABUSE_H_INCLUDED */
|
#endif /* BUSE_H_INCLUDED */
|
|
@ -1,7 +1,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "abuse.h"
|
#include "buse.h"
|
||||||
|
|
||||||
static void *data;
|
static void *data;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ static int xmp_write(const void *buf, u_int32_t len, u_int64_t offset)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct abuse_operations aop = {
|
static struct buse_operations aop = {
|
||||||
.read = xmp_read,
|
.read = xmp_read,
|
||||||
.write = xmp_write,
|
.write = xmp_write,
|
||||||
.size = 128 * 1024 * 1024,
|
.size = 128 * 1024 * 1024,
|
||||||
|
@ -29,5 +29,5 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
data = malloc(aop.size);
|
data = malloc(aop.size);
|
||||||
|
|
||||||
return abuse_main(argc, argv, &aop, NULL);
|
return buse_main(argc, argv, &aop, NULL);
|
||||||
}
|
}
|
Loading…
Reference in New Issue