Whamcloud - gitweb
LU-10906 llite: create checksums to replace checksum_pages 22/33222/3
authorJames Simmons <uja.ornl@yahoo.com>
Sat, 22 Sep 2018 21:13:50 +0000 (17:13 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 5 Oct 2018 22:27:50 +0000 (22:27 +0000)
Create llite.*.checksums, which matches llite.*.checksum_pages in
functionality. Now the llite layer have something that matches
osc.*.checksums. In time we can retire checksum_pages and change
it to its original purpose of enabling per-page checksums (which
was not implemented in the CLIO development).

Test-Parameters: trivial

Change-Id: I0e381e3626e835a448a6285cb81d27d67af93a54
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/33222
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/lproc_llite.c

index 0f6cfa7..beefbc5 100644 (file)
@@ -549,8 +549,8 @@ out:
 }
 LPROC_SEQ_FOPS(ll_max_cached_mb);
 
-static ssize_t checksum_pages_show(struct kobject *kobj, struct attribute *attr,
-                                  char *buf)
+static ssize_t checksums_show(struct kobject *kobj, struct attribute *attr,
+                             char *buf)
 {
        struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
                                              ll_kset.kobj);
@@ -558,10 +558,8 @@ static ssize_t checksum_pages_show(struct kobject *kobj, struct attribute *attr,
        return sprintf(buf, "%u\n", (sbi->ll_flags & LL_SBI_CHECKSUM) ? 1 : 0);
 }
 
-static ssize_t checksum_pages_store(struct kobject *kobj,
-                                   struct attribute *attr,
-                                   const char *buffer,
-                                   size_t count)
+static ssize_t checksums_store(struct kobject *kobj, struct attribute *attr,
+                              const char *buffer, size_t count)
 {
        struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
                                              ll_kset.kobj);
@@ -589,7 +587,9 @@ static ssize_t checksum_pages_store(struct kobject *kobj,
 
        return count;
 }
-LUSTRE_RW_ATTR(checksum_pages);
+LUSTRE_RW_ATTR(checksums);
+
+LUSTRE_ATTR(checksum_pages, 0644, checksums_show, checksums_store);
 
 static ssize_t ll_rd_track_id(struct kobject *kobj, char *buf,
                              enum stats_track_type type)
@@ -1230,6 +1230,7 @@ static struct attribute *llite_attrs[] = {
        &lustre_attr_client_type.attr,
        &lustre_attr_fstype.attr,
        &lustre_attr_uuid.attr,
+       &lustre_attr_checksums.attr,
        &lustre_attr_checksum_pages.attr,
        &lustre_attr_stats_track_pid.attr,
        &lustre_attr_stats_track_ppid.attr,