aboutsummaryrefslogtreecommitdiff
path: root/module/os/linux
diff options
context:
space:
mode:
Diffstat (limited to 'module/os/linux')
-rw-r--r--module/os/linux/spl/spl-kstat.c4
-rw-r--r--module/os/linux/zfs/Makefile.in1
-rw-r--r--module/os/linux/zfs/arc_os.c3
-rw-r--r--module/os/linux/zfs/spa_stats.c28
-rw-r--r--module/os/linux/zfs/zfs_vfsops.c10
-rw-r--r--module/os/linux/zfs/zpl_super.c20
6 files changed, 47 insertions, 19 deletions
diff --git a/module/os/linux/spl/spl-kstat.c b/module/os/linux/spl/spl-kstat.c
index b971b4498cc6..b9eeb332ee57 100644
--- a/module/os/linux/spl/spl-kstat.c
+++ b/module/os/linux/spl/spl-kstat.c
@@ -22,6 +22,10 @@
* with the SPL. If not, see <http://www.gnu.org/licenses/>.
*
* Solaris Porting Layer (SPL) Kstat Implementation.
+ *
+ * Links to Illumos.org for more information on kstat function:
+ * [1] https://illumos.org/man/1M/kstat
+ * [2] https://illumos.org/man/9f/kstat_create
*/
#include <linux/seq_file.h>
diff --git a/module/os/linux/zfs/Makefile.in b/module/os/linux/zfs/Makefile.in
index 9f493ef16de5..87414d6eacc5 100644
--- a/module/os/linux/zfs/Makefile.in
+++ b/module/os/linux/zfs/Makefile.in
@@ -14,7 +14,6 @@ $(MODULE)-objs += ../os/linux/zfs/qat.o
$(MODULE)-objs += ../os/linux/zfs/qat_compress.o
$(MODULE)-objs += ../os/linux/zfs/qat_crypt.o
$(MODULE)-objs += ../os/linux/zfs/spa_misc_os.o
-$(MODULE)-objs += ../os/linux/zfs/spa_stats.o
$(MODULE)-objs += ../os/linux/zfs/vdev_disk.o
$(MODULE)-objs += ../os/linux/zfs/vdev_file.o
$(MODULE)-objs += ../os/linux/zfs/zfs_acl.o
diff --git a/module/os/linux/zfs/arc_os.c b/module/os/linux/zfs/arc_os.c
index 92f9bae8ccd3..792c75d46ffe 100644
--- a/module/os/linux/zfs/arc_os.c
+++ b/module/os/linux/zfs/arc_os.c
@@ -113,8 +113,7 @@ arc_free_memory(void)
return (ptob(si.freeram - si.freehigh));
#else
return (ptob(nr_free_pages() +
- nr_inactive_file_pages() +
- nr_slab_reclaimable_pages()));
+ nr_inactive_file_pages()));
#endif /* CONFIG_HIGHMEM */
}
diff --git a/module/os/linux/zfs/spa_stats.c b/module/os/linux/zfs/spa_stats.c
index 86cefa6dddab..cf0be3c45dc8 100644
--- a/module/os/linux/zfs/spa_stats.c
+++ b/module/os/linux/zfs/spa_stats.c
@@ -835,7 +835,9 @@ spa_mmp_history_add(spa_t *spa, uint64_t txg, uint64_t timestamp,
static void *
spa_state_addr(kstat_t *ksp, loff_t n)
{
- return (ksp->ks_private); /* return the spa_t */
+ if (n == 0)
+ return (ksp->ks_private); /* return the spa_t */
+ return (NULL);
}
static int
@@ -1026,22 +1028,16 @@ spa_stats_destroy(spa_t *spa)
spa_mmp_history_destroy(spa);
}
-#if defined(_KERNEL)
-/* CSTYLED */
-module_param(zfs_read_history, int, 0644);
-MODULE_PARM_DESC(zfs_read_history,
- "Historical statistics for the last N reads");
+/* BEGIN CSTYLED */
+ZFS_MODULE_PARAM(zfs, zfs_, read_history, INT, ZMOD_RW,
+ "Historical statistics for the last N reads");
-module_param(zfs_read_history_hits, int, 0644);
-MODULE_PARM_DESC(zfs_read_history_hits,
- "Include cache hits in read history");
+ZFS_MODULE_PARAM(zfs, zfs_, read_history_hits, INT, ZMOD_RW,
+ "Include cache hits in read history");
-module_param(zfs_txg_history, int, 0644);
-MODULE_PARM_DESC(zfs_txg_history,
- "Historical statistics for the last N txgs");
+ZFS_MODULE_PARAM(zfs_txg, zfs_txg_, history, INT, ZMOD_RW,
+ "Historical statistics for the last N txgs");
-module_param(zfs_multihost_history, int, 0644);
-MODULE_PARM_DESC(zfs_multihost_history,
- "Historical statistics for last N multihost writes");
+ZFS_MODULE_PARAM(zfs_multihost, zfs_multihost_, history, INT, ZMOD_RW,
+ "Historical statistics for last N multihost writes");
/* END CSTYLED */
-#endif
diff --git a/module/os/linux/zfs/zfs_vfsops.c b/module/os/linux/zfs/zfs_vfsops.c
index db831bf54704..389200b52127 100644
--- a/module/os/linux/zfs/zfs_vfsops.c
+++ b/module/os/linux/zfs/zfs_vfsops.c
@@ -2126,6 +2126,16 @@ zfs_get_vfs_flag_unmounted(objset_t *os)
return (unmounted);
}
+/*ARGSUSED*/
+void
+zfsvfs_update_fromname(const char *oldname, const char *newname)
+{
+ /*
+ * We don't need to do anything here, the devname is always current by
+ * virtue of zfsvfs->z_sb->s_op->show_devname.
+ */
+}
+
void
zfs_init(void)
{
diff --git a/module/os/linux/zfs/zpl_super.c b/module/os/linux/zfs/zpl_super.c
index 75adff51782e..333c647466cc 100644
--- a/module/os/linux/zfs/zpl_super.c
+++ b/module/os/linux/zfs/zpl_super.c
@@ -183,6 +183,25 @@ zpl_remount_fs(struct super_block *sb, int *flags, char *data)
}
static int
+__zpl_show_devname(struct seq_file *seq, zfsvfs_t *zfsvfs)
+{
+ char *fsname;
+
+ fsname = kmem_alloc(ZFS_MAX_DATASET_NAME_LEN, KM_SLEEP);
+ dmu_objset_name(zfsvfs->z_os, fsname);
+ seq_puts(seq, fsname);
+ kmem_free(fsname, ZFS_MAX_DATASET_NAME_LEN);
+
+ return (0);
+}
+
+static int
+zpl_show_devname(struct seq_file *seq, struct dentry *root)
+{
+ return (__zpl_show_devname(seq, root->d_sb->s_fs_info));
+}
+
+static int
__zpl_show_options(struct seq_file *seq, zfsvfs_t *zfsvfs)
{
seq_printf(seq, ",%s",
@@ -314,6 +333,7 @@ const struct super_operations zpl_super_operations = {
.sync_fs = zpl_sync_fs,
.statfs = zpl_statfs,
.remount_fs = zpl_remount_fs,
+ .show_devname = zpl_show_devname,
.show_options = zpl_show_options,
.show_stats = NULL,
};