From 7505b4e4f99af589ce09ef97d21f0abc00ae79a8 Mon Sep 17 00:00:00 2001 From: Frank Zago Date: Tue, 17 Feb 2015 15:11:40 -0600 Subject: [PATCH] LU-5504 utils: add const qualifier to changelog accessors. Commit 6e1365 changed 4 functions, and commit 0f22e4 accidentally reverted them. This patch put them back, as well as adding new ones to changelog_rec_size(), changelog_rec_varsize(), changelog_rec_rename() and changelog_rec_jobid(). 6e1365 also changed changelog_rec_name() and changelog_rec_sname() to return a const, but that is not possible anymore. Signed-off-by: frank zago Change-Id: I19e389c422795c2ece4d7af369099cb733d3cb1a Reviewed-on: http://review.whamcloud.com/13787 Tested-by: Jenkins Reviewed-by: Henri Doreau Reviewed-by: Andreas Dilger Tested-by: Maloo --- lustre/include/lustre/lustre_user.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lustre/include/lustre/lustre_user.h b/lustre/include/lustre/lustre_user.h index 9b65dba..060ff29 100644 --- a/lustre/include/lustre/lustre_user.h +++ b/lustre/include/lustre/lustre_user.h @@ -897,18 +897,18 @@ static inline size_t changelog_rec_offset(enum changelog_rec_flags crf) return size; } -static inline size_t changelog_rec_size(struct changelog_rec *rec) +static inline size_t changelog_rec_size(const struct changelog_rec *rec) { return changelog_rec_offset(rec->cr_flags); } -static inline size_t changelog_rec_varsize(struct changelog_rec *rec) +static inline size_t changelog_rec_varsize(const struct changelog_rec *rec) { return changelog_rec_size(rec) - sizeof(*rec) + rec->cr_namelen; } static inline -struct changelog_ext_rename *changelog_rec_rename(struct changelog_rec *rec) +struct changelog_ext_rename *changelog_rec_rename(const struct changelog_rec *rec) { enum changelog_rec_flags crf = rec->cr_flags & CLF_VERSION; @@ -918,7 +918,7 @@ struct changelog_ext_rename *changelog_rec_rename(struct changelog_rec *rec) /* The jobid follows the rename extension, if present */ static inline -struct changelog_ext_jobid *changelog_rec_jobid(struct changelog_rec *rec) +struct changelog_ext_jobid *changelog_rec_jobid(const struct changelog_rec *rec) { enum changelog_rec_flags crf = rec->cr_flags & (CLF_VERSION | CLF_RENAME); @@ -928,18 +928,18 @@ struct changelog_ext_jobid *changelog_rec_jobid(struct changelog_rec *rec) } /* The name follows the rename and jobid extensions, if present */ -static inline char *changelog_rec_name(struct changelog_rec *rec) +static inline char *changelog_rec_name(const struct changelog_rec *rec) { return (char *)rec + changelog_rec_offset(rec->cr_flags & CLF_SUPPORTED); } -static inline size_t changelog_rec_snamelen(struct changelog_rec *rec) +static inline size_t changelog_rec_snamelen(const struct changelog_rec *rec) { return rec->cr_namelen - strlen(changelog_rec_name(rec)) - 1; } -static inline char *changelog_rec_sname(struct changelog_rec *rec) +static inline char *changelog_rec_sname(const struct changelog_rec *rec) { char *cr_name = changelog_rec_name(rec); -- 1.8.3.1