.SH NAME
lfs pcc state \- display current PCC state of file
.SH SYNOPSIS
-.BR "lfs pcc state " "\fIFILE \fR...>"
+.BR "lfs pcc state " "<\fIFILE\fR ...>"
.SH DESCRIPTION
Display the current PCC cache state of
.I FILE
.B flags
shows additional file states, including
.B attaching
-for files that are not fully copied into cache,
+for files that are not fully copied into cache.
+The
+.B pin
+shows the pin information if they exist.
.SH EXAMPLES
.TP
.B $ lfs pcc state /mnt/lustre/file
const char *path;
char fullpath[PATH_MAX];
struct lu_pcc_state state;
+ char buff[XATTR_SIZE_MAX];
optind = 1;
continue;
}
+ rc2 = getxattr(path, XATTR_LUSTRE_PIN, buff, sizeof(buff));
+ if (rc2 < 0) {
+ if (errno != ENODATA) {
+ if (rc == 0)
+ rc = -errno;
+ fprintf(stderr,
+ "%s: cannot get PCC pin xattr of '%s': %s\n",
+ argv[0], path, strerror(errno));
+ continue;
+ } else {
+ rc2 = 0;
+ }
+ }
+ buff[rc2] = '\0';
+
printf("file: %s", path);
printf(", type: %s", pcc_type2string(state.pccs_type));
if (state.pccs_type == LU_PCC_NONE &&
state.pccs_open_count == 0) {
if (state.pccs_flags & PCC_STATE_FL_ATTACHING)
printf(", flags: attaching");
- printf("\n");
- continue;
+ } else {
+ printf(", PCC_file: %s", state.pccs_path);
+ if (state.pccs_flags & PCC_STATE_FL_UNLINKED)
+ printf(" (unlinked)");
+ printf(", open_count: %u", state.pccs_open_count);
+ printf(", flags: %x", state.pccs_flags);
}
- printf(", PCC_file: %s", state.pccs_path);
- if (state.pccs_flags & PCC_STATE_FL_UNLINKED)
- printf(" (unlinked)");
- printf(", open_count: %u", state.pccs_open_count);
- printf(", flags: %x", state.pccs_flags);
+ if (buff[0] != '\0')
+ printf(", pin: %s", buff);
printf("\n");
}
return rc;