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 <fzago@cray.com>
Change-Id: I19e389c422795c2ece4d7af369099cb733d3cb1a
Reviewed-on: http://review.whamcloud.com/13787
Tested-by: Jenkins
Reviewed-by: Henri Doreau <henri.doreau@cea.fr>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
-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);
}
{
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
{
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;
{
enum changelog_rec_flags crf = rec->cr_flags & CLF_VERSION;
/* The jobid follows the rename extension, if present */
static inline
/* 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);
{
enum changelog_rec_flags crf = rec->cr_flags &
(CLF_VERSION | CLF_RENAME);
}
/* The name follows the rename and jobid extensions, if present */
}
/* 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);
}
{
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;
}
{
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);
{
char *cr_name = changelog_rec_name(rec);