aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-11-04 23:10:12 +0000
committerBrian Behlendorf <[email protected]>2020-11-10 10:58:59 -0800
commit9a764716fc98bf3ba137b90f01ea4cd74a8c7551 (patch)
tree4e88d4d53267abd826575d6ddd91f68971c544a7
parent2074dfd0e9998e1086c373962f42960e0053f987 (diff)
Const some unchanging variables in zfs_write
Show that these values will not be changing later. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Matt Macy <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11176
-rw-r--r--module/zfs/zfs_vnops.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
index fc635e7c0..b65b86367 100644
--- a/module/zfs/zfs_vnops.c
+++ b/module/zfs/zfs_vnops.c
@@ -326,7 +326,7 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
if (n == 0)
return (0);
- rlim64_t limit = MAXOFFSET_T;
+ const rlim64_t limit = MAXOFFSET_T;
zfsvfs_t *zfsvfs = ZTOZSB(zp);
ZFS_ENTER(zfsvfs);
@@ -370,7 +370,7 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
return (SET_ERROR(EINVAL));
}
- int max_blksz = zfsvfs->z_max_blksz;
+ const uint64_t max_blksz = zfsvfs->z_max_blksz;
/*
* Pre-fault the pages to ensure slow (eg NFS) pages
@@ -674,7 +674,7 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS)
zil_commit(zilog, zp->z_id);
- int64_t nwritten = start_resid - uio->uio_resid;
+ const int64_t nwritten = start_resid - uio->uio_resid;
dataset_kstats_update_write_kstats(&zfsvfs->z_kstat, nwritten);
task_io_account_write(nwritten);