xfs
[Top] [All Lists]

Re: vfs_altfsid & dm_fsid

To: Aurelien Degremont - Stagiaire <degremont@xxxxxxxxxxx>
Subject: Re: vfs_altfsid & dm_fsid
From: Dean Roehrich <roehrich@xxxxxxx>
Date: Thu, 12 May 2005 11:21:15 -0500
Cc: linux-xfs@xxxxxxxxxxx
Sender: linux-xfs-bounce@xxxxxxxxxxx
>From:  Aurelien Degremont - Stagiaire <degremont@xxxxxxxxxxx>
>Dean Roehrich a écrit:
>> If your filesystem of choice doesn't have an fsid, then you could just
>> generate one that is valid while the filesystem is mounted and is not writte
>n
>> to the filesystem, or you could come up with something else.  Whatever you
>> choose for an fsid should fit into a 64-bit type.
>
>
>> 1)   The fsid should be a parameter to dm_send_mount_event() and
>>      dm_send_namesp_event() and dm_send_unmount_event().
>>      The get_fsid op in struct filesystem_dmapi_operations should be
>>      dropped.
>
>Ok, so we need to modify :
>  xfs_dm_mount()
>  xfs_dm_send_namesp_event()
>  xfs_dm_send_unmount_event()
>
>The fsid could be taken in vfsp.

My last attempt to send this as an attachment didn't work...
so you'll have to take it this way.

This is lightly tested.

Dean


Index: lbs-a/linux/linux/fs/xfs/xfs_dmapi.c
===================================================================
--- lbs-a.orig/linux/linux/fs/xfs/xfs_dmapi.c   2005-05-11 19:39:34.000000000 
-0700
+++ lbs-a/linux/linux/fs/xfs/xfs_dmapi.c        2005-05-11 20:06:21.000000000 
-0700
@@ -209,7 +209,8 @@ xfs_dm_send_data_event(
 #endif
 
                error = dm_send_data_event(event, inode, DM_RIGHT_NULL,
-                               offset, length, flags);
+                               offset, length, flags,
+                               (dm_fsid_t*)vp->v_vfsp->vfs_altfsid);
                error = -error; /* DMAPI returns negative errors */
 
                if (flags & DM_FLAGS_ISEM)
@@ -3124,7 +3125,8 @@ xfs_dm_send_destroy_event(
 
        /* Returns positive errors to XFS */
 
-       error = dm_send_destroy_event(LINVFS_GET_IP(vp), vp_right);
+       error = dm_send_destroy_event(LINVFS_GET_IP(vp), vp_right,
+                                     (dm_fsid_t*)vp->v_vfsp->vfs_altfsid);
        error = -error; /* DMAPI returns negative errors */
 
        return error; /* Return positive error to XFS */
@@ -3153,7 +3155,8 @@ xfs_dm_send_namesp_event(
                                    LINVFS_GET_IP(vp1), vp1_right,
                                    vp2 ? LINVFS_GET_IP(vp2) : NULL, vp2_right,
                                    name1, name2,
-                                   mode, retcode, flags);
+                                   mode, retcode, flags,
+                                   (dm_fsid_t*)vp1->v_vfsp->vfs_altfsid);
        error = -error; /* DMAPI returns negative errors */
 
        return error; /* Return positive error to XFS */
@@ -3170,7 +3173,8 @@ xfs_dm_send_unmount_event(
        int             flags)
 {
        dm_send_unmount_event(vfsp->vfs_super, vp ? LINVFS_GET_IP(vp) : NULL,
-                             vfsp_right, mode, retcode, flags);
+                             vfsp_right, mode, retcode, flags,
+                             (dm_fsid_t*)vfsp->vfs_altfsid);
 }
 
 
@@ -3244,16 +3248,6 @@ xfs_dm_get_dmapiops(
        return -error; /* Return negative error to DMAPI */
 }
 
