~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/dqblk_qtree.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  *      Definitions of structures and functions for quota formats using trie
  4  */
  5 
  6 #ifndef _LINUX_DQBLK_QTREE_H
  7 #define _LINUX_DQBLK_QTREE_H
  8 
  9 #include <linux/types.h>
 10 
 11 /* Numbers of blocks needed for updates - we count with the smallest
 12  * possible block size (1024) */
 13 #define QTREE_INIT_ALLOC 4
 14 #define QTREE_INIT_REWRITE 2
 15 #define QTREE_DEL_ALLOC 0
 16 #define QTREE_DEL_REWRITE 6
 17 
 18 struct dquot;
 19 struct kqid;
 20 
 21 /* Operations */
 22 struct qtree_fmt_operations {
 23         void (*mem2disk_dqblk)(void *disk, struct dquot *dquot);        /* Convert given entry from in memory format to disk one */
 24         void (*disk2mem_dqblk)(struct dquot *dquot, void *disk);        /* Convert given entry from disk format to in memory one */
 25         int (*is_id)(void *disk, struct dquot *dquot);  /* Is this structure for given id? */
 26 };
 27 
 28 /* Inmemory copy of version specific information */
 29 struct qtree_mem_dqinfo {
 30         struct super_block *dqi_sb;     /* Sb quota is on */
 31         int dqi_type;                   /* Quota type */
 32         unsigned int dqi_blocks;        /* # of blocks in quota file */
 33         unsigned int dqi_free_blk;      /* First block in list of free blocks */
 34         unsigned int dqi_free_entry;    /* First block with free entry */
 35         unsigned int dqi_blocksize_bits;        /* Block size of quota file */
 36         unsigned int dqi_entry_size;    /* Size of quota entry in quota file */
 37         unsigned int dqi_usable_bs;     /* Space usable in block for quota data */
 38         unsigned int dqi_qtree_depth;   /* Precomputed depth of quota tree */
 39         const struct qtree_fmt_operations *dqi_ops; /* Operations for entry manipulation */
 40 };
 41 
 42 int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
 43 int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
 44 int qtree_delete_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
 45 int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
 46 int qtree_entry_unused(struct qtree_mem_dqinfo *info, char *disk);
 47 static inline int qtree_depth(struct qtree_mem_dqinfo *info)
 48 {
 49         unsigned int epb = info->dqi_usable_bs >> 2;
 50         unsigned long long entries = epb;
 51         int i;
 52 
 53         for (i = 1; entries < (1ULL << 32); i++)
 54                 entries *= epb;
 55         return i;
 56 }
 57 int qtree_get_next_id(struct qtree_mem_dqinfo *info, struct kqid *qid);
 58 
 59 #endif /* _LINUX_DQBLK_QTREE_H */
 60 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php