virtiofsd: Trim down imported files

There's a lot of the original fuse code we don't need; trim them down.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
with additional trimming by:
Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
Dr. David Alan Gilbert
2019-02-08 12:49:54 +00:00
parent 7c6b660272
commit a3e23f3254
11 changed files with 8 additions and 1071 deletions

View File

@@ -42,32 +42,6 @@ static int mknod_wrapper(int dirfd, const char *path, const char *link,
res = symlinkat(link, dirfd, path);
} else if (S_ISFIFO(mode)) {
res = mkfifoat(dirfd, path, mode);
#ifdef __FreeBSD__
} else if (S_ISSOCK(mode)) {
struct sockaddr_un su;
int fd;
if (strlen(path) >= sizeof(su.sun_path)) {
errno = ENAMETOOLONG;
return -1;
}
fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (fd >= 0) {
/*
* We must bind the socket to the underlying file
* system to create the socket file, even though
* we'll never listen on this socket.
*/
su.sun_family = AF_UNIX;
strncpy(su.sun_path, path, sizeof(su.sun_path));
res = bindat(dirfd, fd, (struct sockaddr*)&su,
sizeof(su));
if (res == 0)
close(fd);
} else {
res = -1;
}
#endif
} else {
res = mknodat(dirfd, path, mode, rdev);
}