-static void
-xfs_dm_get_fsid(
-       struct super_block      *sb,
-       dm_fsid_t               *fsid)
-{
-       vfs_t   *vfsp = LINVFS_GET_VFS(sb);
-       memcpy(fsid, vfsp->vfs_altfsid, sizeof(*fsid));
-}
-
-
 /*
  * Filesystem operations accessed by the DMAPI core.
  */
@@ -3262,7 +3256,6 @@ struct filesystem_dmapi_operations xfs_d
        .fh_to_inode            = xfs_dm_fh_to_inode,
        .get_invis_ops          = xfs_dm_get_invis_ops,
        .inode_to_fh            = xfs_dm_inode_to_fh,
-       .get_fsid               = xfs_dm_get_fsid,
 };
 
 /*
@@ -3312,7 +3305,8 @@ xfs_dm_mount(
                                        DM_RIGHT_NULL, NULL,
                                        DM_RIGHT_NULL, LINVFS_GET_IP(rootvp),
                                        DM_RIGHT_NULL,
-                                       args->mtpt, args->fsname);
+                                       args->mtpt, args->fsname,
+                                       (dm_fsid_t*)vfsp->vfs_altfsid);
                            error = -error; /* DMAPI returns negative errs */
                        }
                }
Index: lbs-a/linux/linux/fs/dmapi/dmapi_session.c
===================================================================
--- lbs-a.orig/linux/linux/fs/dmapi/dmapi_session.c     2005-05-11 
19:39:18.000000000 -0700
+++ lbs-a/linux/linux/fs/dmapi/dmapi_session.c  2005-05-11 19:39:51.000000000 
-0700
@@ -1395,7 +1395,7 @@ dm_enqueue(
 
 int
 dm_enqueue_normal_event(
-       struct super_block *sb,
+       dm_fsid_t       *fsid,
        dm_tokevent_t   *tevp,
        int             flags)
 {
@@ -1440,7 +1440,7 @@ dm_enqueue_normal_event(
           is locked upon return from dm_waitfor_disp_session().
        */
 
-       if ((error = dm_waitfor_disp_session(sb, tevp, &s, &lc)) != 0)
+       if ((error = dm_waitfor_disp_session(fsid, tevp, &s, &lc)) != 0)
                return(error);
 
        return(dm_enqueue(s, lc, tevp, sync, flags, 0));
@@ -1466,7 +1466,8 @@ dm_enqueue_normal_event(
 int
 dm_enqueue_mount_event(
        struct super_block *sb,
-       dm_tokevent_t   *tevp)
+       dm_tokevent_t   *tevp,
+       dm_fsid_t       *fsid)
 {
        dm_session_t    *s;
        dm_sessid_t     sid;
@@ -1475,7 +1476,7 @@ dm_enqueue_mount_event(
 
        /* Make the mounting filesystem visible to other DMAPI calls. */
 
-       if ((error = dm_add_fsys_entry(sb, tevp)) != 0){
+       if ((error = dm_add_fsys_entry(sb, tevp, fsid)) != 0){
                return(error);
        }
 
@@ -1506,10 +1507,10 @@ dm_enqueue_mount_event(
        */
 
        if (error >= 0) {
-               dm_change_fsys_entry(sb, DM_STATE_MOUNTED);
+               dm_change_fsys_entry(fsid, DM_STATE_MOUNTED);
                error = 0;
        } else {
-               dm_remove_fsys_entry(sb);
+               dm_remove_fsys_entry(fsid);
        }
        return(error);
 }
@@ -1657,7 +1658,7 @@ dm_flush_events(
  */
 int
 dm_release_threads(
-       struct super_block      *sb,
+       dm_fsid_t               *fsid,
        struct inode            *inode, /* may be null */
        int                     errno)
 {
@@ -1668,14 +1669,8 @@ dm_release_threads(
        dm_sessid_t     *sidlist;
        int             i;
        int             found_events = 0;
-       dm_fsid_t       fsid;
-       struct filesystem_dmapi_operations *dops;
 
-       ASSERT(sb);
-       dops = dm_fsys_ops_by_fstype(sb->s_type);
-       ASSERT(dops);
-       dops->get_fsid(sb, &fsid);
-       dm_release_disp_threads(&fsid, inode, errno);
+       dm_release_disp_threads(fsid, inode, errno);
 
        /* Loop until we can get the right amount of temp space, being careful
           not to hold a mutex during the allocation.  Usually only one trip.
@@ -1708,14 +1703,14 @@ dm_release_threads(
        for (i = 0; i < sesscnt; i++) {
                sid = sidlist[i];
                if( dm_find_session_and_lock( sid, &s, &lc ) == 0 ){
-                       found_events = dm_flush_events( s, &fsid, inode,
+                       found_events = dm_flush_events( s, fsid, inode,
                                                        &s->sn_evt_writerq, 1,
                                                        errno );
                        if (found_events)
                                sv_broadcast(&s->sn_writerq);
 
-                       dm_flush_events(s, &fsid, inode, &s->sn_newq, 0, errno);
-                       dm_flush_events(s, &fsid, inode, &s->sn_delq, 0, errno);
+                       dm_flush_events(s, fsid, inode, &s->sn_newq, 0, errno);
+                       dm_flush_events(s, fsid, inode, &s->sn_delq, 0, errno);
 
                        mutex_spinunlock( &s->sn_qlock, lc );
                }
Index: lbs-a/linux/linux/fs/dmapi/dmapi_private.h
===================================================================
--- lbs-a.orig/linux/linux/fs/dmapi/dmapi_private.h     2005-05-11 
19:39:18.000000000 -0700
+++ lbs-a/linux/linux/fs/dmapi/dmapi_private.h  2005-05-11 19:39:51.000000000 
-0700
@@ -344,13 +344,14 @@ void              dm_evt_rele_tevp(
                        int             droprights);
 
 int            dm_enqueue_normal_event(
-                       struct super_block *sbp,
+                       dm_fsid_t       *fsid,
                        dm_tokevent_t   *tevp,
                        int             flags);
 
 int            dm_enqueue_mount_event(
                        struct super_block *sbp,
-                       dm_tokevent_t   *tevp);
+                       dm_tokevent_t   *tevp,
+                       dm_fsid_t       *fsid);
 
 int            dm_enqueue_sendmsg_event(
                        dm_sessid_t     targetsid,
@@ -439,7 +440,7 @@ int         dm_get_allocinfo_rvp(
                        int             *rvp);
 
 int            dm_waitfor_destroy_attrname(
-                       struct super_block      *sb,
+                       dm_fsid_t       *fsid,
                        dm_attrname_t   *attrnamep);
 
 void           dm_clear_fsreg(
@@ -447,14 +448,15 @@ void              dm_clear_fsreg(
 
 int            dm_add_fsys_entry(
                        struct super_block      *sb,
-                       dm_tokevent_t   *tevp);
+                       dm_tokevent_t   *tevp,
+                       dm_fsid_t       *fsid);
 
 void           dm_change_fsys_entry(
-                       struct super_block      *sb,
+                       dm_fsid_t       *fsid,
                        dm_fsstate_t    newstate);
 
 void           dm_remove_fsys_entry(
-                       struct super_block      *sb);
+                       dm_fsid_t       *fsid);
 
 dm_fsys_vector_t *dm_fsys_vector(
                        struct inode    *ip);
@@ -465,7 +467,7 @@ struct filesystem_dmapi_operations *dm_f
 void           dm_fsys_vector_free(void);
 
 int            dm_waitfor_disp_session(
-                       struct super_block      *sb,
+                       dm_fsid_t       *fsid,
                        dm_tokevent_t   *tevp,
                        dm_session_t    **sessionpp,
                        unsigned long   *lcp);
Index: lbs-a/linux/linux/fs/dmapi/dmapi_register.c
===================================================================
--- lbs-a.orig/linux/linux/fs/dmapi/dmapi_register.c    2005-05-11 
19:39:18.000000000 -0700
+++ lbs-a/linux/linux/fs/dmapi/dmapi_register.c 2005-05-11 19:39:51.000000000 
-0700
@@ -201,18 +201,13 @@ dm_find_fsreg_and_lock(
 int
 dm_add_fsys_entry(
        struct super_block *sb,
-       dm_tokevent_t   *tevp)
+       dm_tokevent_t   *tevp,
+       dm_fsid_t       *fsid)
 {
        dm_fsreg_t      *fsrp;
        int             msgsize;
        void            *msg;
        unsigned long   lc;                     /* lock cookie */
-       dm_fsid_t       fsid;
-       struct filesystem_dmapi_operations *dops;
-
-       dops = dm_fsys_ops_by_fstype(sb->s_type);
-       ASSERT(dops);
-       dops->get_fsid(sb, &fsid);
 
        /* Allocate and initialize a dm_fsreg_t structure for the filesystem. */
 
@@ -234,7 +229,7 @@ dm_add_fsys_entry(
 
        fsrp->fr_sb = sb;
        fsrp->fr_tevp = tevp;
-       memcpy(&fsrp->fr_fsid, &fsid, sizeof(fsid));
+       memcpy(&fsrp->fr_fsid, fsid, sizeof(*fsid));
        fsrp->fr_msg = msg;
        fsrp->fr_msgsize = msgsize;
        fsrp->fr_state = DM_STATE_MOUNTING;
@@ -248,7 +243,7 @@ dm_add_fsys_entry(
 
        lc = mutex_spinlock(&dm_reg_lock);
 
-       if (!dm_find_fsreg(&fsid)) {
+       if (!dm_find_fsreg(fsid)) {
                fsrp->fr_next = dm_registers;
                dm_registers = fsrp;
                dm_fsys_cnt++;
@@ -292,26 +287,16 @@ dm_add_fsys_entry(
 
 void
 dm_change_fsys_entry(
-       struct super_block *sb,
+       dm_fsid_t       *fsid,
        dm_fsstate_t    newstate)
 {
        dm_fsreg_t      *fsrp;
        int             seq_error;
        unsigned long   lc;                     /* lock cookie */
-       dm_fsid_t       fsid;
-       struct filesystem_dmapi_operations *dops;
 
-       /* Find the filesystem referenced by the sb's fsid_t.    This should
-          always succeed.
-       */
-
-       dops = dm_fsys_ops_by_fstype(sb->s_type);
-       ASSERT(dops);
-       dops->get_fsid(sb, &fsid);
-
-       if ((fsrp = dm_find_fsreg_and_lock(&fsid, &lc)) == NULL) {
+       if ((fsrp = dm_find_fsreg_and_lock(fsid, &lc)) == NULL) {
                panic("dm_change_fsys_entry: can't find DMAPI fsrp for "
-                       "sb %p\n", sb);
+                       "fsid 0x%llx\n", (unsigned long long)*fsid);
        }
 
        /* Make sure that the new state is acceptable given the current state
@@ -390,17 +375,11 @@ dm_change_fsys_entry(
 
 void
 dm_remove_fsys_entry(
-       struct super_block *sb)
+       dm_fsid_t       *fsid)
 {
        dm_fsreg_t      **fsrpp;
        dm_fsreg_t      *fsrp;
        unsigned long   lc;                     /* lock cookie */
-       struct filesystem_dmapi_operations *dops;
-       dm_fsid_t       fsid;
-
-       dops = dm_fsys_ops_by_fstype(sb->s_type);
-       ASSERT(dops);
-       dops->get_fsid(sb, &fsid);
 
        /* Find the filesystem referenced by the sb's fsid_t and dequeue
           it after verifying that the fr_state shows a filesystem that is
@@ -411,14 +390,14 @@ dm_remove_fsys_entry(
 
        fsrpp = &dm_registers;
        while ((fsrp = *fsrpp) != NULL) {
-               if (!memcmp(&fsrp->fr_fsid, &fsid, sizeof(fsrp->fr_fsid)))
+               if (!memcmp(&fsrp->fr_fsid, fsid, sizeof(fsrp->fr_fsid)))
                        break;
                fsrpp = &fsrp->fr_next;
        }
        if (fsrp == NULL) {
                mutex_spinunlock(&dm_reg_lock, lc);
                panic("dm_remove_fsys_entry: can't find DMAPI fsrp for "
-                       "sb %p\n", sb);
+                       "fsid 0x%llx\n", (unsigned long long)fsid);
        }
 
        nested_spinlock(&fsrp->fr_lock);
@@ -673,7 +652,7 @@ dm_find_mount_tevp_and_lock(
 
 static int
 dm_waitfor_disp(
-       struct super_block *sb,
+       dm_fsid_t       *fsid,
        dm_tokevent_t   *tevp,
        dm_fsreg_t      **fsrpp,
        unsigned long   *lc1p,          /* addr of first returned lock cookie */
@@ -683,14 +662,8 @@ dm_waitfor_disp(
        dm_eventtype_t  event = tevp->te_msg.ev_type;
        dm_session_t    *s;
        dm_fsreg_t      *fsrp;
-       dm_fsid_t       fsid;
-       struct filesystem_dmapi_operations *dops;
-
-       dops = dm_fsys_ops_by_fstype(sb->s_type);
-       ASSERT(dops);
 
-       dops->get_fsid(sb, &fsid);
-       if ((fsrp = dm_find_fsreg_and_lock(&fsid, lc1p)) == NULL)
+       if ((fsrp = dm_find_fsreg_and_lock(fsid, lc1p)) == NULL)
                return -ENOENT;
 
        /* If no session is registered for this event in the specified
@@ -760,7 +733,7 @@ dm_waitfor_disp(
 
 int
 dm_waitfor_disp_session(
-       struct super_block *sb,
+       dm_fsid_t       *fsid,
        dm_tokevent_t   *tevp,
        dm_session_t    **sessionpp,
        unsigned long   *lcp)
@@ -772,7 +745,7 @@ dm_waitfor_disp_session(
        if (tevp->te_msg.ev_type < 0 || tevp->te_msg.ev_type > DM_EVENT_MAX)
                return(-EIO);
 
-       error = dm_waitfor_disp(sb, tevp, &fsrp, lcp, sessionpp, &lc2);
+       error = dm_waitfor_disp(fsid, tevp, &fsrp, lcp, sessionpp, &lc2);
        if (!error)
                mutex_spinunlock(&fsrp->fr_lock, lc2);  /* rev. cookie order*/
        return(error);
@@ -787,7 +760,7 @@ dm_waitfor_disp_session(
 
 int
 dm_waitfor_destroy_attrname(
-       struct super_block *sbp,
+       dm_fsid_t       *fsid,
        dm_attrname_t   *attrnamep)
 {
        dm_tokevent_t   *tevp;
@@ -799,7 +772,7 @@ dm_waitfor_destroy_attrname(
        void            *msgp;
 
        tevp = dm_evt_create_tevp(DM_EVENT_DESTROY, 1, (void**)&msgp);
-       error = dm_waitfor_disp(sbp, tevp, &fsrp, &lc1, &s, &lc2);
+       error = dm_waitfor_disp(fsid, tevp, &fsrp, &lc1, &s, &lc2);
        if (!error) {
                *attrnamep = fsrp->fr_rattr;            /* attribute or zeros */
                mutex_spinunlock(&s->sn_qlock, lc2);    /* rev. cookie order */
Index: lbs-a/linux/linux/fs/dmapi/dmapi_kern.h
===================================================================
--- lbs-a.orig/linux/linux/fs/dmapi/dmapi_kern.h        2005-05-11 
19:39:18.000000000 -0700
+++ lbs-a/linux/linux/fs/dmapi/dmapi_kern.h     2005-05-11 20:06:46.000000000 
-0700
@@ -82,7 +82,6 @@ struct filesystem_dmapi_operations {
        struct file_operations * (*get_invis_ops)(struct inode *ip);
        int (*inode_to_fh)(struct inode *ip, struct dm_fsfid *fid,
                           dm_fsid_t *fsid );
-       void (*get_fsid)(struct super_block *sb, dm_fsid_t *fsid);
 #define HAVE_DM_QUEUE_FLUSH
        int (*flushing)(struct inode *ip);
 };
@@ -96,11 +95,13 @@ int         dm_send_data_event(
                        dm_right_t      vp_right,
                        dm_off_t        off,
                        size_t          len,
-                       int             flags);
+                       int             flags,
+                       dm_fsid_t       *fsid);
 
 int            dm_send_destroy_event(
                        struct inode    *ip,
-                       dm_right_t      vp_right);
+                       dm_right_t      vp_right,
+                       dm_fsid_t       *fsid);
 
 int            dm_send_mount_event(
                        struct super_block      *sb,
@@ -110,7 +111,8 @@ int         dm_send_mount_event(
                        struct inode    *rootip,
                        dm_right_t      rootvp_right,
                        char            *name1,
-                       char            *name2);
+                       char            *name2,
+                       dm_fsid_t       *fsid);
 
 int            dm_send_namesp_event(
                        dm_eventtype_t  event,
@@ -123,7 +125,8 @@ int         dm_send_namesp_event(
                        char            *name2,
                        mode_t          mode,
                        int             retcode,
-                       int             flags);
+                       int             flags,
+                       dm_fsid_t       *fsid);
 
 void           dm_send_unmount_event(
                        struct super_block *sbp,
@@ -131,7 +134,8 @@ void                dm_send_unmount_event(
                        dm_right_t      sbp_right,
                        mode_t          mode,
                        int             retcode,
-                       int             flags);
+                       int             flags,
+                       dm_fsid_t       *fsid);
 
 int            dm_code_level(void);
 
@@ -141,7 +145,7 @@ int         dm_ip_to_handle (
 
 #define HAVE_DM_RELEASE_THREADS_ERRNO
 int            dm_release_threads(
-                       struct super_block      *sb,
+                       dm_fsid_t               *fsid,
                        struct inode            *inode,
                        int                     errno);
 
Index: lbs-a/linux/linux/fs/dmapi/dmapi_event.c
===================================================================
--- lbs-a.orig/linux/linux/fs/dmapi/dmapi_event.c       2005-05-11 
19:39:18.000000000 -0700
+++ lbs-a/linux/linux/fs/dmapi/dmapi_event.c    2005-05-11 19:39:51.000000000 
-0700
@@ -196,15 +196,10 @@ static dm_tokdata_t *
 dm_sb_data(
        struct super_block *sb,
        struct inode    *ip,            /* will be NULL for DM_EVENT_UNMOUNT */
-       dm_right_t      right)
+       dm_right_t      right,
+       dm_fsid_t       *fsid)
 {
        dm_tokdata_t    *tdp;
-       struct filesystem_dmapi_operations *dops;
-       dm_fsid_t       fsid;
-
-       dops = dm_fsys_ops_by_fstype(sb->s_type);
-       ASSERT(dops);
-       dops->get_fsid(sb, &fsid);
 
        tdp = kmem_cache_alloc(dm_tokdata_cachep, SLAB_KERNEL);
        if (tdp == NULL) {
@@ -225,9 +220,9 @@ dm_sb_data(
        tdp->td_ip = ip;
        tdp->td_vcount = 0;
 
-       memcpy(&tdp->td_handle.ha_fsid, &fsid, sizeof(fsid));
-       memset((char *)&tdp->td_handle.ha_fsid + sizeof(fsid), 0,
-               sizeof(tdp->td_handle) - sizeof(fsid));
+       memcpy(&tdp->td_handle.ha_fsid, fsid, sizeof(*fsid));
+       memset((char *)&tdp->td_handle.ha_fsid + sizeof(*fsid), 0,
+               sizeof(tdp->td_handle) - sizeof(*fsid));
 
        return(tdp);
 }
@@ -258,7 +253,8 @@ dm_send_data_event(
        dm_right_t      vp_right,       /* current right for ip */
        dm_off_t        offset,
        size_t          length,
-       int             flags)          /* 0 or DM_FLAGS_NDELAY */
+       int             flags,          /* 0 or DM_FLAGS_NDELAY */
+       dm_fsid_t       *fsid)
 {
        dm_data_event_t *datap;
        dm_tokevent_t   *tevp;
@@ -291,7 +287,7 @@ dm_send_data_event(
 
        /* Queue the message and wait for the reply. */
 
-       error = dm_enqueue_normal_event(ip->i_sb, tevp, flags);
+       error = dm_enqueue_normal_event(fsid, tevp, flags);
 
        /* If no errors occurred, we must leave with the same rights we had
           upon entry.  If errors occurred, we must leave with no rights.
@@ -314,7 +310,8 @@ dm_send_data_event(
 int
 dm_send_destroy_event(
        struct inode    *ip,
-       dm_right_t      vp_right)       /* always DM_RIGHT_NULL */
+       dm_right_t      vp_right,       /* always DM_RIGHT_NULL */
+       dm_fsid_t       *fsid)
 {
        dm_fsys_vector_t *fsys_vector;
        dm_tokevent_t   *tevp;
@@ -329,7 +326,7 @@ dm_send_destroy_event(
        if (tdp == NULL)
                return -ENOMEM;
 
-       if ((error = dm_waitfor_destroy_attrname(ip->i_sb, &attrname)) != 0)
+       if ((error = dm_waitfor_destroy_attrname(fsid, &attrname)) != 0)
                return(error);
 
        /* If a return-on-destroy attribute name exists for this filesystem,
@@ -384,7 +381,7 @@ dm_send_destroy_event(
 
        /* Queue the message asynchronously. */
 
-       error = dm_enqueue_normal_event(ip->i_sb, tevp, 0);
+       error = dm_enqueue_normal_event(fsid, tevp, 0);
 
        /* Since we had no rights upon entry, we have none to reobtain before
           leaving.
@@ -410,7 +407,8 @@ dm_send_mount_event(
        struct inode    *rootip,
        dm_right_t      rootvp_right,
        char            *name1,         /* mount path */
-       char            *name2)         /* filesystem device name */
+       char            *name2,         /* filesystem device name */
+       dm_fsid_t       *fsid)
 {
        int             error;
        dm_tokevent_t   *tevp = NULL;
@@ -425,7 +423,7 @@ dm_send_mount_event(
           if it is a different filesystem type which does not support DMAPI.
        */
 
-       tdp1 = dm_sb_data(sb, rootip, vfsp_right);
+       tdp1 = dm_sb_data(sb, rootip, vfsp_right, fsid);
        if (tdp1 == NULL)
                goto out_nomem;
 
@@ -492,7 +490,7 @@ dm_send_mount_event(
 
        /* Queue the message and wait for the reply. */
 
-       error = dm_enqueue_mount_event(sb, tevp);
+       error = dm_enqueue_mount_event(sb, tevp, fsid);
 
        /* If no errors occurred, we must leave with the same rights we had
           upon entry.  If errors occurred, we must leave with no rights.
@@ -540,7 +538,8 @@ dm_send_unmount_event(
        dm_right_t      vfsp_right,
        mode_t          mode,
        int             retcode,        /* errno, if unmount failed */
-       int             flags)
+       int             flags,
+       dm_fsid_t       *fsid)
 {
        dm_namesp_event_t       *np;
        dm_tokevent_t   *tevp;
@@ -553,9 +552,9 @@ dm_send_unmount_event(
        */
 
        if (retcode != 0) {     /* unmount was unsuccessful */
-               dm_change_fsys_entry(sb, DM_STATE_MOUNTED);
+               dm_change_fsys_entry(fsid, DM_STATE_MOUNTED);
        } else {
-               dm_change_fsys_entry(sb, DM_STATE_UNMOUNTED);
+               dm_change_fsys_entry(fsid, DM_STATE_UNMOUNTED);
        }
 
        /* If the event wasn't in the filesystem dm_eventset_t, just remove
@@ -564,7 +563,7 @@ dm_send_unmount_event(
 
        if (flags & DM_FLAGS_UNWANTED) {
                if (retcode == 0)
-                       dm_remove_fsys_entry(sb);
+                       dm_remove_fsys_entry(fsid);
                return;
        }
 
@@ -572,7 +571,7 @@ dm_send_unmount_event(
           for it.
        */
 
-       tdp1 = dm_sb_data(sb, ip, vfsp_right);
+       tdp1 = dm_sb_data(sb, ip, vfsp_right, fsid);
        if (tdp1 == NULL)
                return;
 
@@ -598,10 +597,10 @@ dm_send_unmount_event(
           message and ignore any error return for DM_EVENT_UNMOUNT.
        */
 
-       (void)dm_enqueue_normal_event(sb, tevp, flags);
+       (void)dm_enqueue_normal_event(fsid, tevp, flags);
 
        if (retcode == 0)
-               dm_remove_fsys_entry(sb);
+               dm_remove_fsys_entry(fsid);
 
        dm_evt_rele_tevp(tevp, 0);
 }
@@ -626,7 +625,8 @@ dm_send_namesp_event(
        char            *name2,
        mode_t          mode,
        int             retcode,
-       int             flags)
+       int             flags,
+       dm_fsid_t       *fsid)
 {
        dm_namesp_event_t       *np;
        dm_tokevent_t   *tevp;
@@ -651,7 +651,7 @@ dm_send_namesp_event(
                 */
 
                if (flags & DM_FLAGS_UNWANTED) {
-                       dm_change_fsys_entry(sb, DM_STATE_UNMOUNTING);
+                       dm_change_fsys_entry(fsid, DM_STATE_UNMOUNTING);
                        return(0);
                }
                if (ip1 == NULL) {
@@ -661,7 +661,7 @@ dm_send_namesp_event(
                         */
                        return(0);
                }
-               tdp1 = dm_sb_data(sb, ip1, vp1_right);
+               tdp1 = dm_sb_data(sb, ip1, vp1_right, fsid);
                if (tdp1 == NULL)
                        return -ENOMEM;
                tdp2 = dm_ip_data(ip2, vp2_right, /* reference held */ 1);
@@ -674,7 +674,7 @@ dm_send_namesp_event(
        case DM_EVENT_NOSPACE:
                /* vp1_right is the filesystem right. */
 
-               tdp1 = dm_sb_data(sb, ip1, vp1_right);
+               tdp1 = dm_sb_data(sb, ip1, vp1_right, fsid);
                if (tdp1 == NULL)
                        return -ENOMEM;
                tdp2 = dm_ip_data(ip2, vp2_right, /* reference held */ 1); /* 
additional info - not in the spec */
@@ -753,7 +753,7 @@ dm_send_namesp_event(
 
        /* Queue the message and wait for the reply. */
 
-       error = dm_enqueue_normal_event(sb, tevp, flags);
+       error = dm_enqueue_normal_event(fsid, tevp, flags);
 
        /* If no errors occurred, we must leave with the same rights we had
           upon entry.  If errors occurred, we must leave with no rights.
@@ -762,7 +762,7 @@ dm_send_namesp_event(
        dm_evt_rele_tevp(tevp, error);
 
        if (!error && event == DM_EVENT_PREUNMOUNT) {
-               dm_change_fsys_entry(sb, DM_STATE_UNMOUNTING);
+               dm_change_fsys_entry(fsid, DM_STATE_UNMOUNTING);
        }
 
        return(error);


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