diff options
author | Dean Roehrich <roehrich@sgi.com> | 2005-05-23 16:30:05 +0000 |
---|---|---|
committer | Dean Roehrich <roehrich@sgi.com> | 2005-05-23 16:30:05 +0000 |
commit | 49c3c4dffa813e5da1e77b898d5df4bf7559527e (patch) | |
tree | 0ddff95036197ffa8fad9127e7fb13e3f60e9705 | |
parent | 24f6d16ee9f8aa08275e3ad7af01b6d0bfb47b9d (diff) | |
download | dmapi-dev-49c3c4dffa813e5da1e77b898d5df4bf7559527e.tar.gz |
Remove dm_fsfid from libdm
Update to match the kernel version
-rw-r--r-- | include/dmapi.h | 7 | ||||
-rw-r--r-- | include/dmapi_kern.h | 18 | ||||
-rw-r--r-- | libdm/dm_handle.c | 48 |
3 files changed, 33 insertions, 40 deletions
diff --git a/include/dmapi.h b/include/dmapi.h index cbb0a04..72341eb 100644 --- a/include/dmapi.h +++ b/include/dmapi.h @@ -150,7 +150,7 @@ typedef int dm_nlink_t; #define DM_INVALID_HLEN 0 #define DM_GLOBAL_HANP ((void *)(1LL)) #define DM_GLOBAL_HLEN ((size_t)(1)) -#define DM_VER_STR_CONTENTS "SGI DMAPI (XDSM) API, Release 1.0." +#define DM_VER_STR_CONTENTS "SGI DMAPI (XDSM) API, Release 1.1." #define DMEV_SET(event_type, event_list) \ @@ -482,11 +482,6 @@ typedef struct dm_xstat dm_xstat_t; #define MAXDMFSFIDSZ 46 -typedef struct dm_fsfid { - __u16 fid_len; /* length of data in bytes */ - unsigned char fid_data[MAXDMFSFIDSZ]; /* data (fid_len worth) */ -} dm_fsfid_t; - struct dm_fid { __u16 dm_fid_len; /* length of remainder */ __u16 dm_fid_pad; diff --git a/include/dmapi_kern.h b/include/dmapi_kern.h index 02f918b..f5ae1ca 100644 --- a/include/dmapi_kern.h +++ b/include/dmapi_kern.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as @@ -76,11 +76,13 @@ struct dm_handle_t; struct filesystem_dmapi_operations { int (*get_fsys_vector)(struct super_block *sb, void *addr); int (*fh_to_inode)(struct super_block *sb, struct inode **ip, - struct dm_fsfid *fid); + dm_fid_t *fid); struct file_operations * (*get_invis_ops)(struct inode *ip); - int (*inode_to_fh)(struct inode *ip, struct dm_fsfid *fid, + int (*inode_to_fh)(struct inode *ip, dm_fid_t *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); }; @@ -135,6 +137,12 @@ int dm_ip_to_handle ( struct inode *ip, dm_handle_t *handlep); +#define HAVE_DM_RELEASE_THREADS_ERRNO +int dm_release_threads( + struct super_block *sb, + struct inode *inode, + int errno); + void dmapi_register( struct file_system_type *fstype, struct filesystem_dmapi_operations *dmapiops); @@ -142,6 +150,10 @@ void dmapi_register( void dmapi_unregister( struct file_system_type *fstype); +int dmapi_registered( + struct file_system_type *fstype, + struct filesystem_dmapi_operations **dmapiops); + /* The following prototypes and definitions are used by DMAPI as its interface into the filesystem code. Communication between DMAPI and the diff --git a/libdm/dm_handle.c b/libdm/dm_handle.c index 03bf330..43b15f5 100644 --- a/libdm/dm_handle.c +++ b/libdm/dm_handle.c @@ -31,15 +31,9 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ -#ifdef linux -#include <xfs/libxfs.h> -#include <xfs/handle.h> -#else -#include <sys/handle.h> #include <errno.h> #include <stdlib.h> #include <string.h> -#endif #include <dmapi.h> #include <dmapi_kern.h> @@ -153,9 +147,8 @@ parse_handle( dm_ino_t *inop, dm_igen_t *igenp) { - xfs_handle_t handle; - xfs_fid2_t *xfid2; - fid_t *fidp; + dm_handle_t handle; + dm_fid_t *dmfid; if (hanp == DM_GLOBAL_HANP && hlen == DM_GLOBAL_HLEN) return(DM_HANDLE_GLOBAL); @@ -164,30 +157,24 @@ parse_handle( return(DM_HANDLE_BAD); memcpy(&handle, hanp, hlen); - if (!handle.ha_fsid.val[0] || !handle.ha_fsid.val[1]) + if (! handle.ha_fsid) return(DM_HANDLE_BAD); if (fsidp) memcpy(fsidp, &handle.ha_fsid, sizeof(handle.ha_fsid)); if (hlen == sizeof(handle.ha_fsid)) return(DM_HANDLE_FILESYSTEM); -#ifdef linux - fidp = (fid_t*)&handle.ha_fid; - if (fidp->fid_len != (hlen - sizeof(handle.ha_fsid) - sizeof(fidp->fid_len))) - return(DM_HANDLE_BAD); -#else - if (handle.ha_fid.fid_len != (hlen - sizeof(handle.ha_fsid) - sizeof(handle.ha_fid.fid_len))) + if (handle.ha_fid.dm_fid_len != (hlen - sizeof(handle.ha_fsid) - sizeof(handle.ha_fid.dm_fid_len))) return(DM_HANDLE_BAD); -#endif - xfid2 = (struct xfs_fid2 *)&handle.ha_fid; - if (xfid2->fid_len == sizeof *xfid2 - sizeof xfid2->fid_len) { - if (xfid2->fid_pad) + dmfid = &handle.ha_fid; + if (dmfid->dm_fid_len == sizeof *dmfid - sizeof dmfid->dm_fid_len) { + if (dmfid->dm_fid_pad) return(DM_HANDLE_BAD); if (inop) - *inop = xfid2->fid_ino; + *inop = dmfid->dm_fid_ino; if (igenp) - *igenp = xfid2->fid_gen; + *igenp = dmfid->dm_fid_gen; } else { return(DM_HANDLE_BAD); } @@ -291,17 +278,16 @@ dm_make_handle( void **hanpp, size_t *hlenp) { - xfs_fid2_t *xfid2; -/* XXX */ - xfs_handle_t handle; + dm_fid_t *fid; + dm_handle_t handle; memcpy(&handle.ha_fsid, fsidp, sizeof(handle.ha_fsid)); - xfid2 = (struct xfs_fid2 *)&handle.ha_fid; - xfid2->fid_pad = 0; - xfid2->fid_gen = (__u32)*igenp; - xfid2->fid_ino = *inop; - xfid2->fid_len = sizeof(*xfid2) - sizeof(xfid2->fid_len); - *hlenp = sizeof(*xfid2) + sizeof(handle.ha_fsid); + fid = &handle.ha_fid; + fid->dm_fid_pad = 0; + fid->dm_fid_gen = (__u32)*igenp; + fid->dm_fid_ino = *inop; + fid->dm_fid_len = sizeof(*fid) - sizeof(fid->dm_fid_len); + *hlenp = sizeof(*fid) + sizeof(handle.ha_fsid); if ((*hanpp = malloc(*hlenp)) == NULL) { errno = ENOMEM; return -1; |