示例#1
0
int compare_9p_owner(state_owner_t *owner1, state_owner_t *owner2)
{
	if (isFullDebug(COMPONENT_STATE) && isDebug(COMPONENT_HASHTABLE)) {
		char str1[LOG_BUFF_LEN / 2];
		char str2[LOG_BUFF_LEN / 2];
		struct display_buffer dspbuf1 = {sizeof(str1), str1, str1};
		struct display_buffer dspbuf2 = {sizeof(str2), str2, str2};

		display_9p_owner(&dspbuf1, owner1);
		display_9p_owner(&dspbuf2, owner2);
		LogFullDebug(COMPONENT_STATE, "{%s} vs {%s}", str1, str2);
	}

	if (owner1 == NULL || owner2 == NULL)
		return 1;

	if (owner1 == owner2)
		return 0;

	if (owner1->so_owner.so_9p_owner.proc_id !=
	    owner2->so_owner.so_9p_owner.proc_id)
		return 1;
#if 0
	if (memcmp
	    (&owner1->so_owner.so_9p_owner.client_addr,
	     &owner2->so_owner.so_9p_owner.client_addr,
	     sizeof(struct sockaddr_storage)))
		return 1;
#endif

	/* so_owner_len is always 0, don't compare so_owner_val */
	return 0;
}
示例#2
0
int compare_9p_owner(state_owner_t *owner1, state_owner_t *owner2)
{
    if (isFullDebug(COMPONENT_STATE) && isDebug(COMPONENT_HASHTABLE)) {
        char str1[HASHTABLE_DISPLAY_STRLEN];
        char str2[HASHTABLE_DISPLAY_STRLEN];

        display_9p_owner(owner1, str1);
        display_9p_owner(owner2, str2);
        LogFullDebug(COMPONENT_STATE, "{%s} vs {%s}", str1, str2);
    }

    if (owner1 == NULL || owner2 == NULL)
        return 1;

    if (owner1 == owner2)
        return 0;

    if (owner1->so_owner.so_9p_owner.proc_id !=
            owner2->so_owner.so_9p_owner.proc_id)
        return 1;
#if 0
    if (memcmp
            (&owner1->so_owner.so_9p_owner.client_addr,
             &owner2->so_owner.so_9p_owner.client_addr,
             sizeof(struct sockaddr_storage)))
        return 1;
#endif

    if (owner1->so_owner_len != owner2->so_owner_len)
        return 1;

    return memcmp(owner1->so_owner_val, owner2->so_owner_val,
                  owner1->so_owner_len);
}
示例#3
0
int display_9p_owner_key(struct gsh_buffdesc *buff, char *str)
{
	struct display_buffer dspbuf = {HASHTABLE_DISPLAY_STRLEN, str, str};

	display_9p_owner(&dspbuf, buff->addr);
	return display_buffer_len(&dspbuf);
}
示例#4
0
int display_9p_owner_val(hash_buffer_t * pbuff, char *str)
{
  return display_9p_owner((state_owner_t *)pbuff->pdata, str);
}
示例#5
0
int display_9p_owner_key(struct gsh_buffdesc *buff, char *str)
{
    return display_9p_owner(buff->addr, str);
}