1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-25 10:03:49 +03:00

lxc_fuse.c: Modernize function declarations

Our style of writing function declarations has changed since the
time the file was introduced. Fix the whole file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2022-03-01 09:58:18 +01:00
parent fd8c3ad50a
commit 82e0f18b85

View File

@ -54,7 +54,9 @@ struct virLXCFuse {
static const char *fuse_meminfo_path = "/meminfo"; static const char *fuse_meminfo_path = "/meminfo";
static int lxcProcGetattr(const char *path, struct stat *stbuf) static int
lxcProcGetattr(const char *path,
struct stat *stbuf)
{ {
g_autofree char *mempath = NULL; g_autofree char *mempath = NULL;
struct stat sb; struct stat sb;
@ -88,10 +90,12 @@ static int lxcProcGetattr(const char *path, struct stat *stbuf)
return 0; return 0;
} }
static int lxcProcReaddir(const char *path, void *buf, static int
fuse_fill_dir_t filler, lxcProcReaddir(const char *path,
off_t offset G_GNUC_UNUSED, void *buf,
struct fuse_file_info *fi G_GNUC_UNUSED) fuse_fill_dir_t filler,
off_t offset G_GNUC_UNUSED,
struct fuse_file_info *fi G_GNUC_UNUSED)
{ {
if (STRNEQ(path, "/")) if (STRNEQ(path, "/"))
return -ENOENT; return -ENOENT;
@ -103,8 +107,9 @@ static int lxcProcReaddir(const char *path, void *buf,
return 0; return 0;
} }
static int lxcProcOpen(const char *path, static int
struct fuse_file_info *fi) lxcProcOpen(const char *path,
struct fuse_file_info *fi)
{ {
if (STRNEQ(path, fuse_meminfo_path)) if (STRNEQ(path, fuse_meminfo_path))
return -ENOENT; return -ENOENT;
@ -115,7 +120,11 @@ static int lxcProcOpen(const char *path,
return 0; return 0;
} }
static int lxcProcHostRead(char *path, char *buf, size_t size, off_t offset) static int
lxcProcHostRead(char *path,
char *buf,
size_t size,
off_t offset)
{ {
int fd; int fd;
int res; int res;
@ -131,8 +140,12 @@ static int lxcProcHostRead(char *path, char *buf, size_t size, off_t offset)
return res; return res;
} }
static int lxcProcReadMeminfo(char *hostpath, virDomainDef *def, static int
char *buf, size_t size, off_t offset) lxcProcReadMeminfo(char *hostpath,
virDomainDef *def,
char *buf,
size_t size,
off_t offset)
{ {
int res; int res;
FILE *fd = NULL; FILE *fd = NULL;
@ -242,11 +255,12 @@ static int lxcProcReadMeminfo(char *hostpath, virDomainDef *def,
return res; return res;
} }
static int lxcProcRead(const char *path, static int
char *buf, lxcProcRead(const char *path,
size_t size, char *buf,
off_t offset, size_t size,
struct fuse_file_info *fi G_GNUC_UNUSED) off_t offset,
struct fuse_file_info *fi G_GNUC_UNUSED)
{ {
int res = -ENOENT; int res = -ENOENT;
g_autofree char *hostpath = NULL; g_autofree char *hostpath = NULL;
@ -273,7 +287,8 @@ static struct fuse_operations lxcProcOper = {
.read = lxcProcRead, .read = lxcProcRead,
}; };
static void lxcFuseDestroy(struct virLXCFuse *fuse) static void
lxcFuseDestroy(struct virLXCFuse *fuse)
{ {
VIR_LOCK_GUARD lock = virLockGuardLock(&fuse->lock); VIR_LOCK_GUARD lock = virLockGuardLock(&fuse->lock);
@ -281,7 +296,8 @@ static void lxcFuseDestroy(struct virLXCFuse *fuse)
g_clear_pointer(&fuse->fuse, fuse_destroy); g_clear_pointer(&fuse->fuse, fuse_destroy);
} }
static void lxcFuseRun(void *opaque) static void
lxcFuseRun(void *opaque)
{ {
struct virLXCFuse *fuse = opaque; struct virLXCFuse *fuse = opaque;
@ -292,7 +308,9 @@ static void lxcFuseRun(void *opaque)
lxcFuseDestroy(fuse); lxcFuseDestroy(fuse);
} }
int lxcSetupFuse(struct virLXCFuse **f, virDomainDef *def) int
lxcSetupFuse(struct virLXCFuse **f,
virDomainDef *def)
{ {
int ret = -1; int ret = -1;
struct fuse_args args = FUSE_ARGS_INIT(0, NULL); struct fuse_args args = FUSE_ARGS_INIT(0, NULL);
@ -342,7 +360,8 @@ int lxcSetupFuse(struct virLXCFuse **f, virDomainDef *def)
goto cleanup; goto cleanup;
} }
int lxcStartFuse(struct virLXCFuse *fuse) int
lxcStartFuse(struct virLXCFuse *fuse)
{ {
if (virThreadCreateFull(&fuse->thread, false, lxcFuseRun, if (virThreadCreateFull(&fuse->thread, false, lxcFuseRun,
"lxc-fuse", false, (void *)fuse) < 0) { "lxc-fuse", false, (void *)fuse) < 0) {
@ -353,7 +372,8 @@ int lxcStartFuse(struct virLXCFuse *fuse)
return 0; return 0;
} }
void lxcFreeFuse(struct virLXCFuse **f) void
lxcFreeFuse(struct virLXCFuse **f)
{ {
struct virLXCFuse *fuse = *f; struct virLXCFuse *fuse = *f;
/* lxcFuseRun thread create success */ /* lxcFuseRun thread create success */
@ -370,18 +390,21 @@ void lxcFreeFuse(struct virLXCFuse **f)
} }
} }
#else #else
int lxcSetupFuse(struct virLXCFuse **f G_GNUC_UNUSED, int
virDomainDef *def G_GNUC_UNUSED) lxcSetupFuse(struct virLXCFuse **f G_GNUC_UNUSED,
virDomainDef *def G_GNUC_UNUSED)
{ {
return 0; return 0;
} }
int lxcStartFuse(struct virLXCFuse *f G_GNUC_UNUSED) int
lxcStartFuse(struct virLXCFuse *f G_GNUC_UNUSED)
{ {
return 0; return 0;
} }
void lxcFreeFuse(struct virLXCFuse **f G_GNUC_UNUSED) void
lxcFreeFuse(struct virLXCFuse **f G_GNUC_UNUSED)
{ {
} }
#endif #endif