xfs
[Top] [All Lists]

Re: dmapi user event confusion

To: Ben Myers <dative@xxxxxxxxxxx>
Subject: Re: dmapi user event confusion
From: Dean Roehrich <roehrich@xxxxxxx>
Date: Mon, 14 Jun 2004 09:38:29 -0500
Cc: linux-xfs@xxxxxxxxxxx
Sender: linux-xfs-bounce@xxxxxxxxxxx
The function dm_create_userevent creates an async event, and immediately
returns the token value.  You cannot use dm_get_events to retrieve this
one--it behaves as if dm_get_events has already been used.  You do need to use
the returned token to call dm_respond_event.

The function dm_send_msg creates synchronous or asynchronous events, and this
event can be retrieved with dm_get_events.  In both cases these events can be
retrieved with dm_get_events.

See:
  http://www.opengroup.org/onlinepubs/9657099/chap3.htm#tagcjh_04_06
  http://www.opengroup.org/onlinepubs/9657099/chap5.htm#tagcjh_06_09
  http://www.opengroup.org/onlinepubs/9657099/chap5.htm#tagcjh_06_49


Dean




>From:  Ben Myers <dative@xxxxxxxxxxx>
>Hi folks, 
>
>I hope this is the right place to ask why i can't seem to get
>DM_USER_EVENT messages via calls to dm_get_events.  I've been struggling
>with it in my code for a few days so i decided to checkout the testsuite
>and try it. The testsuite i'm using was checked out yesterday, and the
>kernel is from (roughly) a month ago.
>
>Here's the order of things:
><reboot>
>
>I start up 'print_event' from the testsuite:
># ./print_event -R /home/dative/dmapp/mnt
>
>(in another shell) i unmount the filesystem i'm using for a test:
># umount /home/dative/dmapp/mnt
>
>here's the line from my fstab:
>/home/dative/dmapp/testfs.xfs   /home/dative/dmapp/mnt  xfs
>loop,quota,dmapi,mtpt=/home/dative/dmapp/mnt  0 0
>
>Then i remount it:
># mount /home/dative/dmapp/mnt
>
>...and try to send a message with 'create_userevent' (from the suite):
># ./create_userevent -s 1 "hello, world"
>New token 5
>#
>
>but the user event isn't printed out by 'print_event'. this is the total
>output:
>preunmount: token 1 sequence 1
>        fs handle       8baa21bc1029db24
>        root dir        8baa21bc1029db240e00000000000000804b000000000000
>        unmount mode    NOFORCE
>unmount: token 2 sequence 2
>        fs handle       8baa21bc1029db24
>        unmount mode    NOFORCE
>        retcode         0
>mount: token 3 sequence 3
>        fs handle       8baa21bc1029db24
>        mtpt handle     <BAD HANDLE, hlen 0>                *
>        mtpt path       /home/dative/dmapp/mnt
>        media desig     loop(7,0)
>        root handle     8baa21bc1029db240e00000000000000804b000000000000
>        mode            0
>
>* because i didn't mount that xfs fs with the dmapi options?
>
>in my application i am able to get the user event and corresponding
>message via dm_getall_tokens and then a dm_find_eventmsg, but not via
>dm_get_events.  my understanding (from the dmapi document) is that i
>should be able to get userevents via dm_get_events**. have i missed
>something?
>
>thanks and regards,
>-ben
>
>** i think that it may have been working about a week ago.  i had set an
>eventlist on a file and then was able to get userevents via
>dm_get_events, but am not sure.  i'll check on that.
>
>


<Prev in Thread] Current Thread [Next in Thread>