* detach PCC cache of a file by using fd.
*
* \param fd File handle.
+ * \param option Detach option
*
* \return 0 on success, an error code otherwise.
*/
-int llapi_pcc_detach_fd(int fd)
+int llapi_pcc_detach_fd(int fd, __u32 option)
{
+ struct lu_pcc_detach detach;
int rc;
- rc = ioctl(fd, LL_IOC_PCC_DETACH);
+ detach.pccd_opt = option;
+ rc = ioctl(fd, LL_IOC_PCC_DETACH, &detach);
return rc;
}
*
* \param mntpath Fullpath to the client mount point.
* \param fid FID of the file.
+ * \param option Detach option.
*
* \return 0 on success, an error code otherwise.
*/
-int llapi_pcc_detach_fid(const char *mntpath, const struct lu_fid *fid)
+int llapi_pcc_detach_fid(const char *mntpath, const struct lu_fid *fid,
+ __u32 option)
{
int rc;
int fd;
- struct lu_pcc_detach detach;
+ struct lu_pcc_detach_fid detach;
rc = get_root_path(WANT_FD, NULL, &fd, (char *)mntpath, -1);
if (rc) {
* files.
*/
detach.pccd_fid = *fid;
+ detach.pccd_opt = option;
rc = ioctl(fd, LL_IOC_PCC_DETACH_BY_FID, &detach);
close(fd);
return rc;
* detach PCC cache of a file via FID.
*
* \param mntpath Fullpath to the client mount point.
- * \param fid FID string of the file.
+ * \param fidstr FID string of the file.
+ * \param option Detach option.
*
* \return 0 on success, an error code otherwise.
*/
-int llapi_pcc_detach_fid_str(const char *mntpath, const char *fidstr)
+int llapi_pcc_detach_fid_str(const char *mntpath, const char *fidstr,
+ __u32 option)
{
int rc;
struct lu_fid fid;
return -EINVAL;
}
- rc = llapi_pcc_detach_fid(mntpath, &fid);
+ rc = llapi_pcc_detach_fid(mntpath, &fid, option);
return rc;
}
/**
* detach PCC cache of a file.
*
- * \param path Fullpath to the file to operate on.
+ * \param path Fullpath to the file to operate on.
+ * \param option Detach option.
*
* \return 0 on success, an error code otherwise.
*/
-int llapi_pcc_detach_file(const char *path)
+int llapi_pcc_detach_file(const char *path, __u32 option)
{
int rc;
int fd;
return rc;
}
- rc = llapi_pcc_detach_fd(fd);
+ rc = llapi_pcc_detach_fd(fd, option);
close(fd);
return rc;
}