#include <poll.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <sys/ioctl.h>
#include <lustre/lustreapi.h>
+#include <linux/lustre/lustre_ioctl.h>
static int chlg_dev_path(char *path, size_t path_len, const char *device)
struct changelog_private *cp;
static bool warned_extra_flags;
static bool warned_jobid;
- static bool warned_follow;
char cdev_path[PATH_MAX];
int rc;
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;
rec_extra_fmt |= CLFE_UIDGID;
if (cp->clp_send_extra_flags & CHANGELOG_EXTRA_FLAG_NID)
rec_extra_fmt |= CLFE_NID;
+ if (cp->clp_send_extra_flags & CHANGELOG_EXTRA_FLAG_OMODE)
+ rec_extra_fmt |= CLFE_OPEN;
+ if (cp->clp_send_extra_flags & CHANGELOG_EXTRA_FLAG_XATTR)
+ rec_extra_fmt |= CLFE_XATTR;
}
if (cp->clp_buf + cp->clp_buf_len <= cp->clp_buf_pos) {
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)
{