From: Tim Shimmin Date: Wed, 15 Feb 2006 02:50:54 +0000 (+0000) Subject: get rid of cursor and more parameters for getparents functions. X-Git-Tag: v2.8.0~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60ac13e894e0a820063e59683ca24072de801c2d;p=thirdparty%2Fxfsprogs-dev.git get rid of cursor and more parameters for getparents functions. Slight function namechange at the same time. Merge of master-melb:xfs-cmds:25194a by kenmcd. Remove cursor and more parameters. --- diff --git a/include/handle.h b/include/handle.h index 777df22c7..b211a2f45 100644 --- a/include/handle.h +++ b/include/handle.h @@ -24,7 +24,6 @@ extern "C" { struct fsdmidata; struct attrlist_cursor; -struct parent_cursor; struct parent; extern int path_to_handle (char *__path, void **__hanp, size_t *__hlen); @@ -41,14 +40,12 @@ extern int attr_multi_by_handle (void *__hanp, size_t __hlen, void *__buf, extern int attr_list_by_handle (void *__hanp, size_t __hlen, void *__buf, size_t __bufsize, int __flags, struct attrlist_cursor *__cursor); -extern int getparents_by_handle(void *__hanp, size_t __hlen, - struct parent *__buf, size_t __bufsize, - struct parent_cursor *__cursor, - unsigned int *__count, unsigned int *__more); -extern int getparentpaths_by_handle(void *__hanp, size_t __hlen, - struct parent *__buf, size_t __bufsize, - struct parent_cursor *__cursor, - unsigned int *__count, unsigned int *__more); +extern int parents_by_handle(void *__hanp, size_t __hlen, + struct parent *__buf, size_t __bufsize, + unsigned int *__count); +extern int parentpaths_by_handle(void *__hanp, size_t __hlen, + struct parent *__buf, size_t __bufsize, + unsigned int *__count); extern int fssetdm_by_handle (void *__hanp, size_t __hlen, struct fsdmidata *__fsdmi); diff --git a/include/jdm.h b/include/jdm.h index 0410a9ea3..c39d815e9 100644 --- a/include/jdm.h +++ b/include/jdm.h @@ -24,7 +24,6 @@ typedef void jdm_filehandle_t; /* filehandle */ struct xfs_bstat; struct attrlist_cursor; -struct parent_cursor; struct parent; extern jdm_fshandle_t * @@ -63,18 +62,16 @@ jdm_attr_list( jdm_fshandle_t *fshp, struct attrlist_cursor *cursor); extern int -jdm_getparents( jdm_fshandle_t *fshp, +jdm_parents( jdm_fshandle_t *fshp, xfs_bstat_t *statp, struct parent *bufp, size_t bufsz, - struct parent_cursor *cursor, - unsigned int *count, unsigned int *more); + unsigned int *count); extern int -jdm_getparentpaths( jdm_fshandle_t *fshp, +jdm_parentpaths( jdm_fshandle_t *fshp, xfs_bstat_t *statp, struct parent *bufp, size_t bufsz, - struct parent_cursor *cursor, - unsigned int *count, unsigned int *more); + unsigned int *count); /* macro for determining the size of a structure member */ #define sizeofmember( t, m ) sizeof( ( ( t * )0 )->m ) diff --git a/libhandle/handle.c b/libhandle/handle.c index 4bd052b23..c535f2ff8 100644 --- a/libhandle/handle.c +++ b/libhandle/handle.c @@ -370,86 +370,28 @@ attr_list_by_handle( } int -getparents_by_handle( +parents_by_handle( void *hanp, size_t hlen, parent_t *buf, size_t bufsiz, - parent_cursor_t *cursor, - unsigned int *count, - unsigned int *more) + unsigned int *count) + { -#if !defined(__sgi__) errno = EOPNOTSUPP; return -1; -#else - - int error, fd; - char *path; - xfs_fsop_getparents_handlereq_t gphreq; - - if ((fd = handle_to_fsfd(hanp, &path)) < 0) - return -1; - - gphreq.hreq.fd = 0; - gphreq.hreq.path = NULL; - gphreq.hreq.oflags = O_LARGEFILE; - gphreq.hreq.ihandle = hanp; - gphreq.hreq.ihandlen = hlen; - gphreq.hreq.ohandle = NULL; - gphreq.hreq.ohandlen = NULL; - memcpy(&gphreq.pos, cursor, sizeof(gphreq.pos)); - gphreq.buflen = bufsiz; - gphreq.buffer = buf; - gphreq.ocount = count; - gphreq.omore = more; - - error = xfsctl(path, fd, XFS_IOC_GETPARENTS, &gphreq); - - memcpy(cursor, &gphreq.pos, sizeof(gphreq.pos)); - return error; -#endif } int -getparentpaths_by_handle( +parentpaths_by_handle( void *hanp, size_t hlen, parent_t *buf, size_t bufsiz, - parent_cursor_t *cursor, - unsigned int *count, - unsigned int *more) + unsigned int *count) { -#if !defined(__sgi__) errno = EOPNOTSUPP; return -1; -#else - int error, fd; - char *path; - xfs_fsop_getparents_handlereq_t gphreq; - - if ((fd = handle_to_fsfd(hanp, &path)) < 0) - return -1; - - gphreq.hreq.fd = 0; - gphreq.hreq.path = NULL; - gphreq.hreq.oflags = O_LARGEFILE; - gphreq.hreq.ihandle = hanp; - gphreq.hreq.ihandlen = hlen; - gphreq.hreq.ohandle = NULL; - gphreq.hreq.ohandlen = NULL; - memcpy(&gphreq.pos, cursor, sizeof(gphreq.pos)); - gphreq.buflen = bufsiz; - gphreq.buffer = buf; - gphreq.ocount = count; - gphreq.omore = more; - - error = xfsctl(path, fd, XFS_IOC_GETPARENTPATHS, &gphreq); - - memcpy(cursor, &gphreq.pos, sizeof(gphreq.pos)); - return error; -#endif } int diff --git a/libhandle/jdm.c b/libhandle/jdm.c index bac68c0a9..a724b61d1 100644 --- a/libhandle/jdm.c +++ b/libhandle/jdm.c @@ -174,43 +174,21 @@ jdm_attr_list( jdm_fshandle_t *fshp, } int -jdm_getparents( jdm_fshandle_t *fshp, +jdm_parents( jdm_fshandle_t *fshp, xfs_bstat_t *statp, parent_t *bufp, size_t bufsz, - parent_cursor_t *cursor, - unsigned int *count, unsigned int *more) + unsigned int *count) { -#if !defined(__sgi__) errno = EOPNOTSUPP; return -1; -#else - register fshandle_t *fshandlep = ( fshandle_t * )fshp; - filehandle_t filehandle; - - jdm_fill_filehandle( &filehandle, fshandlep, statp ); - return getparents_by_handle (( void * )&filehandle, - sizeof( filehandle ), - bufp, bufsz, cursor, count, more); -#endif } int -jdm_getparentpaths( jdm_fshandle_t *fshp, +jdm_parentpaths( jdm_fshandle_t *fshp, xfs_bstat_t *statp, parent_t *bufp, size_t bufsz, - parent_cursor_t *cursor, - unsigned int *count, unsigned int *more) + unsigned int *count) { -#if !defined(__sgi__) errno = EOPNOTSUPP; return -1; -#else - register fshandle_t *fshandlep = ( fshandle_t * )fshp; - filehandle_t filehandle; - - jdm_fill_filehandle( &filehandle, fshandlep, statp ); - return getparentpaths_by_handle (( void * )&filehandle, - sizeof( filehandle ), - bufp, bufsz, cursor, count, more); -#endif }