X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Futils%2Fliblustreapi_chlg.c;h=fc83fa4e56b5a88f2433be764bd05dd7d8ad42cd;hp=5735fc1a9457beacfeb39c05d79becf4c8757c77;hb=e215002883d5620f43615013452935da8e7e3f8c;hpb=52d1671d98c29bd54430718b6e41df136e596c74 diff --git a/lustre/utils/liblustreapi_chlg.c b/lustre/utils/liblustreapi_chlg.c index 5735fc1..fc83fa4 100644 --- a/lustre/utils/liblustreapi_chlg.c +++ b/lustre/utils/liblustreapi_chlg.c @@ -36,8 +36,10 @@ #include #include #include +#include #include +#include static int chlg_dev_path(char *path, size_t path_len, const char *device) @@ -93,7 +95,6 @@ int llapi_changelog_start(void **priv, enum changelog_send_flag flags, struct changelog_private *cp; static bool warned_extra_flags; static bool warned_jobid; - static bool warned_follow; char cdev_path[PATH_MAX]; int rc; @@ -150,12 +151,12 @@ int llapi_changelog_start(void **priv, enum changelog_send_flag flags, warned_jobid = true; } - /* Behavior expected by CHANGELOG_FLAG_FOLLOW is not implemented, warn - * the user and ignore it. */ - if (flags & CHANGELOG_FLAG_FOLLOW && !warned_follow) { - llapi_err_noerrno(LLAPI_MSG_WARN, "warning: %s() called with " - "CHANGELOG_FLAG_FOLLOW (ignored)", __func__); - warned_follow = true; + if (flags & CHANGELOG_FLAG_FOLLOW) { + int rc; + rc = ioctl(cp->clp_fd, OBD_IOC_CHLG_POLL, 1); + if (rc < 0) + llapi_err_noerrno(LLAPI_MSG_ERROR, "can't enable " + "CHANGELOG_FLAG_FOLLOW"); } return 0; @@ -294,6 +295,14 @@ int llapi_changelog_free(struct changelog_rec **rech) return 0; } +int llapi_changelog_in_buf(void *priv) +{ + struct changelog_private *cp = priv; + if (cp->clp_buf + cp->clp_buf_len > cp->clp_buf_pos) + return 1; + return 0; +} + int llapi_changelog_clear(const char *mdtname, const char *idstr, long long endrec) {