Whamcloud - gitweb
LU-11561 ofd: return attr syncjournal to sync_journal 82/33582/4
authorJames Nunez <jnunez@whamcloud.com>
Mon, 5 Nov 2018 19:07:43 +0000 (12:07 -0700)
committerOleg Drokin <green@whamcloud.com>
Sat, 10 Nov 2018 05:23:48 +0000 (05:23 +0000)
The move of the ofd module from using proc to sysfs
changed sync_journal to syncjournal. We want to return
to using sync_journal to allow for interoperability
between old and new versions of Lustre and Lustre tests.

Test-Parameters: trivial testlist=replay-single

Signed-off-by: James Nunez <jnunez@whamcloud.com>
Change-Id: I6c9c61d64110bd7f3274aba0c831d5f6df0ab1f3
Reviewed-on: https://review.whamcloud.com/33582
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Sonia Sharma <sharmaso@whamcloud.com>
lustre/ofd/lproc_ofd.c
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_internal.h
lustre/ofd/ofd_io.c

index 6fa8d9e..c8f6d5d 100644 (file)
@@ -395,14 +395,14 @@ LUSTRE_RO_ATTR(fstype);
  * \retval             0 on success
  * \retval             negative value on error
  */
-static ssize_t syncjournal_show(struct kobject *kobj, struct attribute *attr,
+static ssize_t sync_journal_show(struct kobject *kobj, struct attribute *attr,
                                char *buf)
 {
        struct obd_device *obd = container_of(kobj, struct obd_device,
                                              obd_kset.kobj);
        struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
 
-       return sprintf(buf, "%u\n", ofd->ofd_syncjournal);
+       return sprintf(buf, "%u\n", ofd->ofd_sync_journal);
 }
 
 /**
@@ -418,7 +418,7 @@ static ssize_t syncjournal_show(struct kobject *kobj, struct attribute *attr,
  * \retval             \a count on success
  * \retval             negative number on error
  */
-static ssize_t syncjournal_store(struct kobject *kobj, struct attribute *attr,
+static ssize_t sync_journal_store(struct kobject *kobj, struct attribute *attr,
                                 const char *buffer, size_t count)
 {
        struct obd_device *obd = container_of(kobj, struct obd_device,
@@ -432,13 +432,13 @@ static ssize_t syncjournal_store(struct kobject *kobj, struct attribute *attr,
                return rc;
 
        spin_lock(&ofd->ofd_flags_lock);
-       ofd->ofd_syncjournal = val;
+       ofd->ofd_sync_journal = val;
        ofd_slc_set(ofd);
        spin_unlock(&ofd->ofd_flags_lock);
 
        return count;
 }
-LUSTRE_RW_ATTR(syncjournal);
+LUSTRE_RW_ATTR(sync_journal);
 
 /* This must be longer than the longest string below */
 #define SYNC_STATES_MAXLEN 16
@@ -927,7 +927,7 @@ static struct attribute *ofd_attrs[] = {
        &lustre_attr_client_cache_seconds.attr,
        &lustre_attr_degraded.attr,
        &lustre_attr_fstype.attr,
-       &lustre_attr_syncjournal.attr,
+       &lustre_attr_sync_journal.attr,
        &lustre_attr_sync_lock_cancel.attr,
        &lustre_attr_soft_sync_limit.attr,
        &lustre_attr_lfsck_speed_limit.attr,
index 86ffa1e..531d95a 100644 (file)
@@ -2854,7 +2854,7 @@ static int ofd_init0(const struct lu_env *env, struct ofd_device *m,
        spin_lock_init(&m->ofd_flags_lock);
        m->ofd_raid_degraded = 0;
        m->ofd_checksum_t10pi_enforce = 0;
-       m->ofd_syncjournal = 0;
+       m->ofd_sync_journal = 0;
        ofd_slc_set(m);
        m->ofd_soft_sync_limit = OFD_SOFT_SYNC_LIMIT_DEFAULT;
 
index a76cb69..794901e 100644 (file)
@@ -142,7 +142,7 @@ struct ofd_device {
        spinlock_t               ofd_flags_lock;
        unsigned long            ofd_raid_degraded:1,
                                 /* sync journal on writes */
-                                ofd_syncjournal:1,
+                                ofd_sync_journal:1,
                                 /* Protected by ofd_lastid_rwsem. */
                                 ofd_lastid_rebuilding:1,
                                 ofd_record_fid_accessed:1,
@@ -485,7 +485,7 @@ static inline struct ofd_thread_info *tsi2ofd_info(struct tgt_session_info *tsi)
  * sync on lock cancel if it is not enabled already. */
 static inline void ofd_slc_set(struct ofd_device *ofd)
 {
-       if (ofd->ofd_syncjournal == 1)
+       if (ofd->ofd_sync_journal == 1)
                ofd->ofd_lut.lut_sync_lock_cancel = NEVER_SYNC_ON_CANCEL;
        else if (ofd->ofd_lut.lut_sync_lock_cancel == NEVER_SYNC_ON_CANCEL)
                ofd->ofd_lut.lut_sync_lock_cancel = ALWAYS_SYNC_ON_CANCEL;
index f61d24a..908613f 100644 (file)
@@ -1150,7 +1150,7 @@ retry:
        if (IS_ERR(th))
                GOTO(out, rc = PTR_ERR(th));
 
-       th->th_sync |= ofd->ofd_syncjournal;
+       th->th_sync |= ofd->ofd_sync_journal;
        if (th->th_sync == 0) {
                for (i = 0; i < niocount; i++) {
                        if (!(lnb[i].lnb_flags & OBD_BRW_ASYNC)) {