xfs
[Top] [All Lists]

[patch]dm_fd_to_hdl in dmapi_register.c

To: linux-xfs@xxxxxxxxxxx
Subject: [patch]dm_fd_to_hdl in dmapi_register.c
From: girish chandrashekara <girish_c_99@xxxxxxxxx>
Date: Thu, 5 Apr 2001 22:16:20 -0700 (PDT)
Sender: owner-linux-xfs@xxxxxxxxxxx
Hi,
   Currently dm_fd_to_hdl is not supported. Here is a
patch which makes use of fget in linux

girish

-----------------------------------------------------
diff -urN linux/fs/xfs/dmapi/dmapi_register.c
linux_c/fs/xfs/dmapi/dmapi_register.c
--- linux/fs/xfs/dmapi/dmapi_register.c Wed Oct 11
21:15:35 2000
+++ linux_c/fs/xfs/dmapi/dmapi_register.c       Fri
Apr  6 09:58:10 2001
@@ -864,13 +864,22 @@
        if ((error = getf(fd, &vfilep)) != 0)
                return(error);
 #else
-       return(ENOSYS);
+       struct file * filep=fget(fd);
 #endif
+#ifdef __sgi
        if (!VF_IS_VNODE(vfilep))
                return(EINVAL);
-
+#else
+       if (!filep)
+               return(EBADF);
+#endif
+#ifdef __sgi
        if ((error =
dm_vp_to_handle(VF_TO_VNODE(vfilep), &handle)) != 0)
                return(error);
+#else
+       if ((error =
dm_vp_to_handle(LINVFS_GET_VP(filep->f_dentry->d_inode),
&handle)) != 0)
+               return(error);
+#endif
 
        if ((fsrp =
dm_find_fsreg_and_lock((fsid_t*)&handle.ha_fsid, &lc))
== NULL)
                return(EBADF);
@@ -887,6 +896,7 @@
 #ifdef __sgi
        return(dm_cpoutsizet(hlenp, hlen));
 #else
+       fput(filep);
        return(put_user(hlen, hlenp));
 #endif
 }
---------------------------------------------------

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

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