aboutsummaryrefslogtreecommitdiff
path: root/nfs
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2022-01-17 00:32:29 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-01-17 00:43:09 +0100
commitf5fb7c713ea443469406a691e60a6f4567a4cb75 (patch)
treeb16d979915b5ad7e32ffe77ca5f5006dc639a16e /nfs
parentdd3048b2e483f66571cfa1b2ccebb2091b9ad990 (diff)
downloadhurd-f5fb7c713ea443469406a691e60a6f4567a4cb75.tar.gz
hurd-f5fb7c713ea443469406a691e60a6f4567a4cb75.tar.bz2
hurd-f5fb7c713ea443469406a691e60a6f4567a4cb75.zip
Fix const warnings
Now that the RPCs have const, this forces us cleaning our const-meant functions.
Diffstat (limited to 'nfs')
-rw-r--r--nfs/name-cache.c6
-rw-r--r--nfs/nfs.c10
-rw-r--r--nfs/nfs.h16
-rw-r--r--nfs/ops.c20
4 files changed, 26 insertions, 26 deletions
diff --git a/nfs/name-cache.c b/nfs/name-cache.c
index 7553d7c0..73bcc071 100644
--- a/nfs/name-cache.c
+++ b/nfs/name-cache.c
@@ -107,7 +107,7 @@ find_cache (char *dir, size_t len, const char *name, size_t name_len)
name has been confirmed as absent in the directory. DIR is the
fhandle of the directory and LEN is its length. */
void
-enter_lookup_cache (char *dir, size_t len, struct node *np, char *name)
+enter_lookup_cache (char *dir, size_t len, struct node *np, const char *name)
{
struct lookup_cache *c;
size_t name_len = strlen (name);
@@ -146,7 +146,7 @@ enter_lookup_cache (char *dir, size_t len, struct node *np, char *name)
/* Purge all references in the cache to NAME within directory DIR. */
void
-purge_lookup_cache (struct node *dp, char *name, size_t namelen)
+purge_lookup_cache (struct node *dp, const char *name, size_t namelen)
{
struct lookup_cache *c, *next;
@@ -245,7 +245,7 @@ register_miss ()
unlock DIR->LOCK before returning. For positive hits, lock the
returned node. */
struct node *
-check_lookup_cache (struct node *dir, char *name)
+check_lookup_cache (struct node *dir, const char *name)
{
struct lookup_cache *c;
diff --git a/nfs/nfs.c b/nfs/nfs.c
index d124cae7..a5ea53d2 100644
--- a/nfs/nfs.c
+++ b/nfs/nfs.c
@@ -140,7 +140,7 @@ hurd_mode_to_nfs_type (mode_t mode)
/* Encode an NFS file handle. */
int *
-xdr_encode_fhandle (int *p, struct fhandle *fhandle)
+xdr_encode_fhandle (int *p, const struct fhandle *fhandle)
{
if (protocol_version == 2)
{
@@ -153,7 +153,7 @@ xdr_encode_fhandle (int *p, struct fhandle *fhandle)
/* Encode uninterpreted bytes. */
int *
-xdr_encode_data (int *p, char *data, size_t len)
+xdr_encode_data (int *p, const char *data, size_t len)
{
int nints = INTSIZE (len);
@@ -174,7 +174,7 @@ xdr_encode_64bit (int *p, long long n)
/* Encode a C string. */
int *
-xdr_encode_string (int *p, char *string)
+xdr_encode_string (int *p, const char *string)
{
return xdr_encode_data (p, string, strlen (string));
}
@@ -266,7 +266,7 @@ xdr_encode_sattr_size (int *p, off_t size)
/* Encode ATIME and MTIME into an otherwise empty sattr. */
int *
-xdr_encode_sattr_times (int *p, struct timespec *atime, struct timespec *mtime)
+xdr_encode_sattr_times (int *p, const struct timespec *atime, const struct timespec *mtime)
{
if (protocol_version == 2)
{
@@ -357,7 +357,7 @@ xdr_encode_create_state (int *p,
/* Encode ST into an sattr. */
int *
xdr_encode_sattr_stat (int *p,
- struct stat *st)
+ const struct stat *st)
{
if (protocol_version == 2)
{
diff --git a/nfs/nfs.h b/nfs/nfs.h
index 36b5ef58..a22ff302 100644
--- a/nfs/nfs.h
+++ b/nfs/nfs.h
@@ -162,14 +162,14 @@ extern int protocol_version;
/* nfs.c */
int hurd_mode_to_nfs_type (mode_t);
-int *xdr_encode_fhandle (int *, struct fhandle *);
-int *xdr_encode_data (int *, char *, size_t);
-int *xdr_encode_string (int *, char *);
+int *xdr_encode_fhandle (int *, const struct fhandle *);
+int *xdr_encode_data (int *, const char *, size_t);
+int *xdr_encode_string (int *, const char *);
int *xdr_encode_sattr_mode (int *, mode_t);
int *xdr_encode_sattr_ids (int *, u_int, u_int);
int *xdr_encode_sattr_size (int *, off_t);
-int *xdr_encode_sattr_times (int *, struct timespec *, struct timespec *);
-int *xdr_encode_sattr_stat (int *, struct stat *);
+int *xdr_encode_sattr_times (int *, const struct timespec *, const struct timespec *);
+int *xdr_encode_sattr_stat (int *, const struct stat *);
int *xdr_encode_create_state (int *, mode_t, uid_t);
int *xdr_decode_fattr (int *, struct stat *);
int *xdr_decode_string (int *, char *);
@@ -197,9 +197,9 @@ void lookup_fhandle (struct fhandle *, struct node **);
int *recache_handle (int *, struct node *);
/* name-cache.c */
-void enter_lookup_cache (char *, size_t, struct node *, char *);
-void purge_lookup_cache (struct node *, char *, size_t);
-struct node *check_lookup_cache (struct node *, char *);
+void enter_lookup_cache (char *, size_t, struct node *, const char *);
+void purge_lookup_cache (struct node *, const char *, size_t);
+struct node *check_lookup_cache (struct node *, const char *);
void purge_lookup_cache_node (struct node *);
#endif /* NFS_NFS_H */
diff --git a/nfs/ops.c b/nfs/ops.c
index 3599b496..5f2850d6 100644
--- a/nfs/ops.c
+++ b/nfs/ops.c
@@ -516,7 +516,7 @@ netfs_attempt_read (struct iouser *cred, struct node *np,
<hurd/netfs.h>. */
error_t
netfs_attempt_write (struct iouser *cred, struct node *np,
- off_t offset, size_t *len, void *data)
+ off_t offset, size_t *len, const void *data)
{
int *p;
void *rpcbuf;
@@ -592,7 +592,7 @@ netfs_attempt_write (struct iouser *cred, struct node *np,
/* See if NAME exists in DIR for CRED. If so, return EEXIST. */
error_t
verify_nonexistent (struct iouser *cred, struct node *dir,
- char *name)
+ const char *name)
{
int *p;
void *rpcbuf;
@@ -630,7 +630,7 @@ verify_nonexistent (struct iouser *cred, struct node *dir,
<hurd/netfs.h>. */
error_t
netfs_attempt_lookup (struct iouser *cred, struct node *np,
- char *name, struct node **newnp)
+ const char *name, struct node **newnp)
{
int *p;
void *rpcbuf;
@@ -704,7 +704,7 @@ netfs_attempt_lookup (struct iouser *cred, struct node *np,
<hurd/netfs.h>. */
error_t
netfs_attempt_mkdir (struct iouser *cred, struct node *np,
- char *name, mode_t mode)
+ const char *name, mode_t mode)
{
int *p;
void *rpcbuf;
@@ -762,7 +762,7 @@ netfs_attempt_mkdir (struct iouser *cred, struct node *np,
<hurd/netfs.h>. */
error_t
netfs_attempt_rmdir (struct iouser *cred, struct node *np,
- char *name)
+ const char *name)
{
int *p;
void *rpcbuf;
@@ -797,7 +797,7 @@ netfs_attempt_rmdir (struct iouser *cred, struct node *np,
<hurd/netfs.h>. */
error_t
netfs_attempt_link (struct iouser *cred, struct node *dir,
- struct node *np, char *name, int excl)
+ struct node *np, const char *name, int excl)
{
int *p;
void *rpcbuf;
@@ -1141,7 +1141,7 @@ netfs_attempt_mkfile (struct iouser *cred, struct node *dir,
<hurd/netfs.h>. */
error_t
netfs_attempt_create_file (struct iouser *cred, struct node *np,
- char *name, mode_t mode, struct node **newnp)
+ const char *name, mode_t mode, struct node **newnp)
{
int *p;
void *rpcbuf;
@@ -1233,7 +1233,7 @@ netfs_attempt_create_file (struct iouser *cred, struct node *np,
<hurd/netfs.h>. */
error_t
netfs_attempt_unlink (struct iouser *cred, struct node *dir,
- char *name)
+ const char *name)
{
int *p;
void *rpcbuf;
@@ -1339,7 +1339,7 @@ netfs_attempt_unlink (struct iouser *cred, struct node *dir,
<hurd/netfs.h>. */
error_t
netfs_attempt_rename (struct iouser *cred, struct node *fromdir,
- char *fromname, struct node *todir, char *toname,
+ const char *fromname, struct node *todir, const char *toname,
int excl)
{
int *p;
@@ -1882,7 +1882,7 @@ netfs_get_dirents (struct iouser *cred, struct node *np,
error_t
netfs_attempt_mksymlink (struct iouser *cred,
struct node *np,
- char *arg)
+ const char *arg)
{
if (np->nn->dtrans == NOT_POSSIBLE)
return EOPNOTSUPP;