On Jul 1, 2010, at 10:11 AM, Benny Halevy wrote:
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.
Well, I feel that for code maintainability that we use the normal
form. I'll submit a patch.
-->Andy
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