xfs
[Top] [All Lists]

Re: [DMAPI] code error in dm_ip_to_handle()

To: Aurelien Degremont - Stagiaire <degremont@xxxxxxxxxxx>
Subject: Re: [DMAPI] code error in dm_ip_to_handle()
From: Dean Roehrich <roehrich@xxxxxxx>
Date: Mon, 16 May 2005 08:38:04 -0500
Cc: linux-xfs@xxxxxxxxxxx
Sender: linux-xfs-bounce@xxxxxxxxxxx
>From:  Aurelien Degremont - Stagiaire <degremont@xxxxxxxxxxx>

>Ok, ok
>But, in inode_to_fh(), how know that we must return a fshandle (with the 
>dm_fid part filled with 0) or a filehandle (ino, len and gen filled) ?
>
>Could you explain the behaviour of inode_to_fh() ? (Especially the 
>differences related to fshandle/filehandle)

dm_ip_to_handle() and ->inode_to_fh() always return a filehandle.


>dm_handle_to_ip() is always called using a filehandle ? (never a fshandle ?)

It looks like this no longer behaves the same as the original Irix code.  On
Irix, if dm_handle_to_ip() is going to call VFS_ROOT then it doesn't overwrite
the handle that was passed to dm_handle_to_ip().  So, does it matter?

The Irix code in dm_handle_to_ip() looks like this:

        if (handlep->ha_fid.fid_len == 0) {     /* filesystem handle */
                VFS_ROOT(fsrp->fr_vfsp, &vp, error);
        } else {                                /* file object handle */
                VFS_VGET(fsrp->fr_vfsp, &vp, &handlep->ha_fid, error);
        }

Where the Linux code in dm_handle_to_ip() now looks like this:

        if (dmapiops->fh_to_inode)
                error = dmapiops->fh_to_inode(sb, &ip, (void*)fidp);

  ...which becomes this in xfs_dm_fh_to_inode:

        memcpy(&fid, dmfsfid, sizeof(*dmfsfid));
        if (fid.fid_len) {      /* file object handle */
                VFS_VGET(vfsp, &vp, &fid, error);
        }
        else {                  /* filesystem handle */
                VFS_ROOT(vfsp, &vp, error);
        }

On linux we never replace the handle that was passed to dm_handle_to_ip(); we
just verify that it's valid and that it's the expected type.

Dean


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