From: Dean Roehrich Date: Thu, 19 Jul 2001 19:26:28 +0000 (+0000) Subject: add prototype for fssetdm_by_handle(). X-Git-Tag: v2.0.0~81 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e186428686f0d73c9dea39324792762c9979813a;p=thirdparty%2Fxfsprogs-dev.git add prototype for fssetdm_by_handle(). --- diff --git a/include/handle.h b/include/handle.h index 98b16575c..8850ed041 100644 --- a/include/handle.h +++ b/include/handle.h @@ -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 } diff --git a/include/xfs_fs.h b/include/xfs_fs.h index b64a71723..2708154c7 100644 --- a/include/xfs_fs.h +++ b/include/xfs_fs.h @@ -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; /* diff --git a/libhandle/handle.c b/libhandle/handle.c index 2dfb31b4c..9b696183a 100644 --- a/libhandle/handle.c +++ b/libhandle/handle.c @@ -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 (