Re: [PATCH 2/3] mountd: trivial: name parameters for clarity

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

 




On 03/07/2010 03:08 PM, J. Bruce Fields wrote:
> Part of the reason for the previous bug was confusion between "subpath"
> and "path"; which is the shorter path, and which the longer?
> 
> "child" and "parent" seem less ambiguous.
> 
> Signed-off-by: J. Bruce Fields <bfields@xxxxxxxxxxxxxx>
> ---
>  utils/mountd/cache.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
> index ff27bbf..7dec468 100644
> --- a/utils/mountd/cache.c
> +++ b/utils/mountd/cache.c
> @@ -614,12 +614,12 @@ static int dump_to_cache(FILE *f, char *domain, char *path, struct exportent *ex
>  	return qword_eol(f);
>  }
>  
> -static int is_subdirectory(char *subpath, char *path)
> +static int is_subdirectory(char *child, char *parent)
>  {
> -	int l = strlen(path);
> +	int l = strlen(parent);
>  
> -	return strcmp(subpath, path) == 0
> -		|| (strncmp(subpath, path, l) == 0 && subpath[l] == '/');
> +	return strcmp(child, parent) == 0
> +		|| (strncmp(child, parent, l) == 0 && child[l] == '/');
>  }
>  
>  static int path_matches(nfs_export *exp, char *path)
Committed...

steved
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux