Modify *run_ioctl_interruptible* function
Make *run_ioctl_interruptible* a wrapper for new function *run_ioctl_interruptible_retry_option*. Make new function *run_ioctl_interruptible_retry* - a wrapper for *run_ioctl_interruptible_retry_option*. *run_ioctl_interruptible_retry_option* is old *run_ioctl_interruptible* function with one more parameter to decide if call *run_ioctl* or *run_ioctl_retry*. Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
This commit is contained in:
parent
cfca19b024
commit
db35d5a299
@ -433,9 +433,10 @@ void *print_command_progress(void *th_arg)
|
|||||||
* Catch SIGINT signal.
|
* Catch SIGINT signal.
|
||||||
* @param friendly_name name of management operation that shall
|
* @param friendly_name name of management operation that shall
|
||||||
* be displayed in command prompt
|
* be displayed in command prompt
|
||||||
|
* @param retry decide if ioctl attepmts should retry
|
||||||
*/
|
*/
|
||||||
int run_ioctl_interruptible(int fd, int command, void *cmd,
|
static int run_ioctl_interruptible_retry_option(int fd, int command, void *cmd,
|
||||||
char *friendly_name, int cache_id, int core_id)
|
char *friendly_name, int cache_id, int core_id, bool retry)
|
||||||
{
|
{
|
||||||
pthread_t thread;
|
pthread_t thread;
|
||||||
int ioctl_res;
|
int ioctl_res;
|
||||||
@ -474,6 +475,33 @@ int run_ioctl_interruptible(int fd, int command, void *cmd,
|
|||||||
return ioctl_res;
|
return ioctl_res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Run ioctl in a way that displays progressbar (if flushing operation takes longer)
|
||||||
|
* Catch SIGINT signal.
|
||||||
|
* @param friendly_name name of management operation that shall
|
||||||
|
* be displayed in command prompt
|
||||||
|
*/
|
||||||
|
int run_ioctl_interruptible(int fd, int command, void *cmd,
|
||||||
|
char *friendly_name, int cache_id, int core_id)
|
||||||
|
{
|
||||||
|
return run_ioctl_interruptible_retry_option(fd, command, cmd, friendly_name,
|
||||||
|
cache_id, core_id, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Run ioctl in a way that displays progressbar (if flushing operation
|
||||||
|
* takes longer) with retries.
|
||||||
|
* Catch SIGINT signal.
|
||||||
|
* @param friendly_name name of management operation that shall
|
||||||
|
* be displayed in command prompt
|
||||||
|
*/
|
||||||
|
int run_ioctl_interruptible_retry(int fd, int command, void *cmd,
|
||||||
|
char *friendly_name, int cache_id, int core_id)
|
||||||
|
{
|
||||||
|
return run_ioctl_interruptible_retry_option(fd, command, cmd, friendly_name,
|
||||||
|
cache_id, core_id, true);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief ioctl wrapper
|
* @brief ioctl wrapper
|
||||||
* @param[in] fd as for IOCTL(2)
|
* @param[in] fd as for IOCTL(2)
|
||||||
|
@ -31,6 +31,8 @@ int run_ioctl(int fd, int command, void *cmd);
|
|||||||
int run_ioctl_retry(int fd, int command, void *cmd);
|
int run_ioctl_retry(int fd, int command, void *cmd);
|
||||||
int run_ioctl_interruptible(int fd, int command, void *cmd,
|
int run_ioctl_interruptible(int fd, int command, void *cmd,
|
||||||
char *friendly_name, int cache_id, int core_id);
|
char *friendly_name, int cache_id, int core_id);
|
||||||
|
int run_ioctl_interruptible_retry(int fd, int command, void *cmd,
|
||||||
|
char *friendly_name, int cache_id, int core_id);
|
||||||
int open_ctrl_device();
|
int open_ctrl_device();
|
||||||
int was_ioctl_interrupted();
|
int was_ioctl_interrupted();
|
||||||
void set_default_sig_handler();
|
void set_default_sig_handler();
|
||||||
|
Loading…
Reference in New Issue
Block a user