Android-cuttlefish cvd tool
Classes | Macros | Typedefs | Enumerations | Functions | Variables
quotaio.h File Reference
#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "dict.h"
#include "f2fs_fs.h"
#include "f2fs.h"
#include "node.h"
#include "fsck.h"
#include "dqblk_v2.h"
Include dependency graph for quotaio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  quota_ctx
 
struct  util_dqinfo
 
struct  quota_file
 
struct  quota_handle
 
struct  util_dqblk
 
struct  dquot
 
struct  quotafile_ops
 

Macros

#define QUOTA_USR_BIT   (1 << USRQUOTA)
 
#define QUOTA_GRP_BIT   (1 << GRPQUOTA)
 
#define QUOTA_PRJ_BIT   (1 << PRJQUOTA)
 
#define QUOTA_ALL_BIT   (QUOTA_USR_BIT | QUOTA_GRP_BIT | QUOTA_PRJ_BIT)
 
#define INITQMAGICS
 
#define QUOTABLOCK_BITS   10
 
#define QUOTABLOCK_SIZE   (1 << QUOTABLOCK_BITS)
 
#define toqb(x)   (((x) + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS)
 
#define QFMT_VFS_OLD   1
 
#define QFMT_VFS_V0   2
 
#define QFMT_VFS_V1   4
 
#define MAX_IQ_TIME   604800 /* (7*24*60*60) 1 week */
 
#define MAX_DQ_TIME   604800 /* (7*24*60*60) 1 week */
 
#define IOFL_INFODIRTY   0x01 /* Did info change? */
 
#define DQF_SEEN   0x0001
 
#define __bitwise
 
#define __force
 

Typedefs

typedef int64_t qsize_t
 
typedef int32_t f2fs_ino_t
 
typedef int errcode_t
 
typedef struct quota_ctxquota_ctx_t
 

Enumerations

enum  quota_type {
  USRQUOTA = 0 , GRPQUOTA = 1 , PRJQUOTA = 2 , MAXQUOTAS = 3 ,
  USRQUOTA = 0 , GRPQUOTA = 1 , PRJQUOTA = 2 , MAXQUOTAS = 3
}
 
enum  qf_szchk_type_t { QF_SZCHK_NONE , QF_SZCHK_ERR , QF_SZCHK_INLINE , QF_SZCHK_REGFILE }
 

Functions

errcode_t quota_file_open (struct f2fs_sb_info *sbi, struct quota_handle *h, enum quota_type qtype, int flags)
 
errcode_t quota_file_create (struct f2fs_sb_info *sbi, struct quota_handle *h, enum quota_type qtype)
 
errcode_t quota_file_close (struct f2fs_sb_info *sbi, struct quota_handle *h, int update_filesize)
 
struct dquotget_empty_dquot (void)
 
const char * quota_type2name (enum quota_type qtype)
 
void update_grace_times (struct dquot *q)
 
errcode_t quota_init_context (struct f2fs_sb_info *sbi)
 
void quota_data_inodes (quota_ctx_t qctx, struct f2fs_inode *inode, int adjust)
 
void quota_data_add (quota_ctx_t qctx, struct f2fs_inode *inode, qsize_t space)
 
void quota_data_sub (quota_ctx_t qctx, struct f2fs_inode *inode, qsize_t space)
 
errcode_t quota_write_inode (struct f2fs_sb_info *sbi, enum quota_type qtype)
 
void quota_add_inode_usage (quota_ctx_t qctx, f2fs_ino_t ino, struct f2fs_inode *inode)
 
void quota_release_context (quota_ctx_t *qctx)
 
errcode_t quota_compare_and_update (struct f2fs_sb_info *sbi, enum quota_type qtype, int *usage_inconsistent, int preserve_limits)
 
static errcode_t quota_get_mem (unsigned long size, void *ptr)
 
static errcode_t quota_get_memzero (unsigned long size, void *ptr)
 
static errcode_t quota_free_mem (void *ptr)
 

Variables

int cur_qtype
 
u32 qf_last_blkofs []
 
enum qf_szchk_type_t qf_szchk_type []
 
u64 qf_maxsize []
 

Macro Definition Documentation

◆ __bitwise

#define __bitwise

◆ __force

#define __force

◆ DQF_SEEN

#define DQF_SEEN   0x0001

◆ INITQMAGICS

#define INITQMAGICS
Value:
{\
0xd9c01f11, /* USRQUOTA */\
0xd9c01927, /* GRPQUOTA */\
0xd9c03f14 /* PRJQUOTA */\
}

◆ IOFL_INFODIRTY

#define IOFL_INFODIRTY   0x01 /* Did info change? */

◆ MAX_DQ_TIME

#define MAX_DQ_TIME   604800 /* (7*24*60*60) 1 week */

◆ MAX_IQ_TIME

#define MAX_IQ_TIME   604800 /* (7*24*60*60) 1 week */

◆ QFMT_VFS_OLD

#define QFMT_VFS_OLD   1

