Re: [PATCH v2 10/22] multipathd: split check_path into two functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2024-09-12 at 17:49 -0400, Benjamin Marzinski wrote:
> Split out the code that updates a path's state and sets up the next
> check time into its own function, update_path().
> 
> Signed-off-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx>
> ---
>  multipathd/main.c | 31 ++++++++++++++++++++++---------
>  1 file changed, 22 insertions(+), 9 deletions(-)
> 
> diff --git a/multipathd/main.c b/multipathd/main.c
> index 9319751e..8bfb166d 100644
> --- a/multipathd/main.c
> +++ b/multipathd/main.c
> @@ -2390,6 +2390,7 @@ sync_mpp(struct vectors * vecs, struct
> multipath *mpp, unsigned int ticks)
>  }
>  
>  enum check_path_return {
> +	CHECK_PATH_STARTED,
>  	CHECK_PATH_CHECKED,
>  	CHECK_PATH_SKIPPED,
>  	CHECK_PATH_REMOVED,
> @@ -2629,13 +2630,10 @@ update_path_state (struct vectors * vecs,
> struct path * pp)
>  }
>  
>  static int
> -check_path (struct vectors * vecs, struct path * pp, unsigned int
> ticks,
> -	    time_t start_secs)
> +check_path (struct path * pp, unsigned int ticks)
>  {
> -	int r;
> -	unsigned int adjust_int, checkint, max_checkint;
> +	unsigned int checkint;
>  	struct config *conf;
> -	time_t next_idx, goal_idx;
>  
>  	if (pp->initialized == INIT_REMOVED)
>  		return CHECK_PATH_SKIPPED;
> @@ -2647,8 +2645,6 @@ check_path (struct vectors * vecs, struct path
> * pp, unsigned int ticks,
>  
>  	conf = get_multipath_config();
>  	checkint = conf->checkint;
> -	max_checkint = conf->max_checkint;
> -	adjust_int = conf->adjust_int;
>  	put_multipath_config(conf);
>  

After this change, we set only checking in this RCU critical section,
and checkint is only used in the if clause below. Perhaps move the
critical section into the if block?

Martin







[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux