All of lore.kernel.org
 help / color / mirror / Atom feed
* get_lock_alloc_layout
@ 2010-07-01 13:50 Andy Adamson
  2010-07-01 14:11 ` get_lock_alloc_layout Benny Halevy
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Adamson @ 2010-07-01 13:50 UTC (permalink / raw)
  To: Benny Halevy; +Cc: linux-nfs@vger.kernel.org Mailing list

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:

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

  

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-01 14:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-01 13:50 get_lock_alloc_layout Andy Adamson
2010-07-01 14:11 ` get_lock_alloc_layout Benny Halevy
2010-07-01 14:19   ` get_lock_alloc_layout Andy Adamson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.