On Wed, Nov 9, 2011 at 1:08 PM, Noah Watkins <jayhawk@xxxxxxxxxxxx> wrote: > On Wed, Nov 9, 2011 at 12:56, Sage Weil <sage@xxxxxxxxxxxx> wrote: >> On Tue, 8 Nov 2011, Noah Watkins wrote: >> >> The only issue with this is that, in the event that you don't guess a >> sufficiently large array on the first call, you may need to call again, >> and in some cases that may mean multiple MDS requests. Normally that's >> not the case. And a smart caller should guess 4 and only pass 0 and then >> N if 4 failed. But a naive caller will always make two calls, first with >> 0 and then with N, and in some cases that's actually slower. > > The code I'm using makes a large guess, and an alternative is for the > user to cache the replication factor for a file? A similar approach using > ERANGE is used by listxattr (well, it communicates ERANGE via errno). > In any case, even with Tommi's *naddr_out approach, a certain amount > of precise documentation on it's semantics is needed. I can't imagine anybody needing location data inside of a fast path, in any case. So it probably shouldn't matter, and for any bizarre case where it does we can probably expect a certain level of knowledge! -Greg -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html