Throw const on some strings

In C, const indicates to the reader that mutation will not occur.
It can also serve as a hint about ownership.

Add const in a few places where it makes sense.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org>
Closes #10997
This commit is contained in:
Ryan Moeller
2020-10-02 20:44:10 -04:00
committed by GitHub
parent 5b525165e9
commit 4d55ea811d
20 changed files with 99 additions and 108 deletions
+9 -9
View File
@@ -60,22 +60,22 @@ extern boolean_t zfsctl_is_snapdir(struct inode *ip);
extern int zfsctl_fid(struct inode *ip, fid_t *fidp);
/* zfsctl '.zfs' functions */
extern int zfsctl_root_lookup(struct inode *dip, char *name,
extern int zfsctl_root_lookup(struct inode *dip, const char *name,
struct inode **ipp, int flags, cred_t *cr, int *direntflags,
pathname_t *realpnp);
/* zfsctl '.zfs/snapshot' functions */
extern int zfsctl_snapdir_lookup(struct inode *dip, char *name,
extern int zfsctl_snapdir_lookup(struct inode *dip, const char *name,
struct inode **ipp, int flags, cred_t *cr, int *direntflags,
pathname_t *realpnp);
extern int zfsctl_snapdir_rename(struct inode *sdip, char *sname,
struct inode *tdip, char *tname, cred_t *cr, int flags);
extern int zfsctl_snapdir_remove(struct inode *dip, char *name, cred_t *cr,
int flags);
extern int zfsctl_snapdir_mkdir(struct inode *dip, char *dirname, vattr_t *vap,
struct inode **ipp, cred_t *cr, int flags);
extern int zfsctl_snapdir_rename(struct inode *sdip, const char *sname,
struct inode *tdip, const char *tname, cred_t *cr, int flags);
extern int zfsctl_snapdir_remove(struct inode *dip, const char *name,
cred_t *cr, int flags);
extern int zfsctl_snapdir_mkdir(struct inode *dip, const char *dirname,
vattr_t *vap, struct inode **ipp, cred_t *cr, int flags);
extern int zfsctl_snapshot_mount(struct path *path, int flags);
extern int zfsctl_snapshot_unmount(char *snapname, int flags);
extern int zfsctl_snapshot_unmount(const char *snapname, int flags);
extern int zfsctl_snapshot_unmount_delay(spa_t *spa, uint64_t objsetid,
int delay);
extern int zfsctl_snapdir_vget(struct super_block *sb, uint64_t objsetid,
+2 -2
View File
@@ -46,8 +46,8 @@ extern int zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr);
extern int zfs_write_simple(znode_t *zp, const void *data, size_t len,
loff_t pos, size_t *resid);
extern int zfs_access(struct inode *ip, int mode, int flag, cred_t *cr);
extern int zfs_lookup(znode_t *dzp, char *nm, znode_t **zpp,
int flags, cred_t *cr, int *direntflags, pathname_t *realpnp);
extern int zfs_lookup(znode_t *dzp, char *nm, znode_t **zpp, int flags,
cred_t *cr, int *direntflags, pathname_t *realpnp);
extern int zfs_create(znode_t *dzp, char *name, vattr_t *vap, int excl,
int mode, znode_t **zpp, cred_t *cr, int flag, vsecattr_t *vsecp);
extern int zfs_tmpfile(struct inode *dip, vattr_t *vapzfs, int excl,