Changes to the BUSE memory disk example:

* Added a trivial disconnect function.
 * Made it large enough to allow placing an ext2 file system with 4K blocks on
   it.
This commit is contained in:
Adam Cozzette 2011-11-17 11:19:09 -08:00
parent b6722defc5
commit d1704eb381
1 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,4 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -17,10 +18,17 @@ static int xmp_write(const void *buf, u_int32_t len, u_int64_t offset)
return 0;
}
static int xmp_disc()
{
fprintf(stderr, "Received a disconnect request.\n");
return 0;
}
static struct buse_operations aop = {
.read = xmp_read,
.write = xmp_write,
.size = 128 * 1024,
.disc = xmp_disc,
.size = 128 * 1024 * 1024,
};
int main(int argc, char *argv[])