bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH] Add the .MASTER node to the eth-multiplexer.


From: Da Zheng
Subject: Re: [PATCH] Add the .MASTER node to the eth-multiplexer.
Date: Tue, 22 Dec 2009 19:37:21 +0800
User-agent: Thunderbird 2.0.0.23 (Macintosh/20090812)

Hi,

Sergiu Ivanov wrote:
> diff --git a/eth-multiplexer/netfs_impl.c b/eth-multiplexer/netfs_impl.c
> index c70701b..875ff48 100644
> --- a/eth-multiplexer/netfs_impl.c
> +++ b/eth-multiplexer/netfs_impl.c
> @@ -31,6 +31,10 @@
>  #include "vdev.h"
>  #include "util.h"
>  
> +/* The .MASTER node which will be used by static instances of
> +   devnode.  */
> +struct node * master_node;
> +
>  #define DIRENTS_CHUNK_SIZE      (8*1024)
>  /* Returned directory entries are aligned to blocks this many bytes long.
>   * Must be a power of two.  */
> @@ -85,6 +89,18 @@ new_node (struct lnode *ln, struct node **np)
>  struct node *
>  lookup (char *name)
>  {
> +  if (strcmp(name, MASTER_NODE_NAME) == 0)
> +    {
> +      netfs_nref (master_node);
> +
> +      /* netfs_attempt_lookup expects the returned node not to be
> +      locked, while `master_node` might have been locked in the
> +      previous lookups.  */
> +      mutex_unlock (&master_node->lock);
So the lock might or might not have been locked? Why is it so?
> +
> +      return master_node;
> +    }
> +

Best regards,
Zheng Da




reply via email to

[Prev in Thread] Current Thread [Next in Thread]