]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
add prototype for fssetdm_by_handle().
authorDean Roehrich <roehrich@sgi.com>
Thu, 19 Jul 2001 19:26:28 +0000 (19:26 +0000)
committerDean Roehrich <roehrich@sgi.com>
Thu, 19 Jul 2001 19:26:28 +0000 (19:26 +0000)
include/handle.h
include/xfs_fs.h
libhandle/handle.c

index 98b16575cc9870eb62be000fee33a3f687e44201..8850ed04177e138678321f315c8b56c4be96f9af 100644 (file)
@@ -46,6 +46,8 @@ extern void free_handle (void *__hanp, size_t __hlen);
 extern int  open_by_handle (void *__hanp, size_t __hlen, int __rw);
 extern int  readlink_by_handle (void *__hanp, size_t __hlen, void *__buf,
                                size_t __bs);
+extern int  fssetdm_by_handle (void *__hanp, size_t __hlen,
+                              struct fsdmidata *__fsdmi);
 
 #ifdef __cplusplus
 }
index b64a71723cb7c25a5167692abf3c082d29ffbc55..2708154c70396150a24af9b76092fd300676951a 100644 (file)
@@ -148,7 +148,7 @@ struct getbmapx {
 #endif /* __KERNEL__ */
 
 /*
- * Structure for F_FSSETDM.
+ * Structure for XFS_IOC_FSSETDM.
  * For use by backup and restore programs to set the XFS on-disk inode
  * fields di_dmevmask and di_dmstate.  These must be set to exactly and
  * only values previously obtained via xfs_bulkstat!  (Specifically the
@@ -359,7 +359,7 @@ typedef struct xfs_fsop_attr_handlereq {
 typedef struct xfs_fsop_setdm_handlereq {
        struct xfs_fsop_handlereq hreq; /* handle request interface     */
                                        /* structure                    */
-       struct fsdmidata data;          /* DMI data to set              */
+       struct fsdmidata *data;         /* DMAPI data to set            */
 } xfs_fsop_setdm_handlereq_t;
 
 /*
index 2dfb31b4c4118041b71e96aed17cf054d985a8e6..9b696183a1aa2444d62184426a10981941c82a5e 100644 (file)
@@ -302,6 +302,34 @@ readlink_by_handle (
        return (int) ioctl(fd, XFS_IOC_READLINK_BY_HANDLE, &hreq);
 }
 
+int
+fssetdm_by_handle (
+       void            *hanp,
+       size_t          hlen,
+       struct fsdmidata *fsdmidata)
+{
+       int             fd;
+       xfs_fsop_setdm_handlereq_t dmhreq;
+
+
+       if ((fd = handle_to_fsfd(hanp)) < 0) {
+               errno = EBADF;
+               return -1;
+       }
+
+       dmhreq.hreq.fd       = 0;
+       dmhreq.hreq.path     = NULL;
+       dmhreq.hreq.oflags   = 0;
+       dmhreq.hreq.ihandle  = hanp;
+       dmhreq.hreq.ihandlen = hlen;
+       dmhreq.hreq.ohandle  = NULL;
+       dmhreq.hreq.ohandlen = NULL;
+
+       dmhreq.data = fsdmidata;
+
+       return (int) ioctl(fd, XFS_IOC_FSSETDM_BY_HANDLE, &dmhreq);
+}
+
 /*ARGSUSED*/
 void
 free_handle (