Exemplo n.º 1
0
int nlm4_Sm_Notify(nfs_arg_t *args, struct svc_req *req, nfs_res_t *res)
{
	nlm4_sm_notifyargs *arg = &args->arg_nlm4_sm_notify;
	state_status_t state_status = STATE_SUCCESS;
	state_nsm_client_t *nsm_client;

	LogDebug(COMPONENT_NLM,
		 "REQUEST PROCESSING: Calling nlm4_sm_notify for %s",
		 arg->name);

	nsm_client = get_nsm_client(CARE_NOT, NULL, arg->name);

	if (nsm_client != NULL) {
		/* Cast the state number into a state pointer to protect
		 * locks from a client that has rebooted from being released
		 * by this SM_NOTIFY.
		 */
		state_status = state_nlm_notify(nsm_client, true, arg->state);

		if (state_status != STATE_SUCCESS) {
			/** @todo FSF: Deal with error
			 */
		}

		dec_nsm_client_ref(nsm_client);
	}

	LogDebug(COMPONENT_NLM, "REQUEST RESULT: nlm4_sm_notify DONE");

	return NFS_REQ_OK;
}
Exemplo n.º 2
0
int nlm4_Sm_Notify(nfs_arg_t * parg /* IN     */ ,
                   exportlist_t * pexport /* IN     */ ,
                   fsal_op_context_t * pcontext /* IN     */ ,
                   cache_inode_client_t * pclient /* INOUT  */ ,
                   hash_table_t * ht /* INOUT  */ ,
                   struct svc_req *preq /* IN     */ ,
                   nfs_res_t * pres /* OUT    */ )
{
  nlm4_sm_notifyargs * arg = &parg->arg_nlm4_sm_notify;
  state_status_t       state_status = CACHE_INODE_SUCCESS;
  state_nsm_client_t * nsm_client;

  LogDebug(COMPONENT_NLM,
           "REQUEST PROCESSING: Calling nlm4_sm_notify for %s",
           arg->name);

  nsm_client = get_nsm_client(TRUE, NULL, arg->name);
  if(nsm_client != NULL)
    {
      /* Cast the state number into a state pointer to protect
       * locks from a client that has rebooted from being released
       * by this SM_NOTIFY.
       */
      if(state_nlm_notify(nsm_client,
                          (void *) (ptrdiff_t) arg->state,
                          pclient,
                          &state_status) != STATE_SUCCESS)
        {
          /* TODO FSF: Deal with error */
        }
    }

  dec_nsm_client_ref(nsm_client);

  LogDebug(COMPONENT_NLM,
           "REQUEST RESULT: nlm4_sm_notify DONE");

  return NFS_REQ_OK;
}
Exemplo n.º 3
0
int nlm4_Sm_Notify(nfs_arg_t *parg,
                   exportlist_t *pexport,
                   fsal_op_context_t *pcontext,
                   nfs_worker_data_t *pworker,
                   struct svc_req *preq,
                   nfs_res_t *pres)
{
    nlm4_sm_notifyargs * arg = &parg->arg_nlm4_sm_notify;
    state_status_t       state_status = STATE_SUCCESS;
    state_nsm_client_t * nsm_client;

    LogDebug(COMPONENT_NLM,
             "REQUEST PROCESSING: Calling nlm4_sm_notify for %s",
             arg->name);

    nsm_client = get_nsm_client(CARE_NOT, NULL, arg->name);
    if(nsm_client != NULL)
    {
        /* Cast the state number into a state pointer to protect
         * locks from a client that has rebooted from being released
         * by this SM_NOTIFY.
         */
        if(state_nlm_notify(nsm_client,
                            (void *) (ptrdiff_t) arg->state,
                            &state_status) != STATE_SUCCESS)
        {
            /* TODO FSF: Deal with error */
        }

        dec_nsm_client_ref(nsm_client);
    }

    LogDebug(COMPONENT_NLM,
             "REQUEST RESULT: nlm4_sm_notify DONE");

    return NFS_REQ_OK;
}