Thanks guys! That helps a lot!
Walt
Phil Carns wrote:
On Mar 12, 2008, at 8:53 AM, Phil Carns wrote:
The shortest way that I see is this:
1) call PINT_cached_config_get_server_name() to get the name of the
server that owns the handle in question (ie, "tcp://host:port")
2) call get_server_config_struct() to get a pointer to your local
server's configuration values
3) do a string comparison of the string from step 1 to the "host_id"
field in the struct from step 2 and see if they match
It might be cleaner/easier to do:
config = get_server_config_struct();
PINT_cached_config_get_server(fsid, config->host_id, server_type,
&extent_array);
If you don't care about the server type, you can pass in:
PINT_SERVER_TYPE_META|PINT_SERVER_TYPE_IO
Then with the returned extent_array, you can do:
is_my_handle = PINT_handle_in_extent_array(&extent_array, your_handle);
That function is defined in src/common/misc/extent-utils.h
Yeah, Sam's approach is definitely nicer. That way if you have to look
at many handles you only have to make one cached config call and then
you can use the much cheaper extent array function for each handle. My
approach required both searching the cached config and doing a string
comparison for every handle.
-Phil
begin:vcard
fn:Walt Ligon
n:Ligon;Walt
org:Clemson University;ECE Department
adr;dom:;;;Clemson;SC;29634
email;internet:[EMAIL PROTECTED]
title:Associate Professor
tel;work:864-656-1224
x-mozilla-html:FALSE
version:2.1
end:vcard
_______________________________________________
Pvfs2-developers mailing list
Pvfs2-developers@beowulf-underground.org
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers