From 8701b62863eb71a67b80da873726903920d1bada Mon Sep 17 00:00:00 2001 From: James Nunez Date: Mon, 5 Nov 2018 12:07:43 -0700 Subject: [PATCH] LU-11561 ofd: return attr syncjournal to sync_journal 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 Change-Id: I6c9c61d64110bd7f3274aba0c831d5f6df0ab1f3 Reviewed-on: https://review.whamcloud.com/33582 Reviewed-by: James Simmons Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Sonia Sharma --- lustre/ofd/lproc_ofd.c | 12 ++++++------ lustre/ofd/ofd_dev.c | 2 +- lustre/ofd/ofd_internal.h | 4 ++-- lustre/ofd/ofd_io.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lustre/ofd/lproc_ofd.c b/lustre/ofd/lproc_ofd.c index 6fa8d9e..c8f6d5d 100644 --- a/lustre/ofd/lproc_ofd.c +++ b/lustre/ofd/lproc_ofd.c @@ -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, diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c index 86ffa1e..531d95a 100644 --- a/lustre/ofd/ofd_dev.c +++ b/lustre/ofd/ofd_dev.c @@ -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; diff --git a/lustre/ofd/ofd_internal.h b/lustre/ofd/ofd_internal.h index a76cb69..794901e 100644 --- a/lustre/ofd/ofd_internal.h +++ b/lustre/ofd/ofd_internal.h @@ -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; diff --git a/lustre/ofd/ofd_io.c b/lustre/ofd/ofd_io.c index f61d24a..908613f 100644 --- a/lustre/ofd/ofd_io.c +++ b/lustre/ofd/ofd_io.c @@ -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)) { -- 1.8.3.1