diff --git a/include/os/freebsd/spl/sys/acl_impl.h b/include/os/freebsd/spl/sys/acl_impl.h index 8718f5bcf63f..1efbd6d73bd0 100644 --- a/include/os/freebsd/spl/sys/acl_impl.h +++ b/include/os/freebsd/spl/sys/acl_impl.h @@ -1,61 +1,59 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_ACL_IMPL_H #define _SYS_ACL_IMPL_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif /* * acl flags * * ACL_AUTO_INHERIT, ACL_PROTECTED and ACL_DEFAULTED * flags can also be stored in this field. */ #define ACL_IS_TRIVIAL 0x10000 #define ACL_IS_DIR 0x20000 typedef enum acl_type { ACLENT_T = 0, ACE_T = 1 } zfs_acl_type_t; struct acl_info { zfs_acl_type_t acl_type; /* style of acl */ int acl_cnt; /* number of acl entries */ int acl_entry_size; /* sizeof acl entry */ int acl_flags; /* special flags about acl */ void *acl_aclp; /* the acl */ }; #ifdef __cplusplus } #endif #endif /* _SYS_ACL_IMPL_H */ diff --git a/include/os/freebsd/spl/sys/cmn_err.h b/include/os/freebsd/spl/sys/cmn_err.h index a75471f647eb..00d686439f94 100644 --- a/include/os/freebsd/spl/sys/cmn_err.h +++ b/include/os/freebsd/spl/sys/cmn_err.h @@ -1,100 +1,98 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_CMN_ERR_H #define _SYS_CMN_ERR_H -#pragma ident "%Z%%M% %I% %E% SMI" - #if !defined(_ASM) #include #endif #ifdef __cplusplus extern "C" { #endif /* Common error handling severity levels */ #define CE_CONT 0 /* continuation */ #define CE_NOTE 1 /* notice */ #define CE_WARN 2 /* warning */ #define CE_PANIC 3 /* panic */ #define CE_IGNORE 4 /* print nothing */ #ifndef _ASM /*PRINTFLIKE2*/ extern void cmn_err(int, const char *, ...) __KPRINTFLIKE(2); #pragma rarely_called(cmn_err) extern void vzcmn_err(zoneid_t, int, const char *, __va_list) __KVPRINTFLIKE(3); #pragma rarely_called(vzcmn_err) extern void vcmn_err(int, const char *, __va_list) __KVPRINTFLIKE(2); #pragma rarely_called(vcmn_err) /*PRINTFLIKE3*/ extern void zcmn_err(zoneid_t, int, const char *, ...) __KPRINTFLIKE(3); #pragma rarely_called(zcmn_err) extern void vzprintf(zoneid_t, const char *, __va_list) __KVPRINTFLIKE(2); #pragma rarely_called(vzprintf) /*PRINTFLIKE2*/ extern void zprintf(zoneid_t, const char *, ...) __KPRINTFLIKE(2); #pragma rarely_called(zprintf) extern void vuprintf(const char *, __va_list) __KVPRINTFLIKE(1); #pragma rarely_called(vuprintf) /*PRINTFLIKE1*/ extern void panic(const char *, ...) __KPRINTFLIKE(1) __NORETURN; #pragma rarely_called(panic) extern void vpanic(const char *, __va_list) __KVPRINTFLIKE(1) __NORETURN; #pragma rarely_called(vpanic) #endif /* !_ASM */ #ifdef __cplusplus } #endif #endif /* _SYS_CMN_ERR_H */ diff --git a/include/os/freebsd/spl/sys/extdirent.h b/include/os/freebsd/spl/sys/extdirent.h index 65ba11f345d2..b22e8e8563a2 100644 --- a/include/os/freebsd/spl/sys/extdirent.h +++ b/include/os/freebsd/spl/sys/extdirent.h @@ -1,73 +1,71 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_EXTDIRENT_H #define _SYS_EXTDIRENT_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif #include #include /* * Extended file-system independent directory entry. This style of * dirent provides additional informational flag bits for each * directory entry. This dirent will be returned instead of the * standard dirent if a VOP_READDIR() requests dirent flags via * V_RDDIR_ENTFLAGS, and if the file system supports the flags. */ typedef struct edirent { ino64_t ed_ino; /* "inode number" of entry */ off64_t ed_off; /* offset of disk directory entry */ uint32_t ed_eflags; /* per-entry flags */ unsigned short ed_reclen; /* length of this record */ char ed_name[1]; /* name of file */ } edirent_t; #define EDIRENT_RECLEN(namelen) \ ((offsetof(edirent_t, ed_name[0]) + 1 + (namelen) + 7) & ~ 7) #define EDIRENT_NAMELEN(reclen) \ ((reclen) - (offsetof(edirent_t, ed_name[0]))) /* * Extended entry flags * Extended entries include a bitfield of extra information * regarding that entry. */ #define ED_CASE_CONFLICT 0x10 /* Disconsidering case, entry is not unique */ /* * Extended flags accessor function */ #define ED_CASE_CONFLICTS(x) ((x)->ed_eflags & ED_CASE_CONFLICT) #ifdef __cplusplus } #endif #endif /* _SYS_EXTDIRENT_H */ diff --git a/include/os/freebsd/spl/sys/list.h b/include/os/freebsd/spl/sys/list.h index 8339b6226d11..6db92ed42955 100644 --- a/include/os/freebsd/spl/sys/list.h +++ b/include/os/freebsd/spl/sys/list.h @@ -1,67 +1,65 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_LIST_H #define _SYS_LIST_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include #ifdef __cplusplus extern "C" { #endif typedef struct list_node list_node_t; typedef struct list list_t; void list_create(list_t *, size_t, size_t); void list_destroy(list_t *); void list_insert_after(list_t *, void *, void *); void list_insert_before(list_t *, void *, void *); void list_insert_head(list_t *, void *); void list_insert_tail(list_t *, void *); void list_remove(list_t *, void *); void *list_remove_head(list_t *); void *list_remove_tail(list_t *); void list_move_tail(list_t *, list_t *); void *list_head(list_t *); void *list_tail(list_t *); void *list_next(list_t *, void *); void *list_prev(list_t *, void *); int list_is_empty(list_t *); void list_link_init(list_node_t *); void list_link_replace(list_node_t *, list_node_t *); int list_link_active(list_node_t *); #ifdef __cplusplus } #endif #endif /* _SYS_LIST_H */ diff --git a/include/os/freebsd/spl/sys/list_impl.h b/include/os/freebsd/spl/sys/list_impl.h index 9c42f8832023..a6614f9a38c2 100644 --- a/include/os/freebsd/spl/sys/list_impl.h +++ b/include/os/freebsd/spl/sys/list_impl.h @@ -1,53 +1,51 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_LIST_IMPL_H #define _SYS_LIST_IMPL_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include #ifdef __cplusplus extern "C" { #endif struct list_node { struct list_node *list_next; struct list_node *list_prev; }; struct list { size_t list_size; size_t list_offset; struct list_node list_head; }; #ifdef __cplusplus } #endif #endif /* _SYS_LIST_IMPL_H */ diff --git a/include/os/freebsd/spl/sys/zmod.h b/include/os/freebsd/spl/sys/zmod.h index ba0267203ce3..c606b1db5f61 100644 --- a/include/os/freebsd/spl/sys/zmod.h +++ b/include/os/freebsd/spl/sys/zmod.h @@ -1,68 +1,66 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _ZMOD_H #define _ZMOD_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif /* * zmod - RFC-1950-compatible decompression routines * * This file provides the public interfaces to zmod, an in-kernel RFC 1950 * decompression library. More information about the implementation of these * interfaces can be found in the usr/src/uts/common/zmod/ directory. */ #define Z_OK 0 #define Z_STREAM_END 1 #define Z_NEED_DICT 2 #define Z_ERRNO (-1) #define Z_STREAM_ERROR (-2) #define Z_DATA_ERROR (-3) #define Z_MEM_ERROR (-4) #define Z_BUF_ERROR (-5) #define Z_VERSION_ERROR (-6) #define Z_NO_COMPRESSION 0 #define Z_BEST_SPEED 1 #define Z_BEST_COMPRESSION 9 #define Z_DEFAULT_COMPRESSION (-1) extern int z_uncompress(void *, size_t *, const void *, size_t); extern int z_compress(void *, size_t *, const void *, size_t); extern int z_compress_level(void *, size_t *, const void *, size_t, int); extern const char *z_strerror(int); #ifdef __cplusplus } #endif #endif /* _ZMOD_H */ diff --git a/module/os/freebsd/spl/list.c b/module/os/freebsd/spl/list.c index 21230b2adddb..8796be4a98fb 100644 --- a/module/os/freebsd/spl/list.c +++ b/module/os/freebsd/spl/list.c @@ -1,246 +1,244 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Generic doubly-linked list implementation */ #include #include #include #include #include #define list_d2l(a, obj) ((list_node_t *)(((char *)obj) + (a)->list_offset)) #define list_object(a, node) ((void *)(((char *)node) - (a)->list_offset)) #define list_empty(a) ((a)->list_head.list_next == &(a)->list_head) #define list_insert_after_node(list, node, object) { \ list_node_t *lnew = list_d2l(list, object); \ lnew->list_prev = (node); \ lnew->list_next = (node)->list_next; \ (node)->list_next->list_prev = lnew; \ (node)->list_next = lnew; \ } #define list_insert_before_node(list, node, object) { \ list_node_t *lnew = list_d2l(list, object); \ lnew->list_next = (node); \ lnew->list_prev = (node)->list_prev; \ (node)->list_prev->list_next = lnew; \ (node)->list_prev = lnew; \ } #define list_remove_node(node) \ (node)->list_prev->list_next = (node)->list_next; \ (node)->list_next->list_prev = (node)->list_prev; \ (node)->list_next = (node)->list_prev = NULL void list_create(list_t *list, size_t size, size_t offset) { ASSERT(list); ASSERT(size > 0); ASSERT(size >= offset + sizeof (list_node_t)); list->list_size = size; list->list_offset = offset; list->list_head.list_next = list->list_head.list_prev = &list->list_head; } void list_destroy(list_t *list) { list_node_t *node = &list->list_head; ASSERT(list); ASSERT(list->list_head.list_next == node); ASSERT(list->list_head.list_prev == node); node->list_next = node->list_prev = NULL; } void list_insert_after(list_t *list, void *object, void *nobject) { if (object == NULL) { list_insert_head(list, nobject); } else { list_node_t *lold = list_d2l(list, object); list_insert_after_node(list, lold, nobject); } } void list_insert_before(list_t *list, void *object, void *nobject) { if (object == NULL) { list_insert_tail(list, nobject); } else { list_node_t *lold = list_d2l(list, object); list_insert_before_node(list, lold, nobject); } } void list_insert_head(list_t *list, void *object) { list_node_t *lold = &list->list_head; list_insert_after_node(list, lold, object); } void list_insert_tail(list_t *list, void *object) { list_node_t *lold = &list->list_head; list_insert_before_node(list, lold, object); } void list_remove(list_t *list, void *object) { list_node_t *lold = list_d2l(list, object); ASSERT(!list_empty(list)); ASSERT(lold->list_next != NULL); list_remove_node(lold); } void * list_remove_head(list_t *list) { list_node_t *head = list->list_head.list_next; if (head == &list->list_head) return (NULL); list_remove_node(head); return (list_object(list, head)); } void * list_remove_tail(list_t *list) { list_node_t *tail = list->list_head.list_prev; if (tail == &list->list_head) return (NULL); list_remove_node(tail); return (list_object(list, tail)); } void * list_head(list_t *list) { if (list_empty(list)) return (NULL); return (list_object(list, list->list_head.list_next)); } void * list_tail(list_t *list) { if (list_empty(list)) return (NULL); return (list_object(list, list->list_head.list_prev)); } void * list_next(list_t *list, void *object) { list_node_t *node = list_d2l(list, object); if (node->list_next != &list->list_head) return (list_object(list, node->list_next)); return (NULL); } void * list_prev(list_t *list, void *object) { list_node_t *node = list_d2l(list, object); if (node->list_prev != &list->list_head) return (list_object(list, node->list_prev)); return (NULL); } /* * Insert src list after dst list. Empty src list thereafter. */ void list_move_tail(list_t *dst, list_t *src) { list_node_t *dstnode = &dst->list_head; list_node_t *srcnode = &src->list_head; ASSERT(dst->list_size == src->list_size); ASSERT(dst->list_offset == src->list_offset); if (list_empty(src)) return; dstnode->list_prev->list_next = srcnode->list_next; srcnode->list_next->list_prev = dstnode->list_prev; dstnode->list_prev = srcnode->list_prev; srcnode->list_prev->list_next = dstnode; /* empty src list */ srcnode->list_next = srcnode->list_prev = srcnode; } void list_link_replace(list_node_t *lold, list_node_t *lnew) { ASSERT(list_link_active(lold)); ASSERT(!list_link_active(lnew)); lnew->list_next = lold->list_next; lnew->list_prev = lold->list_prev; lold->list_prev->list_next = lnew; lold->list_next->list_prev = lnew; lold->list_next = lold->list_prev = NULL; } void list_link_init(list_node_t *link) { link->list_next = NULL; link->list_prev = NULL; } int list_link_active(list_node_t *link) { EQUIV(link->list_next == NULL, link->list_prev == NULL); return (link->list_next != NULL); } int list_is_empty(list_t *list) { return (list_empty(list)); }