struct list_head pmi_linkage;
};
+/* Lazy file size */
+struct pcc_match_size {
+ __u64 pms_size;
+ struct list_head pms_linkage;
+};
+
/* wildcard file name */
struct pcc_match_fname {
char *pmf_name;
PCC_FIELD_GID,
PCC_FIELD_PROJID,
PCC_FIELD_FNAME,
+ PCC_FIELD_SIZE,
+ PCC_FIELD_MTIME,
PCC_FIELD_MAX
};
+enum pcc_field_op {
+ PCC_FIELD_OP_EQ = 0,
+ PCC_FIELD_OP_LT = 1,
+ PCC_FIELD_OP_GT = 2,
+ PCC_FIELD_OP_MAX = 3,
+ PCC_FIELD_OP_INV = PCC_FIELD_MAX,
+};
+
struct pcc_expression {
- enum pcc_field pe_field;
- struct list_head pe_cond;
struct list_head pe_linkage;
+ enum pcc_field pe_field;
+ enum pcc_field_op pe_opc;
+ union {
+ struct list_head pe_cond;
+ __u64 pe_size; /* file size in bytes */
+ __u64 pe_mtime; /* relative age in seconds */
+ __u32 pe_id; /* UID/GID/PROJID */
+ };
};
struct pcc_conjunction {
__u32 pm_uid;
__u32 pm_gid;
__u32 pm_projid;
+ __u64 pm_size;
+ __u64 pm_mtime;
struct qstr *pm_name;
};
PCC_DATASET_AUTO_ATTACH = PCC_DATASET_OPEN_ATTACH |
PCC_DATASET_IO_ATTACH |
PCC_DATASET_STAT_ATTACH,
- /* PCC backend is only used for RW-PCC */
- PCC_DATASET_RWPCC = 0x10,
- /* PCC backend is only used for RO-PCC */
- PCC_DATASET_ROPCC = 0x20,
- /* PCC backend provides caching services for both RW-PCC and RO-PCC */
- PCC_DATASET_PCC_ALL = PCC_DATASET_RWPCC | PCC_DATASET_ROPCC,
+ /* PCC backend is only used for PCC-RW */
+ PCC_DATASET_PCCRW = 0x10,
+ /* PCC backend is only used for PCC-RO */
+ PCC_DATASET_PCCRO = 0x20,
+ /* PCC backend provides caching services for both PCC-RW and PCC-RO */
+ PCC_DATASET_PCC_ALL = PCC_DATASET_PCCRW | PCC_DATASET_PCCRO,
+ /* Default PCC caching mode: PCC-RO mode */
+ PCC_DATASET_PCC_DEFAULT = PCC_DATASET_PCCRO,
};
struct pcc_dataset {
struct path pccd_path; /* Root path */
struct list_head pccd_linkage; /* Linked to pccs_datasets */
atomic_t pccd_refcount; /* Reference count */
+ enum hsmtool_type pccd_hsmtool_type; /*HSM copytool type */
};
struct pcc_super {
*/
atomic_t pcci_refcount;
/* Whether readonly or readwrite PCC */
- enum lu_pcc_type pcci_type;
+ enum lu_pcc_type pcci_type:8;
/* Whether the inode attr is cached locally */
bool pcci_attr_valid;
+ /* Whether the PCC inode is unlinked at detach */
+ bool pcci_unlinked;
/* Layout generation */
__u32 pcci_layout_gen;
/*
PIT_FAULT,
/* fsync system call handling */
PIT_FSYNC,
-#ifdef HAVE_DEFAULT_FILE_SPLICE_READ_EXPORT
/* splice_read system call */
PIT_SPLICE_READ,
-#endif
/* open system call */
PIT_OPEN
};
struct list_head pccc_conds;
char *pccc_conds_str;
enum pcc_dataset_flags pccc_flags;
+ enum hsmtool_type pccc_hsmtool_type;
} pccc_add;
struct pcc_cmd_del {
__u32 pccc_pad;
int pcc_readwrite_attach_fini(struct file *file, struct inode *inode,
__u32 gen, bool lease_broken, int rc,
bool attached);
-int pcc_ioctl_detach(struct inode *inode, __u32 opt);
+int pcc_ioctl_attach(struct file *file, struct inode *inode,
+ struct lu_pcc_attach *attach);
+int pcc_ioctl_detach(struct inode *inode, __u32 *flags);
int pcc_ioctl_state(struct file *file, struct inode *inode,
struct lu_pcc_state *state);
void pcc_file_init(struct pcc_file *pccf);
void pcc_create_attach_cleanup(struct super_block *sb,
struct pcc_create_attach *pca);
struct pcc_dataset *pcc_dataset_match_get(struct pcc_super *super,
+ enum lu_pcc_type type,
struct pcc_matcher *matcher);
void pcc_dataset_put(struct pcc_dataset *dataset);
void pcc_inode_free(struct inode *inode);