Re: get_lock_alloc_layout

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

 



On Jul. 01, 2010, 16:50 +0300, Andy Adamson <andros@xxxxxxxxxx> wrote:
> Hi Benny
> 
> Why do we have the complexity of waiting on a bit lock for allocating  
> a layout? Why can't we use the normal form:

It's possible but the expectation was that the race here would
not be infrequent enough it's worth (statistically) losing it.

Benny

> 
> take the i_lock
> lookup layout
> if (layout == NULL) {
>          give up i_lock
>          allocate and init new layout
>                 return NULL if allocation fails
>          take the i_lock
>          lookup layout
>          if (layout == NULL)
>                  set new layout for return
>          else
>                  set found layout for return
> }
> give up i_lock
> if new was allocated and not used
>            free the new layout
> return layout
> 
> 
> -->Andy
> 
>   
> --
> 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
--
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