-/*
+/*
Copyright (C) by Ronnie Sahlberg <ronniesahlberg@gmail.com> 2010
This program is free software; you can redistribute it and/or modify
#include <utime.h>
#include <unistd.h>
#include <fcntl.h>
+#include <ccan/compiler/compiler.h>
#include "nfs.h"
#include "libnfs-raw.h"
#include "rpc/mount.h"
struct nfsdirent *current;
};
-void nfs_free_nfsdir(struct nfsdir *nfsdir)
+static void nfs_free_nfsdir(struct nfsdir *nfsdir)
{
while (nfsdir->entries) {
struct nfsdirent *dirent = nfsdir->entries->next;
free(nfs);
}
-void free_nfs_cb_data(struct nfs_cb_data *data)
+static void free_nfs_cb_data(struct nfs_cb_data *data)
{
if (data->saved_path != NULL) {
free(data->saved_path);
-static void nfs_mount_10_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_mount_10_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
struct nfs_cb_data *data = private_data;
struct nfs_context *nfs = data->nfs;
struct nfs_context *nfs = data->nfs;
uint32_t mount_port;
- if (status == RPC_STATUS_ERROR) {
+ if (status == RPC_STATUS_ERROR) {
data->cb(-EFAULT, nfs, command_data, data->private_data);
free_nfs_cb_data(data);
return;
* Functions to first look up a path, component by component, and then finally call a specific function once
* the filehandle for the final component is found.
*/
-static void nfs_lookup_path_1_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_lookup_path_1_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
struct nfs_cb_data *data = private_data;
struct nfs_context *nfs = data->nfs;
/*
* Async stat()
*/
-static void nfs_stat_1_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_stat_1_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
GETATTR3res *res;
struct nfs_cb_data *data = private_data;
/*
* Async open()
*/
-static void nfs_open_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_open_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
ACCESS3res *res;
struct nfs_cb_data *data = private_data;
/*
* Async pread()
*/
-static void nfs_pread_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_pread_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
struct nfs_cb_data *data = private_data;
struct nfs_context *nfs = data->nfs;
/*
* Async pwrite()
*/
-static void nfs_pwrite_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_pwrite_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
struct nfs_cb_data *data = private_data;
struct nfs_context *nfs = data->nfs;
/*
* Async fsync()
*/
-static void nfs_fsync_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_fsync_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
struct nfs_cb_data *data = private_data;
struct nfs_context *nfs = data->nfs;
/*
* Async ftruncate()
*/
-static void nfs_ftruncate_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_ftruncate_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
struct nfs_cb_data *data = private_data;
struct nfs_context *nfs = data->nfs;
/*
* Async mkdir()
*/
-static void nfs_mkdir_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_mkdir_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
MKDIR3res *res;
struct nfs_cb_data *data = private_data;
/*
* Async rmdir()
*/
-static void nfs_rmdir_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_rmdir_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
RMDIR3res *res;
struct nfs_cb_data *data = private_data;
/*
* Async creat()
*/
-static void nfs_create_2_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_create_2_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
LOOKUP3res *res;
struct nfs_cb_data *data = private_data;
-static void nfs_creat_1_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_creat_1_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
CREATE3res *res;
struct nfs_cb_data *data = private_data;
/*
* Async unlink()
*/
-static void nfs_unlink_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_unlink_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
REMOVE3res *res;
struct nfs_cb_data *data = private_data;
/*
* Async opendir()
*/
-static void nfs_opendir_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_opendir_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
READDIR3res *res;
struct nfs_cb_data *data = private_data;
}
-struct nfsdirent *nfs_readdir(struct nfs_context *nfs _U_, struct nfsdir *nfsdir)
+struct nfsdirent *nfs_readdir(struct nfs_context *nfs UNUSED, struct nfsdir *nfsdir)
{
struct nfsdirent *nfsdirent = nfsdir->current;
}
-void nfs_closedir(struct nfs_context *nfs _U_, struct nfsdir *nfsdir)
+void nfs_closedir(struct nfs_context *nfs UNUSED, struct nfsdir *nfsdir)
{
nfs_free_nfsdir(nfsdir);
}
void *private_data;
};
-static void nfs_lseek_1_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_lseek_1_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
GETATTR3res *res;
struct lseek_cb_data *data = private_data;
/*
* Async statvfs()
*/
-static void nfs_statvfs_1_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_statvfs_1_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
FSSTAT3res *res;
struct nfs_cb_data *data = private_data;
/*
* Async readlink()
*/
-static void nfs_readlink_1_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_readlink_1_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
READLINK3res *res;
struct nfs_cb_data *data = private_data;
/*
* Async chmod()
*/
-static void nfs_chmod_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_chmod_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
struct nfs_cb_data *data = private_data;
struct nfs_context *nfs = data->nfs;
/*
* Async chown()
*/
-static void nfs_chown_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_chown_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
struct nfs_cb_data *data = private_data;
struct nfs_context *nfs = data->nfs;
/*
* Async utimes()
*/
-static void nfs_utimes_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_utimes_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
struct nfs_cb_data *data = private_data;
struct nfs_context *nfs = data->nfs;
/*
* Async access()
*/
-static void nfs_access_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_access_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
ACCESS3res *res;
struct nfs_cb_data *data = private_data;
free(data);
}
-static void nfs_symlink_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_symlink_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
SYMLINK3res *res;
struct nfs_cb_data *data = private_data;
free(data);
}
-static void nfs_rename_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_rename_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
RENAME3res *res;
struct nfs_cb_data *data = private_data;
free(data);
}
-static void nfs_link_cb(struct rpc_context *rpc _U_, int status, void *command_data, void *private_data)
+static void nfs_link_cb(struct rpc_context *rpc UNUSED, int status, void *command_data, void *private_data)
{
LINK3res *res;
struct nfs_cb_data *data = private_data;