The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/openzfs/include/sys/zfs_project.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * CDDL HEADER START
    3  *
    4  * The contents of this file are subject to the terms of the
    5  * Common Development and Distribution License (the "License").
    6  * You may not use this file except in compliance with the License.
    7  *
    8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
    9  * or https://opensource.org/licenses/CDDL-1.0.
   10  * See the License for the specific language governing permissions
   11  * and limitations under the License.
   12  *
   13  * When distributing Covered Code, include this CDDL HEADER in each
   14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
   15  * If applicable, add the following below this CDDL HEADER, with the
   16  * fields enclosed by brackets "[]" replaced with your own identifying
   17  * information: Portions Copyright [yyyy] [name of copyright owner]
   18  *
   19  * CDDL HEADER END
   20  */
   21 /*
   22  * Copyright (c) 2017, Intel Corporation. All rights reserved.
   23  */
   24 
   25 #ifndef _SYS_ZFS_PROJECT_H
   26 #define _SYS_ZFS_PROJECT_H
   27 
   28 #ifndef _KERNEL
   29 #ifndef _SYS_MOUNT_H
   30 /* XXX: some hack to avoid include sys/mount.h */
   31 #define _SYS_MOUNT_H
   32 #endif
   33 #endif
   34 
   35 #include <sys/vfs.h>
   36 
   37 #ifdef FS_PROJINHERIT_FL
   38 #define ZFS_PROJINHERIT_FL      FS_PROJINHERIT_FL
   39 #else
   40 #define ZFS_PROJINHERIT_FL      0x20000000
   41 #endif
   42 
   43 #ifdef FS_IOC_FSGETXATTR
   44 typedef struct fsxattr zfsxattr_t;
   45 
   46 #define ZFS_IOC_FSGETXATTR      FS_IOC_FSGETXATTR
   47 #define ZFS_IOC_FSSETXATTR      FS_IOC_FSSETXATTR
   48 #else
   49 struct zfsxattr {
   50         uint32_t        fsx_xflags;     /* xflags field value (get/set) */
   51         uint32_t        fsx_extsize;    /* extsize field value (get/set) */
   52         uint32_t        fsx_nextents;   /* nextents field value (get)   */
   53         uint32_t        fsx_projid;     /* project identifier (get/set) */
   54         uint32_t        fsx_cowextsize;
   55         unsigned char   fsx_pad[8];
   56 };
   57 typedef struct zfsxattr zfsxattr_t;
   58 
   59 #define ZFS_IOC_FSGETXATTR      _IOR('X', 31, zfsxattr_t)
   60 #define ZFS_IOC_FSSETXATTR      _IOW('X', 32, zfsxattr_t)
   61 #endif
   62 
   63 #define ZFS_DEFAULT_PROJID      (0ULL)
   64 /*
   65  * It is NOT ondisk project ID value. Just means either the object has
   66  * no project ID or the operation does not touch project ID attribute.
   67  */
   68 #define ZFS_INVALID_PROJID      (-1ULL)
   69 
   70 static inline boolean_t
   71 zpl_is_valid_projid(uint32_t projid)
   72 {
   73         /*
   74          * zfsxattr::fsx_projid is 32-bits, when convert to uint64_t,
   75          * the higher 32-bits will be set as zero, so cannot directly
   76          * compare with ZFS_INVALID_PROJID (-1ULL)
   77          */
   78         if ((uint32_t)ZFS_INVALID_PROJID == projid)
   79                 return (B_FALSE);
   80         return (B_TRUE);
   81 }
   82 
   83 #endif  /* _SYS_ZFS_PROJECT_H */

Cache object: ae3ab9986d1fdb99cfaeab1ad991dcd0


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.