[Pvfs2-developers] server id
Sam Lang
slang at mcs.anl.gov
Wed Mar 12 11:01:58 EST 2008
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
-sam
>
>
> To my knowledge, none of the servers keep up with any other
> representation of their own address other than that host_id field,
> so it generally comes down to a string comparison.
>
> -Phil
>
> walt wrote:
>> If I have a bit of server code and it has a handle that might be
>> for the local server and might not, how can I figure that out
>> cleanly?
>> Walt
>> _______________________________________________
>> Pvfs2-developers mailing list
>> Pvfs2-developers at beowulf-underground.org
>> http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers
>
> _______________________________________________
> Pvfs2-developers mailing list
> Pvfs2-developers at beowulf-underground.org
> http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2417 bytes
Desc: not available
Url : http://www.beowulf-underground.org/pipermail/pvfs2-developers/attachments/20080312/9ec9a858/smime.bin
More information about the Pvfs2-developers
mailing list