diff --git a/Makefile b/Makefile index d78c693..c96f575 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -TARGET := abusexmp -OBJS := $(TARGET:=.o) abuse.o +TARGET := busexmp +OBJS := $(TARGET:=.o) buse.o C := /usr/bin/gcc CFLAGS := -g -pedantic -Wall -Wextra -std=c99 -I$(HOME)/local/include -I$(HOME)/src/nbd @@ -11,7 +11,7 @@ all: $(TARGET) $(TARGET): $(OBJS) $(CC) $(LDFLAGS) -o $@ $^ -$(OBJS): %.o: %.c abuse.h +$(OBJS): %.o: %.c buse.h $(CC) $(CFLAGS) -o $@ -c $< clean: diff --git a/abuse.c b/buse.c similarity index 97% rename from abuse.c rename to buse.c index da976bd..f22cf3b 100644 --- a/abuse.c +++ b/buse.c @@ -11,7 +11,7 @@ #include #include -#include "abuse.h" +#include "buse.h" /* * 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 #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 nbd, sk, err, tmp_fd; diff --git a/abuse.h b/buse.h similarity index 59% rename from abuse.h rename to buse.h index a4b2bfd..4ed587f 100644 --- a/abuse.h +++ b/buse.h @@ -1,9 +1,9 @@ -#ifndef ABUSE_H_INCLUDED -#define ABUSE_H_INCLUDED +#ifndef BUSE_H_INCLUDED +#define BUSE_H_INCLUDED #include -struct abuse_operations { +struct buse_operations { 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 (*disc)(); @@ -13,7 +13,7 @@ struct abuse_operations { 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); -#endif /* ABUSE_H_INCLUDED */ +#endif /* BUSE_H_INCLUDED */ diff --git a/abusexmp.c b/busexmp.c similarity index 82% rename from abusexmp.c rename to busexmp.c index a5e334c..3f8f5ef 100644 --- a/abusexmp.c +++ b/busexmp.c @@ -1,7 +1,7 @@ #include #include -#include "abuse.h" +#include "buse.h" static void *data; @@ -19,7 +19,7 @@ static int xmp_write(const void *buf, u_int32_t len, u_int64_t offset) return 0; } -static struct abuse_operations aop = { +static struct buse_operations aop = { .read = xmp_read, .write = xmp_write, .size = 128 * 1024 * 1024, @@ -29,5 +29,5 @@ int main(int argc, char *argv[]) { data = malloc(aop.size); - return abuse_main(argc, argv, &aop, NULL); + return buse_main(argc, argv, &aop, NULL); }