From 14290264d48461e23bc49a085be93acc882cfd36 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Mon, 25 Feb 2002 22:06:21 +0000 Subject: [PATCH] Merge of xfs-cmds-2.4.18:slinx:111135a by nathans. bump to version 2.0.0 for extended attribute and other interface changes. --- VERSION | 6 +-- build/rpm/xfsprogs.spec.in | 4 +- debian/changelog | 14 +++++ debian/control | 4 +- doc/CHANGES | 9 ++++ include/handle.h | 8 +++ include/jdm.h | 13 ++++- include/libxfs.h | 5 ++ include/xfs_cred.h | 101 +++++++++++++++---------------------- include/xfs_fs.h | 18 +------ libhandle/Makefile | 2 +- libhandle/handle.c | 70 ++++++++++++++++++++++++- libhandle/jdm.c | 38 ++++++++++++++ man/man8/xfs_freeze.8 | 55 +++++++++++--------- mkfile/xfs_mkfile.c | 57 ++++++++++++++------- repair/attr_repair.c | 16 +++--- 16 files changed, 285 insertions(+), 135 deletions(-) diff --git a/VERSION b/VERSION index 936d4040c..946740663 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ # # This file is used by configure to get version information # -PKG_MAJOR=1 -PKG_MINOR=3 -PKG_REVISION=19 +PKG_MAJOR=2 +PKG_MINOR=0 +PKG_REVISION=0 PKG_BUILD=0 diff --git a/build/rpm/xfsprogs.spec.in b/build/rpm/xfsprogs.spec.in index 30bbbe1eb..e5e3eacbe 100644 --- a/build/rpm/xfsprogs.spec.in +++ b/build/rpm/xfsprogs.spec.in @@ -8,6 +8,7 @@ BuildRoot: @build_root@ Provides: xfs-cmds Obsoletes: xfs-cmds Prereq: /sbin/ldconfig +Conflicts: xfsdump < 2.0.0 Source: @pkg_name@-@pkg_version@.src.tar.gz Copyright: Copyright (C) 2000 Silicon Graphics, Inc. Vendor: Silicon Graphics, Inc. @@ -31,7 +32,8 @@ with the IRIX version of XFS. %package devel Summary: XFS filesystem-specific static libraries and headers. Group: Development/Libraries -Requires: @pkg_name@ +Requires: @pkg_name@ >= 2.0.0 +Conflicts: @pkg_name@ < 2.0.0 %description devel xfsprogs-devel contains the libraries and header files needed to diff --git a/debian/changelog b/debian/changelog index 120f61a6b..dc6bd81aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +xfsprogs (2.0.0-1) unstable; urgency=low + + * New upstream release with support for new libhandle interfaces + * Major release for switch to official extended attributes syscalls + + -- Nathan Scott Thu, 7 Feb 2002 13:25:26 +1100 + xfsprogs (1.3.18-1) unstable; urgency=low * New upstream bugfix (minor) release @@ -27,6 +34,13 @@ xfsprogs (1.3.15-1) unstable; urgency=low -- Nathan Scott Wed, 12 Dec 2001 09:25:42 +1100 +xfsprogs (1.3.14-1) unstable; urgency=low + + * Fix minor package version numbering issue (closes: #117545) + * Fix bug in mkfs.xfs device size cross-check for realtime device + + -- Nathan Scott Wed, 5 Dec 2001 17:13:06 +1100 + xfsprogs (1.3.13-0) unstable; urgency=low * New upstream release diff --git a/debian/control b/debian/control index c4809aecc..387bb2a61 100644 --- a/debian/control +++ b/debian/control @@ -8,6 +8,7 @@ Standards-Version: 3.5.5 Package: xfsprogs Depends: ${shlibs:Depends} Suggests: xfsdump, attr, dvhtool +Conflicts: xfsdump (<< 2.0.0) Architecture: any Description: Utilities for managing the XFS filesystem A set of commands to use the XFS filesystem, including mkfs.xfs. @@ -26,7 +27,8 @@ Description: Utilities for managing the XFS filesystem Package: xfslibs-dev Section: devel Priority: extra -Depends: libc6-dev, xfsprogs +Depends: libc6-dev, xfsprogs (>= 2.0.0) +Conflicts: xfsprogs (<< 2.0.0) Architecture: any Description: XFS filesystem-specific static libraries and headers. xfslibs-dev contains the libraries and header files needed to diff --git a/doc/CHANGES b/doc/CHANGES index 1b98252a5..2e695fd67 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,3 +1,12 @@ +xfsprogs-2.0.0 (26 February 2002) + - Major release to coincide with switch to new extended + attributes system call interfaces + - bumped version of libhandle, added new symbols to use + the reworked extended attributes handle ioctl interface + - xfs_repair in no-modify mode opens the filesystem device + read-only now (fix from Chris Pascoe) + - sync up with recent changes to kernel headers + xfsprogs-1.3.19 (15 February 2002) - fix xfs_repair option parsing for external logs - add xfs_repair option parsing for realtime device diff --git a/include/handle.h b/include/handle.h index 80482b85e..7811d0324 100644 --- a/include/handle.h +++ b/include/handle.h @@ -37,6 +37,9 @@ extern "C" { #endif +struct fsdmidata; +struct attrlist_cursor; + extern int path_to_handle (char *__path, void **__hanp, size_t *__hlen); extern int path_to_fshandle (char *__path, void **__hanp, size_t *__hlen); extern int fd_to_handle (int __fd, void **__hanp, size_t *__hlen); @@ -47,6 +50,11 @@ 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 attr_multi_by_handle (void *__hanp, size_t __hlen, void *__buf, + int __rtrvcnt, int __flags); +extern int attr_list_by_handle (void *__hanp, size_t __hlen, void *__buf, + size_t __bufsize, int __flags, + struct attrlist_cursor *__cursor); extern int fssetdm_by_handle (void *__hanp, size_t __hlen, struct fsdmidata *__fsdmi); diff --git a/include/jdm.h b/include/jdm.h index f49140cc9..3fc4f70d0 100644 --- a/include/jdm.h +++ b/include/jdm.h @@ -37,7 +37,7 @@ typedef void jdm_fshandle_t; /* filesystem handle */ typedef void jdm_filehandle_t; /* filehandle */ struct xfs_bstat; - +struct attrlist_cursor; extern jdm_fshandle_t * jdm_getfshandle( char *mntpnt); @@ -63,6 +63,17 @@ jdm_readlink( jdm_fshandle_t *fshandlep, char *bufp, size_t bufsz); +extern intgen_t +jdm_attr_multi( jdm_fshandle_t *fshp, + xfs_bstat_t *statp, + char *bufp, int rtrvcnt, int flags); + +extern intgen_t +jdm_attr_list( jdm_fshandle_t *fshp, + xfs_bstat_t *statp, + char *bufp, size_t bufsz, int flags, + struct attrlist_cursor *cursor); + /* macro for determining the size of a structure member */ #define sizeofmember( t, m ) sizeof( ( ( t * )0 )->m ) diff --git a/include/libxfs.h b/include/libxfs.h index 3df81732a..c2f59fc62 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -334,6 +334,11 @@ typedef struct xfs_inode { xfs_dinode_core_t i_d; /* most of ondisk inode */ } xfs_inode_t; +typedef struct { + uid_t cr_uid; + gid_t cr_gid; +} cred_t; + extern int libxfs_inode_alloc (xfs_trans_t **, xfs_inode_t *, mode_t, ushort, dev_t, cred_t *, xfs_inode_t **); extern void libxfs_trans_inode_alloc_buf (xfs_trans_t *, xfs_buf_t *); diff --git a/include/xfs_cred.h b/include/xfs_cred.h index ddaf0655d..1ed66ca4f 100644 --- a/include/xfs_cred.h +++ b/include/xfs_cred.h @@ -29,23 +29,16 @@ * * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ - #ifndef __XFS_CRED_H__ #define __XFS_CRED_H__ -#include /* For NGROUPS */ -#ifdef __KERNEL__ -#include -#include -#endif - /* * Access Control Lists */ typedef ushort xfs_acl_perm_t; typedef int xfs_acl_type_t; typedef int xfs_acl_tag_t; -typedef uid_t xfs_acl_id_t; +typedef int xfs_acl_id_t; #define XFS_ACL_MAX_ENTRIES 25 #define XFS_ACL_NOT_PRESENT (-1) @@ -64,13 +57,13 @@ typedef struct xfs_acl { /* * Capabilities */ -typedef __uint64_t cap_value_t; +typedef __uint64_t xfs_cap_value_t; -typedef struct cap_set { - cap_value_t cap_effective; /* use in capability checks */ - cap_value_t cap_permitted; /* combined with file attrs */ - cap_value_t cap_inheritable;/* pass through exec */ -} cap_set_t; +typedef struct xfs_cap_set { + xfs_cap_value_t cap_effective; /* use in capability checks */ + xfs_cap_value_t cap_permitted; /* combined with file attrs */ + xfs_cap_value_t cap_inheritable;/* pass through exec */ +} xfs_cap_set_t; /* @@ -99,8 +92,8 @@ typedef struct cap_set { * | division M | (where M = ml_divcount) * ------------------------------- */ -#define MAC_MAX_SETS 250 -typedef struct mac_label { +#define XFS_MAC_MAX_SETS 250 +typedef struct xfs_mac_label { unsigned char ml_msen_type; /* MSEN label type */ unsigned char ml_mint_type; /* MINT label type */ unsigned char ml_level; /* Hierarchical level */ @@ -108,51 +101,8 @@ typedef struct mac_label { unsigned short ml_catcount; /* Category count */ unsigned short ml_divcount; /* Division count */ /* Category set, then Division set */ - unsigned short ml_list[MAC_MAX_SETS]; -} mac_label; - -/* Data types required by POSIX P1003.1eD15 */ -typedef struct mac_label * mac_t; - - -/* - * Credentials - */ -typedef struct cred { - int cr_ref; /* reference count */ - ushort cr_ngroups; /* number of groups in cr_groups */ - uid_t cr_uid; /* effective user id */ - gid_t cr_gid; /* effective group id */ - uid_t cr_ruid; /* real user id */ - gid_t cr_rgid; /* real group id */ - uid_t cr_suid; /* "saved" user id (from exec) */ - gid_t cr_sgid; /* "saved" group id (from exec) */ - struct mac_label *cr_mac; /* MAC label for B1 and beyond */ - cap_set_t cr_cap; /* capability (privilege) sets */ - gid_t cr_groups[NGROUPS]; /* supplementary group list */ -} cred_t; - - -#ifdef __KERNEL__ -extern int mac_enabled; -extern mac_label *mac_high_low_lp; -static __inline void mac_never(void) {} -struct xfs_inode; -extern int mac_xfs_iaccess(struct xfs_inode *, mode_t, cred_t *); -#define _MAC_XFS_IACCESS(i,m,c) \ - (mac_enabled? (mac_never(), mac_xfs_iaccess(i,m,c)): 0) -extern int mac_xfs_vaccess(vnode_t *, cred_t *, mode_t); -#define _MAC_VACCESS(v,c,m) \ - (mac_enabled? (mac_never(), mac_xfs_vaccess(v,c,m)): 0) - -#define VREAD 00400 -#define VWRITE 00200 -#define VEXEC 00100 -#define MACEXEC 00100 -#define MACWRITE 00200 -#define MACREAD 00400 -#endif /* __KERNEL__ */ - + unsigned short ml_list[XFS_MAC_MAX_SETS]; +} xfs_mac_label_t; /* On-disk XFS extended attribute names (access control lists) */ #define SGI_ACL_FILE "SGI_ACL_FILE" @@ -191,6 +141,35 @@ extern int mac_xfs_vaccess(vnode_t *, cred_t *, mode_t); #ifdef __KERNEL__ + +#include /* For NGROUPS */ +#include +#include + +/* + * Credentials + */ +typedef struct cred { + int cr_ref; /* reference count */ + ushort cr_ngroups; /* number of groups in cr_groups */ + uid_t cr_uid; /* effective user id */ + gid_t cr_gid; /* effective group id */ + uid_t cr_ruid; /* real user id */ + gid_t cr_rgid; /* real group id */ + uid_t cr_suid; /* "saved" user id (from exec) */ + gid_t cr_sgid; /* "saved" group id (from exec) */ + xfs_mac_label_t *cr_mac; /* MAC label for B1 and beyond */ + xfs_cap_set_t cr_cap; /* capability (privilege) sets */ + gid_t cr_groups[NGROUPS]; /* supplementary group list */ +} cred_t; + +#define VREAD 00400 +#define VWRITE 00200 +#define VEXEC 00100 +#define MACEXEC 00100 +#define MACWRITE 00200 +#define MACREAD 00400 + extern void cred_init(void); static __inline cred_t *get_current_cred(void) { return NULL; } /* diff --git a/include/xfs_fs.h b/include/xfs_fs.h index 8c61ac716..d5a7e19c5 100644 --- a/include/xfs_fs.h +++ b/include/xfs_fs.h @@ -363,16 +363,6 @@ typedef struct xfs_fsop_attrmulti_handlereq { struct xfs_attr_multiop *ops; /* attr_multi data to get/set */ } xfs_fsop_attrmulti_handlereq_t; -/* - * Structure for XFS_IOC_ATTRCTL_BY_HANDLE ioctl, will be removed later. - */ -typedef struct xfs_fsop_attr_handlereq { - struct xfs_fsop_handlereq *hreq;/* handle request interface */ - /* structure */ - struct attr_op *ops; /* array of attribute ops */ - int count; /* number of attribute ops */ -} xfs_fsop_attr_handlereq_t; - /* * File system identifier. Should be unique (at least per machine). */ @@ -469,18 +459,12 @@ typedef struct xfs_handle { #define XFS_IOC_ERROR_INJECTION _IOW ('X', 116, struct xfs_error_injection) #define XFS_IOC_ERROR_CLEARALL _IOW ('X', 117, struct xfs_error_injection) /* XFS_IOC_ATTRCTL_BY_HANDLE -- deprecated 118 */ -#define XFS_IOC_ATTRCTL_BY_HANDLE _IOWR('X', 118, struct xfs_fsop_attr_handlereq) #define XFS_IOC_FREEZE _IOWR('X', 119, int) #define XFS_IOC_THAW _IOWR('X', 120, int) #define XFS_IOC_FSSETDM_BY_HANDLE _IOW ('X', 121, struct xfs_fsop_setdm_handlereq) #define XFS_IOC_ATTRLIST_BY_HANDLE _IOW ('X', 122, struct xfs_fsop_attrlist_handlereq) #define XFS_IOC_ATTRMULTI_BY_HANDLE _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq) -/* - * ioctl command to export information not in standard interfaces - * 140: IRIX statvfs.f_fstr field - UUID from the superblock - */ -/* XFS_IOC_GETFSUUID --[TODO]-- deprecated 140 */ -#define XFS_IOC_GETFSUUID _IOR ('X', 140, unsigned char[16]) +/* XFS_IOC_GETFSUUID ---------- deprecated 140 */ /* diff --git a/libhandle/Makefile b/libhandle/Makefile index 3d9fb667b..d077e6d99 100644 --- a/libhandle/Makefile +++ b/libhandle/Makefile @@ -34,7 +34,7 @@ TOPDIR = .. include $(TOPDIR)/include/builddefs LTLIBRARY = libhandle.la -LT_CURRENT = 0 +LT_CURRENT = 1 LT_REVISION = 0 LT_AGE = 0 diff --git a/libhandle/handle.c b/libhandle/handle.c index 9b635dcc2..f90fdfd1c 100644 --- a/libhandle/handle.c +++ b/libhandle/handle.c @@ -34,7 +34,11 @@ #include #include #include -#include "handle.h" + +/* attributes.h (purposefully) unavailable to xfsprogs, make do */ +struct attrlist_cursor { __u32 opaque[4]; }; + +#include /* just pick a value we know is more than big enough */ #define MAXHANSIZ 64 @@ -54,7 +58,6 @@ typedef union { char *path; } comarg_t; - int obj_to_handle ( int fsfd, @@ -303,6 +306,69 @@ readlink_by_handle ( return (int) ioctl(fd, XFS_IOC_READLINK_BY_HANDLE, &hreq); } +int +attr_multi_by_handle( + void *hanp, + size_t hlen, + void *buf, + int rtrvcnt, + int flags) +{ + int fd; + xfs_fsop_attrmulti_handlereq_t amhreq; + + if ((fd = handle_to_fsfd(hanp)) < 0) { + errno = EBADF; + return -1; + } + + amhreq.hreq.fd = 0; + amhreq.hreq.path = NULL; + amhreq.hreq.oflags = 0; + amhreq.hreq.ihandle = hanp; + amhreq.hreq.ihandlen = hlen; + amhreq.hreq.ohandle = NULL; + amhreq.hreq.ohandlen = NULL; + + amhreq.opcount = rtrvcnt; + amhreq.ops = buf; + + return (int) ioctl(fd, XFS_IOC_ATTRMULTI_BY_HANDLE, &amhreq); +} + +int +attr_list_by_handle( + void *hanp, + size_t hlen, + void *buf, + size_t bufsize, + int flags, + struct attrlist_cursor *cursor) +{ + int fd; + xfs_fsop_attrlist_handlereq_t alhreq; + + if ((fd = handle_to_fsfd(hanp)) < 0) { + errno = EBADF; + return -1; + } + + alhreq.hreq.fd = 0; + alhreq.hreq.path = NULL; + alhreq.hreq.oflags = 0; + alhreq.hreq.ihandle = hanp; + alhreq.hreq.ihandlen = hlen; + alhreq.hreq.ohandle = NULL; + alhreq.hreq.ohandlen = NULL; + + memcpy(&alhreq.pos, cursor, sizeof(alhreq.pos)); + alhreq.flags = flags; + alhreq.buflen = bufsize; + alhreq.buffer = buf; + + return (int) ioctl(fd, XFS_IOC_ATTRLIST_BY_HANDLE, &alhreq); +} + int fssetdm_by_handle ( void *hanp, diff --git a/libhandle/jdm.c b/libhandle/jdm.c index bac715481..958dd3f9d 100644 --- a/libhandle/jdm.c +++ b/libhandle/jdm.c @@ -32,6 +32,10 @@ */ #include + +/* attributes.h (purposefully) unavailable to xfsprogs, make do */ +struct attrlist_cursor { __u32 opaque[4]; }; + #include #include @@ -152,3 +156,37 @@ jdm_readlink( jdm_fshandle_t *fshp, bufsz ); return rval; } + +int +jdm_attr_multi( jdm_fshandle_t *fshp, + xfs_bstat_t *statp, + char *bufp, int rtrvcnt, int flags) +{ + register fshandle_t *fshandlep = ( fshandle_t * )fshp; + filehandle_t filehandle; + int rval; + + jdm_fill_filehandle( &filehandle, fshandlep, statp ); + rval = attr_multi_by_handle ( ( void * )&filehandle, + sizeof( filehandle ), + (void *) bufp, + rtrvcnt, flags); + return rval; +} + +int +jdm_attr_list( jdm_fshandle_t *fshp, + xfs_bstat_t *statp, + char *bufp, size_t bufsz, int flags, + struct attrlist_cursor *cursor) +{ + register fshandle_t *fshandlep = ( fshandle_t * )fshp; + filehandle_t filehandle; + int rval; + + jdm_fill_filehandle( &filehandle, fshandlep, statp ); + rval = attr_list_by_handle (( void * )&filehandle, + sizeof( filehandle ), + bufp, bufsz, flags, cursor); + return rval; +} diff --git a/man/man8/xfs_freeze.8 b/man/man8/xfs_freeze.8 index c11e74e30..eb7d75bbc 100644 --- a/man/man8/xfs_freeze.8 +++ b/man/man8/xfs_freeze.8 @@ -9,38 +9,47 @@ xfs_freeze \- suspend access to an XFS filesystem .I xfs_freeze suspends and resumes access to an XFS filesystem (see .IR xfs (5)). +.PP +.I xfs_freeze +halts new access to the filesystem and creates a stable image on disk. +.I xfs_freeze +is intended to be used with volume managers and hardware RAID devices +that support the creation of snapshots. +.PP The .I mount-point argument is the pathname of the directory where the filesystem is mounted. The filesystem must be mounted to be frozen (see .IR mount (8)). -.I xfs_freeze -is intended to be used with volume managers and hardware raid devices -which support the creation of snapshots, -.I xfs_freeze -will halt new access to the filesystem and create a stable image on disk -suitable for using as a snapshot. .PP -Using the \f3\-f\f1 option, the filesystem is locked out from new -modifications, write system calls are halted on entry, other calls -which modify the filesystem are halted at the start of a transaction, -all ongoing transactions in the filesystem are allowed to complete. +The \f3\-f\f1 flag requests the specified XFS filesystem to be +frozen from new modifications. +When this is selected, all ongoing transactions in the filesystem +are allowed to complete, new write system calls are halted, other +calls which modify the filesystem are halted, and all dirty data, +metadata, and log information are written to disk. +Any process attempting to write to the frozen filesystem will block +waiting for the filesystem to be unfrozen. .PP -All dirty data is written out to disk, the log is flushed to disk and -all dirty metadata is written out. The \f3\-u\f1 option is then used -to unfreeze the filesystem and allow operations to continue. +Note that even after freezing, the on-disk filesystem can contain +information on files that are still in the process of unlinking. +These files will not be unlinked until the filesystem is unfrozen +or a clean mount of the snapshot is complete. .PP -The options to -.I xfs_freeze -are: -.TP -\f3\-f\f1 -Specifies that the filesystem should be frozen. -.TP -.B \-u -Specifies that the filesystem should be unfrozen and new modifications -allowed. +The \f3\-u\f1 option is used to un-freeze the filesystem and allow +operations to continue. +Any filesystem modifications that were blocked by the freeze are +unblocked and allowed to complete. +.PP +One of \f3\-f\f1 or \f3\-u\f1 must be supplied to +.IR xfs_freeze . +.SH NOTES +A copy of a frozen XFS filesystem will usually have the same universally +unique identifier (UUID) as the original, and thus may be prevented from +being mounted. +The XFS \f3nouuid\f1 mount option can be used to circumvent this issue. .SH SEE ALSO +xfs(5), lvm(8), mount(8). diff --git a/mkfile/xfs_mkfile.c b/mkfile/xfs_mkfile.c index 1957b4da7..28df7c9da 100644 --- a/mkfile/xfs_mkfile.c +++ b/mkfile/xfs_mkfile.c @@ -38,13 +38,42 @@ #include #include #include +#include #include #define MAXBUFFERSIZE (256 * 1024) -static void usage(void); static char *progname; +static void +usage(void) +{ + fprintf(stderr, "%s: [-npv] [] ...\n", progname); + exit(2); +} + +static int +openfd(char *name, int oflags) +{ + struct statfs buf; + int fd; + + fd = open(name, oflags, 0600); + if (fd < 0) { + perror(name); + return -1; + } + + fstatfs(fd, &buf); + if (buf.f_type != XFS_SUPER_MAGIC) { + fprintf(stderr, "%s: " + "file [\"%s\"] is not on an XFS filesystem\n", + progname, name); + return -1; + } + return fd; +} + int main(int argc, char **argv) { @@ -139,7 +168,11 @@ main(int argc, char **argv) oflags = O_CREAT|O_TRUNC|O_WRONLY|(nobytes ? 0 : O_DIRECT); - fd = open(argv[optind], oflags, 0600); + if ((fd = openfd(argv[optind], oflags)) == -1) { + optind++; + errs++; + continue; + } if ( (oflags & O_DIRECT) && ( (fd < 0 && errno == EINVAL) @@ -149,14 +182,11 @@ main(int argc, char **argv) oflags &= ~O_DIRECT; - fd = open(argv[optind], oflags, 0600); - } - - if (fd < 0) { - perror(argv[optind]); - optind++; - errs++; - continue; + if ((fd = openfd(argv[optind], oflags)) == -1) { + optind++; + errs++; + continue; + } } if (size == 0) { @@ -255,10 +285,3 @@ main(int argc, char **argv) return errs != 0; } - -static void -usage(void) -{ - fprintf(stderr, "%s: [-npv] [] ...\n", progname); - exit(2); -} diff --git a/repair/attr_repair.c b/repair/attr_repair.c index 903b6115b..d13a483be 100644 --- a/repair/attr_repair.c +++ b/repair/attr_repair.c @@ -39,7 +39,7 @@ #include "bmap.h" static int xfs_acl_valid(xfs_acl_t *aclp); -static int xfs_mac_valid(mac_t lp); +static int xfs_mac_valid(xfs_mac_label_t *lp); /* @@ -98,7 +98,7 @@ int valuecheck(char *namevalue, char *value, int namelen, int valuelen) { /* for proper alignment issues, get the structs and bcopy the values */ - mac_label macl; + xfs_mac_label_t macl; xfs_acl_t thisacl; void *valuep; int clearit = 0; @@ -119,13 +119,13 @@ valuecheck(char *namevalue, char *value, int namelen, int valuelen) } } else if (strncmp(namevalue, SGI_MAC_FILE, SGI_MAC_FILE_SIZE) == 0) { if (value == NULL) { - bzero(&macl, sizeof(mac_label)); + bzero(&macl, sizeof(xfs_mac_label_t)); bcopy(namevalue+namelen, &macl, valuelen); valuep = &macl; } else valuep = value; - if (xfs_mac_valid((mac_label *) valuep) != 1) { /* 1 is valid */ + if (xfs_mac_valid((xfs_mac_label_t *)valuep) != 1) { /* 1 is valid */ /* *if sysconf says MAC enabled, * temp = mac_from_text("msenhigh/mintlow", NULL) @@ -138,7 +138,7 @@ valuecheck(char *namevalue, char *value, int namelen, int valuelen) do_warn("entry contains illegal value in attribute named SGI_MAC_LABEL\n"); } } else if (strncmp(namevalue, SGI_CAP_FILE, SGI_CAP_FILE_SIZE) == 0) { - if ( valuelen != sizeof(cap_set_t)) { + if ( valuelen != sizeof(xfs_cap_set_t)) { clearit = 1; do_warn("entry contains illegal value in attribute named SGI_CAP_FILE\n"); } @@ -1010,10 +1010,10 @@ __check_setvalue(const unsigned short *list, unsigned short count) /* * xfs_mac_valid(lp) - * check the validity of a mac label + * Check the validity of a MAC label. */ static int -xfs_mac_valid(mac_t lp) +xfs_mac_valid(xfs_mac_label_t *lp) { if (lp == NULL) return (0); @@ -1022,7 +1022,7 @@ xfs_mac_valid(mac_t lp) * if the total category set and division set is greater than 250 * report error */ - if ((lp->ml_catcount + lp->ml_divcount) > MAC_MAX_SETS) + if ((lp->ml_catcount + lp->ml_divcount) > XFS_MAC_MAX_SETS) return(0); /* -- 2.39.5