summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2017-08-29 12:27:58 +0200
committerJustus Winter <justus@gnupg.org>2017-09-01 11:20:31 +0200
commit973089f3832df9887259e1927f7ead800d9dd897 (patch)
tree873ed6d1c8ea26d818071d02504c94872e6b01bc
parent812117cfbd76fadfd6c20913db665619070c170e (diff)
Remove unused parameter from the 'get_source' machinery.
* libdiskfs/diskfs.h (diskfs_get_source): Remove first parameter. * libdiskfs/file-get-source.c (diskfs_S_file_get_source): Adapt callsite. * libdiskfs/get-source.c (diskfs_get_source): Adapt default implementation. * libnetfs/netfs.h (netfs_get_source): Remove first parameter. * libnetfs/file-get-source.c (netfs_S_file_get_source): Adapt callsite. * libnetfs/get-source.c (netfs_get_source): Adapt default implementation. * libtrivfs/trivfs.h (trivfs_get_source): Remove first parameter. * libtrivfs/file-get-source.c (trivfs_S_file_get_source): Adapt callsite. * libtrivfs/get-source.c (trivfs_get_source): Adapt default implementation. * nfs/main.c (netfs_get_source): Adapt implementation. * procfs/main.c (netfs_get_source): Likewise. * trans/firmlink.c (trivfs_get_source): Likewise.
-rw-r--r--libdiskfs/diskfs.h10
-rw-r--r--libdiskfs/file-get-source.c2
-rw-r--r--libdiskfs/get-source.c2
-rw-r--r--libnetfs/file-get-source.c2
-rw-r--r--libnetfs/get-source.c2
-rw-r--r--libnetfs/netfs.h9
-rw-r--r--libtrivfs/file-get-source.c2
-rw-r--r--libtrivfs/get-source.c2
-rw-r--r--libtrivfs/trivfs.h11
-rw-r--r--nfs/main.c11
-rw-r--r--procfs/main.c10
-rw-r--r--trans/firmlink.c3
12 files changed, 29 insertions, 37 deletions
diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h
index 0e148523..40af37a9 100644
--- a/libdiskfs/diskfs.h
+++ b/libdiskfs/diskfs.h
@@ -586,11 +586,11 @@ error_t (*diskfs_create_symlink_hook)(struct node *np, const char *target);
error_t (*diskfs_read_symlink_hook)(struct node *np, char *target);
/* The user may define this function. The function must set source to
- the source of CRED. The function may return an EOPNOTSUPP to
- indicate that the concept of a source device is not applicable. The
- default function always returns EOPNOTSUPP. */
-error_t diskfs_get_source (struct protid *cred,
- char *source, size_t source_len);
+ the source of the translator. The function may return an EOPNOTSUPP
+ to indicate that the concept of a source device is not
+ applicable. The default function always returns diskfs_disk_name,
+ or EOPNOTSUPP if it is NULL. */
+error_t diskfs_get_source (char *source, size_t source_len);
/* Libdiskfs contains a node cache.
diff --git a/libdiskfs/file-get-source.c b/libdiskfs/file-get-source.c
index b5c31845..d983a826 100644
--- a/libdiskfs/file-get-source.c
+++ b/libdiskfs/file-get-source.c
@@ -33,5 +33,5 @@ diskfs_S_file_get_source (struct protid *cred,
|| cred->pi.class != diskfs_protid_class)
return EOPNOTSUPP;
- return diskfs_get_source (cred, source, 1024 /* XXX */);
+ return diskfs_get_source (source, 1024 /* XXX */);
}
diff --git a/libdiskfs/get-source.c b/libdiskfs/get-source.c
index 2ef8ebcd..9962ee9e 100644
--- a/libdiskfs/get-source.c
+++ b/libdiskfs/get-source.c
@@ -22,7 +22,7 @@
#include "priv.h"
error_t __attribute__ ((weak))
-diskfs_get_source (struct protid *cred, char *source, size_t source_len)
+diskfs_get_source (char *source, size_t source_len)
{
if (diskfs_disk_name == NULL)
return EOPNOTSUPP;
diff --git a/libnetfs/file-get-source.c b/libnetfs/file-get-source.c
index 7fa1b4f6..acd32306 100644
--- a/libnetfs/file-get-source.c
+++ b/libnetfs/file-get-source.c
@@ -31,5 +31,5 @@ netfs_S_file_get_source (struct protid *cred,
if (! cred)
return EOPNOTSUPP;
- return netfs_get_source (cred, source, 1024 /* XXX */);
+ return netfs_get_source (source, 1024 /* XXX */);
}
diff --git a/libnetfs/get-source.c b/libnetfs/get-source.c
index 5a234bce..cf237444 100644
--- a/libnetfs/get-source.c
+++ b/libnetfs/get-source.c
@@ -22,7 +22,7 @@
#include "priv.h"
error_t __attribute__ ((weak))
-netfs_get_source (struct protid *cred, char *source, size_t source_len)
+netfs_get_source (char *source, size_t source_len)
{
return EOPNOTSUPP;
}
diff --git a/libnetfs/netfs.h b/libnetfs/netfs.h
index afd4a060..5b5ca93b 100644
--- a/libnetfs/netfs.h
+++ b/libnetfs/netfs.h
@@ -320,11 +320,10 @@ error_t netfs_file_get_storage_info (struct iouser *cred,
mach_msg_type_number_t *data_len);
/* The user may define this function. The function must set source to
- the source of CRED. The function may return an EOPNOTSUPP to
- indicate that the concept of a source device is not applicable. The
- default function always returns EOPNOTSUPP. */
-error_t netfs_get_source (struct protid *cred,
- char *source, size_t source_len);
+ the source of the translator. The function may return an EOPNOTSUPP
+ to indicate that the concept of a source device is not
+ applicable. The default function always returns EOPNOTSUPP. */
+error_t netfs_get_source (char *source, size_t source_len);
/* Option parsing */
diff --git a/libtrivfs/file-get-source.c b/libtrivfs/file-get-source.c
index f6637d87..c2420fb8 100644
--- a/libtrivfs/file-get-source.c
+++ b/libtrivfs/file-get-source.c
@@ -30,5 +30,5 @@ trivfs_S_file_get_source (struct trivfs_protid *cred,
mach_msg_type_name_t replyPoly,
char *source)
{
- return cred? trivfs_get_source (cred, source, 1024 /* XXX */): EOPNOTSUPP;
+ return cred ? trivfs_get_source (source, 1024 /* XXX */) : EOPNOTSUPP;
}
diff --git a/libtrivfs/get-source.c b/libtrivfs/get-source.c
index 1b3ce11d..1f772000 100644
--- a/libtrivfs/get-source.c
+++ b/libtrivfs/get-source.c
@@ -22,7 +22,7 @@
#include "priv.h"
error_t __attribute__ ((weak))
-trivfs_get_source (struct trivfs_protid *cred, char *source, size_t source_len)
+trivfs_get_source (char *source, size_t source_len)
{
return EOPNOTSUPP;
}
diff --git a/libtrivfs/trivfs.h b/libtrivfs/trivfs.h
index 49cc765f..ddeb29a8 100644
--- a/libtrivfs/trivfs.h
+++ b/libtrivfs/trivfs.h
@@ -215,12 +215,11 @@ error_t trivfs_set_options (struct trivfs_control *fsys,
error_t trivfs_append_args (struct trivfs_control *fsys,
char **argz, size_t *argz_len);
-/* The user may define this function. The function must set source to
- the source device of CRED. The function may return an EOPNOTSUPP to
- indicate that the concept of a source device is not applicable. The
- default function always returns EOPNOTSUPP. */
-error_t trivfs_get_source (struct trivfs_protid *cred,
- char *source, size_t source_len);
+/* The user may define this function. The function must set SOURCE to
+ the source of the translator. The function may return an EOPNOTSUPP
+ to indicate that the concept of a source device is not
+ applicable. The default function always returns EOPNOTSUPP. */
+error_t trivfs_get_source (char *source, size_t source_len);
/* Add the port class *CLASS to the list of control port classes recognized
by trivfs; if *CLASS is 0, an attempt is made to allocate a new port
diff --git a/nfs/main.c b/nfs/main.c
index cd1c29a0..c98eb567 100644
--- a/nfs/main.c
+++ b/nfs/main.c
@@ -270,15 +270,12 @@ netfs_append_args (char **argz, size_t *argz_len)
}
/* The user may define this function. The function must set source to
- the source of CRED. The function may return an EOPNOTSUPP to
- indicate that the concept of a source device is not applicable. The
- default function always returns EOPNOTSUPP. */
+ the source of the translator. The function may return an EOPNOTSUPP
+ to indicate that the concept of a source device is not
+ applicable. The default function always returns EOPNOTSUPP. */
error_t
-netfs_get_source (struct protid *cred, char *source, size_t source_len)
+netfs_get_source (char *source, size_t source_len)
{
- if (! cred)
- return EOPNOTSUPP;
-
snprintf (source, source_len, "%s:%s", host, remote_fs);
return 0;
}
diff --git a/procfs/main.c b/procfs/main.c
index 0c87175a..e9e29123 100644
--- a/procfs/main.c
+++ b/procfs/main.c
@@ -254,13 +254,11 @@ netfs_append_args (char **argz, size_t *argz_len)
}
/* The user may define this function. The function must set source to
- the source of CRED. The function may return an EOPNOTSUPP to
- indicate that the concept of a source device is not applicable. The
- default function always returns EOPNOTSUPP. */
-error_t netfs_get_source (struct protid *cred, char *source, size_t source_len)
+ the source of the translator. The function may return an EOPNOTSUPP
+ to indicate that the concept of a source device is not
+ applicable. The default function always returns EOPNOTSUPP. */
+error_t netfs_get_source (char *source, size_t source_len)
{
- if (! cred)
- return EOPNOTSUPP;
snprintf (source, source_len, "proc");
return 0;
}
diff --git a/trans/firmlink.c b/trans/firmlink.c
index 19382f10..ca094ecf 100644
--- a/trans/firmlink.c
+++ b/trans/firmlink.c
@@ -287,8 +287,7 @@ trivfs_S_io_select_timeout (struct trivfs_protid *cred,
return trivfs_S_io_select (cred, reply, reply_type, type);
}
-error_t trivfs_get_source (struct trivfs_protid *cred,
- char *source, size_t source_len)
+error_t trivfs_get_source (char *source, size_t source_len)
{
strncpy (source, target, source_len - 1);
source[source_len -1 ] = '\0';