Пример #1
0
/**
 * nlm_Test_Free: Frees the result structure allocated for nlm4_Test
 *
 * Frees the result structure allocated for nlm_Null. Does Nothing in fact.
 *
 * @param pres        [INOUT]   Pointer to the result structure.
 *
 */
void nlm4_Test_Free(nfs_res_t * pres)
{
  netobj_free(&pres->res_nlm4test.cookie);
  if(pres->res_nlm4test.test_stat.stat == NLM4_DENIED)
    netobj_free(&pres->res_nlm4test.test_stat.nlm4_testrply_u.holder.oh);
  return;
}
Пример #2
0
void free_grant_arg(nlm_async_queue_t *arg)
{
  netobj_free(&arg->nlm_async_args.nlm_async_grant.cookie);
  netobj_free(&arg->nlm_async_args.nlm_async_grant.alock.oh);
  netobj_free(&arg->nlm_async_args.nlm_async_grant.alock.fh);
  if(arg->nlm_async_args.nlm_async_grant.alock.caller_name != NULL)
    Mem_Free(arg->nlm_async_args.nlm_async_grant.alock.caller_name);
  Mem_Free(arg);
}
Пример #3
0
int nlm_send_async_res_nlm4test(state_nlm_client_t * host,
                                state_async_func     func,
                                nfs_res_t          * pres)
{
  state_async_queue_t    * arg = (state_async_queue_t *) Mem_Alloc(sizeof(*arg));
  state_nlm_async_data_t * nlm_arg;
  state_status_t           status;

  if(arg != NULL)
    {
      nlm_arg = &arg->state_async_data.state_nlm_async_data;
      memset(arg, 0, sizeof(*arg));
      arg->state_async_func               = func;
      nlm_arg->nlm_async_host               = host;
      nlm_arg->nlm_async_args.nlm_async_res = *pres;
      if(!copy_netobj(&nlm_arg->nlm_async_args.nlm_async_res.res_nlm4test.cookie,
                      &pres->res_nlm4test.cookie))
        {
          LogFullDebug(COMPONENT_NLM,
                       "Unable to copy async response file handle");
          Mem_Free(arg);
          return NFS_REQ_DROP;
        }
      else if(pres->res_nlm4test.test_stat.stat == NLM4_DENIED)
        {
          if(!copy_netobj(&nlm_arg->nlm_async_args.nlm_async_res.res_nlm4test.test_stat.nlm4_testrply_u.holder.oh,
                          &pres->res_nlm4test.test_stat.nlm4_testrply_u.holder.oh))
            {
              LogFullDebug(COMPONENT_NLM,
                           "Unable to copy async response oh");
              netobj_free(&nlm_arg->nlm_async_args.nlm_async_res.res_nlm4test.cookie);
              Mem_Free(arg);
              return NFS_REQ_DROP;
            }
        }
   }
 else
   {
      LogFullDebug(COMPONENT_NLM,
                   "Unable to allocate async response");
      return NFS_REQ_DROP;
   }


  status = state_async_schedule(arg);

  if(status != STATE_SUCCESS)
    {
      netobj_free(&nlm_arg->nlm_async_args.nlm_async_res.res_nlm4test.cookie);
      if(pres->res_nlm4test.test_stat.stat == NLM4_DENIED)
        netobj_free(&nlm_arg->nlm_async_args.nlm_async_res.res_nlm4test.test_stat.nlm4_testrply_u.holder.oh);
      Mem_Free(arg);
      return NFS_REQ_DROP;
    }

  return NFS_REQ_OK;
}
Пример #4
0
void free_grant_arg(state_async_queue_t *arg)
{
  state_nlm_async_data_t * nlm_arg = &arg->state_async_data.state_nlm_async_data;
  netobj_free(&nlm_arg->nlm_async_args.nlm_async_grant.cookie);
  netobj_free(&nlm_arg->nlm_async_args.nlm_async_grant.alock.oh);
  netobj_free(&nlm_arg->nlm_async_args.nlm_async_grant.alock.fh);
  if(nlm_arg->nlm_async_args.nlm_async_grant.alock.caller_name != NULL)
    gsh_free(nlm_arg->nlm_async_args.nlm_async_grant.alock.caller_name);
  gsh_free(arg);
}
Пример #5
0
/**
 * nlm4_Unlock_Free: Frees the result structure allocated for nlm4_Unlock
 *
 * Frees the result structure allocated for nlm4_Lock. Does Nothing in fact.
 *
 * @param pres        [INOUT]   Pointer to the result structure.
 *
 */
void nlm4_Unlock_Free(nfs_res_t * pres)
{
  netobj_free(&pres->res_nlm4test.cookie);
  return;
}
Пример #6
0
/**
 * nlm4_Share_Free: Frees the result structure allocated for nlm4_Lock
 *
 * Frees the result structure allocated for nlm4_Lock. Does Nothing in fact.
 *
 * @param pres        [INOUT]   Pointer to the result structure.
 *
 */
void nlm4_Share_Free(nfs_res_t * pres)
{
  netobj_free(&pres->res_nlm4share.cookie);
  return;
}
Пример #7
0
/**
 * nlm4_Unlock_Free: Frees the result structure allocated for nlm4_Unlock
 *
 * Frees the result structure allocated for nlm4_Lock. Does Nothing in fact.
 *
 * @param res        [INOUT]   Pointer to the result structure.
 *
 */
void nlm4_Unlock_Free(nfs_res_t *res)
{
	netobj_free(&res->res_nlm4test.cookie);
}
Пример #8
0
/**
 * nlm4_Unshare_Free: Frees the result structure allocated for nlm4_Lock
 *
 * Frees the result structure allocated for nlm4_Lock. Does Nothing in fact.
 *
 * @param res        [INOUT]   Pointer to the result structure.
 *
 */
void nlm4_Unshare_Free(nfs_res_t *res)
{
	netobj_free(&res->res_nlm4share.cookie);
}