LCOV - code coverage report
Current view: top level - fs/xfs/libxfs - xfs_attr_sf.h (source / functions) Hit Total Coverage
Test: fstests of 6.5.0-rc4-xfsx @ Mon Jul 31 20:08:34 PDT 2023 Lines: 3 3 100.0 %
Date: 2023-07-31 20:08:34 Functions: 0 0 -

          Line data    Source code
       1             : /* SPDX-License-Identifier: GPL-2.0 */
       2             : /*
       3             :  * Copyright (c) 2000,2002,2005 Silicon Graphics, Inc.
       4             :  * All Rights Reserved.
       5             :  */
       6             : #ifndef __XFS_ATTR_SF_H__
       7             : #define __XFS_ATTR_SF_H__
       8             : 
       9             : /*
      10             :  * Attribute storage when stored inside the inode.
      11             :  *
      12             :  * Small attribute lists are packed as tightly as possible so as
      13             :  * to fit into the literal area of the inode.
      14             :  */
      15             : typedef struct xfs_attr_sf_hdr xfs_attr_sf_hdr_t;
      16             : 
      17             : /*
      18             :  * We generate this then sort it, attr_list() must return things in hash-order.
      19             :  */
      20             : typedef struct xfs_attr_sf_sort {
      21             :         uint8_t         entno;          /* entry number in original list */
      22             :         uint8_t         namelen;        /* length of name value (no null) */
      23             :         uint8_t         valuelen;       /* length of value */
      24             :         uint8_t         flags;          /* flags bits (see xfs_attr_leaf.h) */
      25             :         xfs_dahash_t    hash;           /* this entry's hash value */
      26             :         unsigned char   *name;          /* name value, pointer into buffer */
      27             :         void            *value;
      28             : } xfs_attr_sf_sort_t;
      29             : 
      30             : #define XFS_ATTR_SF_ENTSIZE_MAX                 /* max space for name&value */ \
      31             :         ((1 << (NBBY*(int)sizeof(uint8_t))) - 1)
      32             : 
      33             : /* space name/value uses */
      34             : static inline int xfs_attr_sf_entsize_byname(uint8_t nlen, uint8_t vlen)
      35             : {
      36  2062144830 :         return sizeof(struct xfs_attr_sf_entry) + nlen + vlen;
      37             : }
      38             : 
      39             : /* space an entry uses */
      40             : static inline int xfs_attr_sf_entsize(struct xfs_attr_sf_entry *sfep)
      41             : {
      42 10081720848 :         return struct_size(sfep, nameval, sfep->namelen + sfep->valuelen);
      43             : }
      44             : 
      45             : /* next entry in struct */
      46             : static inline struct xfs_attr_sf_entry *
      47             : xfs_attr_sf_nextentry(struct xfs_attr_sf_entry *sfep)
      48             : {
      49 10958049230 :         return (void *)sfep + xfs_attr_sf_entsize(sfep);
      50             : }
      51             : 
      52             : #endif  /* __XFS_ATTR_SF_H__ */

Generated by: LCOV version 1.14