diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-01-17 00:32:29 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-01-17 00:43:09 +0100 |
commit | f5fb7c713ea443469406a691e60a6f4567a4cb75 (patch) | |
tree | b16d979915b5ad7e32ffe77ca5f5006dc639a16e /libnetfs | |
parent | dd3048b2e483f66571cfa1b2ccebb2091b9ad990 (diff) | |
download | hurd-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 'libnetfs')
-rw-r--r-- | libnetfs/dir-lookup.c | 2 | ||||
-rw-r--r-- | libnetfs/fsys-set-options.c | 2 | ||||
-rw-r--r-- | libnetfs/netfs.h | 24 | ||||
-rw-r--r-- | libnetfs/set-get-trans.c | 2 | ||||
-rw-r--r-- | libnetfs/set-options.c | 2 |
5 files changed, 16 insertions, 16 deletions
diff --git a/libnetfs/dir-lookup.c b/libnetfs/dir-lookup.c index da17a2d3..87874dc5 100644 --- a/libnetfs/dir-lookup.c +++ b/libnetfs/dir-lookup.c @@ -67,7 +67,7 @@ netfs_S_dir_lookup (struct protid *dircred, /* Keep a pointer to the start of the filename for length calculations. */ - char *filename_start = filename; + const char *filename_start = filename; *retry_port_type = MACH_MSG_TYPE_MAKE_SEND; *do_retry = FS_RETRY_NORMAL; diff --git a/libnetfs/fsys-set-options.c b/libnetfs/fsys-set-options.c index 08af9c3c..2b7e07e0 100644 --- a/libnetfs/fsys-set-options.c +++ b/libnetfs/fsys-set-options.c @@ -28,7 +28,7 @@ struct args { - char *data; + const char *data; mach_msg_type_number_t len; int do_children; }; diff --git a/libnetfs/netfs.h b/libnetfs/netfs.h index b877f0c6..3bab63cd 100644 --- a/libnetfs/netfs.h +++ b/libnetfs/netfs.h @@ -142,7 +142,7 @@ error_t netfs_attempt_chmod (struct iouser *cred, struct node *np, /* The user must define this function. Attempt to turn locked node NP (user CRED) into a symlink with target NAME. */ error_t netfs_attempt_mksymlink (struct iouser *cred, struct node *np, - char *name); + const char *name); /* The user must define this function. Attempt to turn NODE (user CRED) into a device. TYPE is either S_IFBLK or S_IFCHR. NP is @@ -154,7 +154,7 @@ error_t netfs_attempt_mkdev (struct iouser *cred, struct node *np, translator record for FILE to ARGZ (of length ARGZLEN) for user CRED. NP is locked. */ error_t netfs_set_translator (struct iouser *cred, struct node *np, - char *argz, size_t argzlen); + const char *argz, size_t argzlen); /* The user may define this function (but should define it together with netfs_set_translator). For locked node NODE with S_IPTRANS @@ -205,30 +205,30 @@ error_t netfs_attempt_syncfs (struct iouser *cred, int wait); (*NP, if found, should be locked and a reference to it generated. This call should unlock DIR no matter what.) */ error_t netfs_attempt_lookup (struct iouser *user, struct node *dir, - char *name, struct node **np); + const char *name, struct node **np); /* The user must define this function. Delete NAME in DIR (which is locked) for USER. */ error_t netfs_attempt_unlink (struct iouser *user, struct node *dir, - char *name); + const char *name); /* The user must define this function. Attempt to rename the directory FROMDIR to TODIR. Note that neither of the specific nodes are locked. */ error_t netfs_attempt_rename (struct iouser *user, struct node *fromdir, - char *fromname, struct node *todir, - char *toname, int excl); + const char *fromname, struct node *todir, + const char *toname, int excl); /* The user must define this function. Attempt to create a new directory named NAME in DIR (which is locked) for USER with mode MODE. */ error_t netfs_attempt_mkdir (struct iouser *user, struct node *dir, - char *name, mode_t mode); + const char *name, mode_t mode); /* The user must define this function. Attempt to remove directory named NAME in DIR (which is locked) for USER. */ error_t netfs_attempt_rmdir (struct iouser *user, - struct node *dir, char *name); + struct node *dir, const char *name); /* The user must define this function. Create a link in DIR with name @@ -236,7 +236,7 @@ error_t netfs_attempt_rmdir (struct iouser *user, locked. If EXCL is set, do not delete the target. Return EEXIST if NAME is already found in DIR. */ error_t netfs_attempt_link (struct iouser *user, struct node *dir, - struct node *file, char *name, int excl); + struct node *file, const char *name, int excl); /* The user must define this function. Attempt to create an anonymous file related to DIR (which is locked) for USER with MODE. Set *NP @@ -249,7 +249,7 @@ error_t netfs_attempt_mkfile (struct iouser *user, struct node *dir, new node upon return. On any error, clear *NP. *NP should be locked on success; no matter what, unlock DIR before returning. */ error_t netfs_attempt_create_file (struct iouser *user, struct node *dir, - char *name, mode_t mode, struct node **np); + const char *name, mode_t mode, struct node **np); /* The user must define this function. Read the contents of locked node NP (a symlink), for USER, into BUF. */ @@ -275,7 +275,7 @@ error_t netfs_attempt_read (struct iouser *cred, struct node *np, from DATA. Set *LEN to the amount successfully written upon return. */ error_t netfs_attempt_write (struct iouser *cred, struct node *np, - loff_t offset, size_t *len, void *data); + loff_t offset, size_t *len, const void *data); /* The user must define this function. Return the valid access types (bitwise OR of O_READ, O_WRITE, and O_EXEC) in *TYPES for @@ -335,7 +335,7 @@ error_t netfs_get_source (char *source, size_t source_len); /* Parse and execute the runtime options in ARGZ & ARGZ_LEN. EINVAL is returned if some option is unrecognized. The default definition of this routine will parse them using NETFS_RUNTIME_ARGP. */ -error_t netfs_set_options (char *argz, size_t argz_len); +error_t netfs_set_options (const char *argz, size_t argz_len); /* Append to the malloced string *ARGZ of length *ARGZ_LEN a NUL-separated list of the arguments to this translator. The default definition of this diff --git a/libnetfs/set-get-trans.c b/libnetfs/set-get-trans.c index c0a4370e..52e68ac7 100644 --- a/libnetfs/set-get-trans.c +++ b/libnetfs/set-get-trans.c @@ -30,7 +30,7 @@ CRED. */ error_t __attribute__ ((weak)) netfs_set_translator (struct iouser *cred, struct node *np, - char *argz, size_t argzlen) + const char *argz, size_t argzlen) { return EOPNOTSUPP; } diff --git a/libnetfs/set-options.c b/libnetfs/set-options.c index 416d9123..924c570f 100644 --- a/libnetfs/set-options.c +++ b/libnetfs/set-options.c @@ -21,7 +21,7 @@ #include "netfs.h" error_t -netfs_set_options (char *argz, size_t argz_len) +netfs_set_options (const char *argz, size_t argz_len) { if (netfs_runtime_argp) return fshelp_set_options (netfs_runtime_argp, 0, argz, argz_len, 0); |