◆ QFMT_VFS_V0

#define QFMT_VFS_V0   2

◆ QFMT_VFS_V1

#define QFMT_VFS_V1   4

◆ QUOTA_ALL_BIT

#define QUOTA_ALL_BIT   (QUOTA_USR_BIT | QUOTA_GRP_BIT | QUOTA_PRJ_BIT)

◆ QUOTA_GRP_BIT

#define QUOTA_GRP_BIT   (1 << GRPQUOTA)

◆ QUOTA_PRJ_BIT

#define QUOTA_PRJ_BIT   (1 << PRJQUOTA)

◆ QUOTA_USR_BIT

#define QUOTA_USR_BIT   (1 << USRQUOTA)

◆ QUOTABLOCK_BITS

#define QUOTABLOCK_BITS   10

◆ QUOTABLOCK_SIZE

#define QUOTABLOCK_SIZE   (1 << QUOTABLOCK_BITS)

◆ toqb

#define toqb (   x)    (((x) + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS)

Typedef Documentation

◆ errcode_t

typedef int errcode_t

◆ f2fs_ino_t

typedef int32_t f2fs_ino_t

◆ qsize_t

typedef int64_t qsize_t

quotaio.h

Interface to the quota library.

The quota library provides interface for creating and updating the quota files and the ext4 superblock fields. It supports the new VFS_V1 quota format. The quota library also provides support for keeping track of quotas in memory.

Aditya Kali adity.nosp@m.akal.nosp@m.i@goo.nosp@m.gle..nosp@m.com Header of IO operations for quota utilities

Jan Kara jack@.nosp@m.suse.nosp@m..cz

Hyojun Kim hyoju.nosp@m.n@go.nosp@m.ogle..nosp@m.com - Ported to f2fs-tools

◆ quota_ctx_t

typedef struct quota_ctx* quota_ctx_t

Enumeration Type Documentation

◆ qf_szchk_type_t

Enumerator
QF_SZCHK_NONE 
QF_SZCHK_ERR 
QF_SZCHK_INLINE 
QF_SZCHK_REGFILE 

◆ quota_type

enum quota_type
Enumerator
USRQUOTA 
GRPQUOTA 
PRJQUOTA 
MAXQUOTAS 
USRQUOTA 
GRPQUOTA 
PRJQUOTA 
MAXQUOTAS 

Function Documentation

◆ get_empty_dquot()

struct dquot * get_empty_dquot ( void  )

◆ quota_add_inode_usage()

void quota_add_inode_usage ( quota_ctx_t  qctx,
f2fs_ino_t  ino,
struct f2fs_inode inode 
)

◆ quota_compare_and_update()

errcode_t quota_compare_and_update ( struct f2fs_sb_info sbi,
enum quota_type  qtype,
int *  usage_inconsistent,
int  preserve_limits 
)

◆ quota_data_add()

void quota_data_add ( quota_ctx_t  qctx,
struct f2fs_inode inode,
qsize_t  space 
)

◆ quota_data_inodes()

void quota_data_inodes ( quota_ctx_t  qctx,
struct f2fs_inode inode,
int  adjust 
)

◆ quota_data_sub()

void quota_data_sub ( quota_ctx_t  qctx,
struct f2fs_inode inode,
qsize_t  space 
)

◆ quota_file_close()

errcode_t quota_file_close ( struct f2fs_sb_info sbi,
struct quota_handle h,
int  update_filesize 
)

◆ quota_file_create()

errcode_t quota_file_create ( struct f2fs_sb_info sbi,
struct quota_handle h,
enum quota_type  qtype 
)

◆ quota_file_open()

errcode_t quota_file_open ( struct f2fs_sb_info sbi,
struct quota_handle h,
enum quota_type  qtype,
int  flags 
)

◆ quota_free_mem()

static errcode_t quota_free_mem ( void *  ptr)
inlinestatic

◆ quota_get_mem()

static errcode_t quota_get_mem ( unsigned long  size,
void *  ptr 
)
inlinestatic

◆ quota_get_memzero()

static errcode_t quota_get_memzero ( unsigned long  size,
void *  ptr 
)
inlinestatic

◆ quota_init_context()

errcode_t quota_init_context ( struct f2fs_sb_info sbi)

◆ quota_release_context()

void quota_release_context ( quota_ctx_t qctx)

◆ quota_type2name()

const char * quota_type2name ( enum quota_type  qtype)

Convert type of quota to written representation

◆ quota_write_inode()

errcode_t quota_write_inode ( struct f2fs_sb_info sbi,
enum quota_type  qtype 
)

◆ update_grace_times()

void update_grace_times ( struct dquot q)

Variable Documentation

◆ cur_qtype

int cur_qtype
extern

◆ qf_last_blkofs

u32 qf_last_blkofs[]
extern

◆ qf_maxsize

u64 qf_maxsize[]
extern

◆ qf_szchk_type

enum qf_szchk_type_t qf_szchk_type[]
extern