| libxfs.h | | libxfs.h | |
| | | | |
| skipping to change at line 28 | | skipping to change at line 28 | |
| | | | |
| #ifndef __LIBXFS_H__ | | #ifndef __LIBXFS_H__ | |
| #define __LIBXFS_H__ | | #define __LIBXFS_H__ | |
| | | | |
| #define XFS_BIG_INUMS 1 | | #define XFS_BIG_INUMS 1 | |
| #define XFS_BIG_BLKNOS 1 | | #define XFS_BIG_BLKNOS 1 | |
| | | | |
| #include <xfs/platform_defs.h> | | #include <xfs/platform_defs.h> | |
| | | | |
| #include <xfs/list.h> | | #include <xfs/list.h> | |
|
| | | #include <xfs/hlist.h> | |
| #include <xfs/cache.h> | | #include <xfs/cache.h> | |
| #include <xfs/bitops.h> | | #include <xfs/bitops.h> | |
| #include <xfs/kmem.h> | | #include <xfs/kmem.h> | |
|
| | | #include <xfs/radix-tree.h> | |
| #include <xfs/swab.h> | | #include <xfs/swab.h> | |
|
| | | #include <xfs/atomic.h> | |
| | | | |
| #include <xfs/xfs_fs.h> | | #include <xfs/xfs_fs.h> | |
| #include <xfs/xfs_types.h> | | #include <xfs/xfs_types.h> | |
| #include <xfs/xfs_arch.h> | | #include <xfs/xfs_arch.h> | |
| #include <xfs/xfs_bit.h> | | #include <xfs/xfs_bit.h> | |
| #include <xfs/xfs_inum.h> | | #include <xfs/xfs_inum.h> | |
| #include <xfs/xfs_sb.h> | | #include <xfs/xfs_sb.h> | |
| #include <xfs/xfs_ag.h> | | #include <xfs/xfs_ag.h> | |
| #include <xfs/xfs_dir2.h> | | #include <xfs/xfs_dir2.h> | |
| #include <xfs/xfs_mount.h> | | #include <xfs/xfs_mount.h> | |
| | | | |
| skipping to change at line 57 | | skipping to change at line 60 | |
| #include <xfs/xfs_dir2_sf.h> | | #include <xfs/xfs_dir2_sf.h> | |
| #include <xfs/xfs_attr_sf.h> | | #include <xfs/xfs_attr_sf.h> | |
| #include <xfs/xfs_dinode.h> | | #include <xfs/xfs_dinode.h> | |
| #include <xfs/xfs_inode.h> | | #include <xfs/xfs_inode.h> | |
| #include <xfs/xfs_buf_item.h> | | #include <xfs/xfs_buf_item.h> | |
| #include <xfs/xfs_inode_item.h> | | #include <xfs/xfs_inode_item.h> | |
| #include <xfs/xfs_alloc.h> | | #include <xfs/xfs_alloc.h> | |
| #include <xfs/xfs_btree.h> | | #include <xfs/xfs_btree.h> | |
| #include <xfs/xfs_btree_trace.h> | | #include <xfs/xfs_btree_trace.h> | |
| #include <xfs/xfs_bmap.h> | | #include <xfs/xfs_bmap.h> | |
|
| | | #include <xfs/xfs_trace.h> | |
| | | | |
| #ifndef ARRAY_SIZE | | #ifndef ARRAY_SIZE | |
| #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | |
| #endif | | #endif | |
| | | | |
| #ifndef XFS_SUPER_MAGIC | | #ifndef XFS_SUPER_MAGIC | |
| #define XFS_SUPER_MAGIC 0x58465342 | | #define XFS_SUPER_MAGIC 0x58465342 | |
| #endif | | #endif | |
| | | | |
| #define xfs_isset(a,i) ((a)[(i)/(sizeof((a))*NBBY)] & (1<<((i)%(sizeof((a))
*NBBY)))) | | #define xfs_isset(a,i) ((a)[(i)/(sizeof((a))*NBBY)] & (1<<((i)%(sizeof((a))
*NBBY)))) | |
| | | | |
|
| | | #define __round_mask(x, y) ((__typeof__(x))((y)-1)) | |
| | | #define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) | |
| | | #define round_down(x, y) ((x) & ~__round_mask(x, y)) | |
| | | | |
| /* | | /* | |
| * Argument structure for libxfs_init(). | | * Argument structure for libxfs_init(). | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| /* input parameters */ | | /* input parameters */ | |
| char *volname; /* pathname of volume */ | | char *volname; /* pathname of volume */ | |
| char *dname; /* pathname of data "subvolume" */ | | char *dname; /* pathname of data "subvolume" */ | |
| char *logname; /* pathname of log "subvolume" */ | | char *logname; /* pathname of log "subvolume" */ | |
| char *rtname; /* pathname of realtime "subvolume"
*/ | | char *rtname; /* pathname of realtime "subvolume"
*/ | |
| int isreadonly; /* filesystem is only read in applic
*/ | | int isreadonly; /* filesystem is only read in applic
*/ | |
| | | | |
| skipping to change at line 169 | | skipping to change at line 177 | |
| uint m_blockwmask; /* blockwsize-1 */ | | uint m_blockwmask; /* blockwsize-1 */ | |
| uint m_alloc_mxr[2]; /* XFS_ALLOC_BLOCK_MAXRECS *
/ | | uint m_alloc_mxr[2]; /* XFS_ALLOC_BLOCK_MAXRECS *
/ | |
| uint m_alloc_mnr[2]; /* XFS_ALLOC_BLOCK_MINRECS *
/ | | uint m_alloc_mnr[2]; /* XFS_ALLOC_BLOCK_MINRECS *
/ | |
| uint m_bmap_dmxr[2]; /* XFS_BMAP_BLOCK_DMAXRECS *
/ | | uint m_bmap_dmxr[2]; /* XFS_BMAP_BLOCK_DMAXRECS *
/ | |
| uint m_bmap_dmnr[2]; /* XFS_BMAP_BLOCK_DMINRECS *
/ | | uint m_bmap_dmnr[2]; /* XFS_BMAP_BLOCK_DMINRECS *
/ | |
| uint m_inobt_mxr[2]; /* XFS_INOBT_BLOCK_MAXRECS *
/ | | uint m_inobt_mxr[2]; /* XFS_INOBT_BLOCK_MAXRECS *
/ | |
| uint m_inobt_mnr[2]; /* XFS_INOBT_BLOCK_MINRECS *
/ | | uint m_inobt_mnr[2]; /* XFS_INOBT_BLOCK_MINRECS *
/ | |
| uint m_ag_maxlevels; /* XFS_AG_MAXLEVELS */ | | uint m_ag_maxlevels; /* XFS_AG_MAXLEVELS */ | |
| uint m_bm_maxlevels[2]; /* XFS_BM_MAXLEVELS */ | | uint m_bm_maxlevels[2]; /* XFS_BM_MAXLEVELS */ | |
| uint m_in_maxlevels; /* XFS_IN_MAXLEVELS */ | | uint m_in_maxlevels; /* XFS_IN_MAXLEVELS */ | |
|
| xfs_perag_t *m_perag; /* per-ag accounting info */ | | struct radix_tree_root m_perag_tree; | |
| uint m_flags; /* global mount flags */ | | uint m_flags; /* global mount flags */ | |
| uint m_qflags; /* quota status flags */ | | uint m_qflags; /* quota status flags */ | |
| uint m_attroffset; /* inode attribute offset */ | | uint m_attroffset; /* inode attribute offset */ | |
| uint m_dir_node_ents; /* #entries in a dir danode
*/ | | uint m_dir_node_ents; /* #entries in a dir danode
*/ | |
| uint m_attr_node_ents; /* #entries in attr danode
*/ | | uint m_attr_node_ents; /* #entries in attr danode
*/ | |
| int m_ialloc_inos; /* inodes in inode allocatio
n */ | | int m_ialloc_inos; /* inodes in inode allocatio
n */ | |
| int m_ialloc_blks; /* blocks in inode allocatio
n */ | | int m_ialloc_blks; /* blocks in inode allocatio
n */ | |
| int m_litino; /* size of inode union area
*/ | | int m_litino; /* size of inode union area
*/ | |
| int m_inoalign_mask;/* mask sb_inoalignmt if use
d */ | | int m_inoalign_mask;/* mask sb_inoalignmt if use
d */ | |
| xfs_trans_reservations_t m_reservations;/* precomputed res values */ | | xfs_trans_reservations_t m_reservations;/* precomputed res values */ | |
| | | | |
| skipping to change at line 223 | | skipping to change at line 231 | |
| struct cache_node b_node; | | struct cache_node b_node; | |
| unsigned int b_flags; | | unsigned int b_flags; | |
| xfs_daddr_t b_blkno; | | xfs_daddr_t b_blkno; | |
| unsigned b_bcount; | | unsigned b_bcount; | |
| dev_t b_dev; | | dev_t b_dev; | |
| pthread_mutex_t b_lock; | | pthread_mutex_t b_lock; | |
| void *b_fsprivate; | | void *b_fsprivate; | |
| void *b_fsprivate2; | | void *b_fsprivate2; | |
| void *b_fsprivate3; | | void *b_fsprivate3; | |
| char *b_addr; | | char *b_addr; | |
|
| | | int b_error; | |
| #ifdef XFS_BUF_TRACING | | #ifdef XFS_BUF_TRACING | |
| struct list_head b_lock_list; | | struct list_head b_lock_list; | |
| const char *b_func; | | const char *b_func; | |
| const char *b_file; | | const char *b_file; | |
| int b_line; | | int b_line; | |
| #endif | | #endif | |
| } xfs_buf_t; | | } xfs_buf_t; | |
| | | | |
| enum xfs_buf_flags_t { /* b_flags bits */ | | enum xfs_buf_flags_t { /* b_flags bits */ | |
| LIBXFS_B_EXIT = 0x0001, /* ==LIBXFS_EXIT_ON_FAILURE
*/ | | LIBXFS_B_EXIT = 0x0001, /* ==LIBXFS_EXIT_ON_FAILURE
*/ | |
| | | | |
| skipping to change at line 244 | | skipping to change at line 253 | |
| LIBXFS_B_STALE = 0x0004, /* buffer marked as invalid
*/ | | LIBXFS_B_STALE = 0x0004, /* buffer marked as invalid
*/ | |
| LIBXFS_B_UPTODATE = 0x0008 /* buffer is sync'd to disk
*/ | | LIBXFS_B_UPTODATE = 0x0008 /* buffer is sync'd to disk
*/ | |
| }; | | }; | |
| | | | |
| #define XFS_BUF_PTR(bp) ((bp)->b_addr) | | #define XFS_BUF_PTR(bp) ((bp)->b_addr) | |
| #define xfs_buf_offset(bp, offset) (XFS_BUF_PTR(bp) + (offset)) | | #define xfs_buf_offset(bp, offset) (XFS_BUF_PTR(bp) + (offset)) | |
| #define XFS_BUF_ADDR(bp) ((bp)->b_blkno) | | #define XFS_BUF_ADDR(bp) ((bp)->b_blkno) | |
| #define XFS_BUF_SIZE(bp) ((bp)->b_bcount) | | #define XFS_BUF_SIZE(bp) ((bp)->b_bcount) | |
| #define XFS_BUF_COUNT(bp) ((bp)->b_bcount) | | #define XFS_BUF_COUNT(bp) ((bp)->b_bcount) | |
| #define XFS_BUF_TARGET(bp) ((bp)->b_dev) | | #define XFS_BUF_TARGET(bp) ((bp)->b_dev) | |
|
| #define XFS_BUF_SET_PTR(bp,p,cnt) ((bp)->b_addr = (char *)(p)); \ | | #define XFS_BUF_SET_PTR(bp,p,cnt) ({ \ | |
| XFS_BUF_SET_COUNT(bp,cnt) | | (bp)->b_addr = (char *)(p); \ | |
| | | XFS_BUF_SET_COUNT(bp,cnt); \ | |
| | | }) | |
| | | | |
| #define XFS_BUF_SET_ADDR(bp,blk) ((bp)->b_blkno = (blk)) | | #define XFS_BUF_SET_ADDR(bp,blk) ((bp)->b_blkno = (blk)) | |
| #define XFS_BUF_SET_COUNT(bp,cnt) ((bp)->b_bcount = (cnt)) | | #define XFS_BUF_SET_COUNT(bp,cnt) ((bp)->b_bcount = (cnt)) | |
| | | | |
| #define XFS_BUF_FSPRIVATE(bp,type) ((type)(bp)->b_fsprivate) | | #define XFS_BUF_FSPRIVATE(bp,type) ((type)(bp)->b_fsprivate) | |
| #define XFS_BUF_SET_FSPRIVATE(bp,val) (bp)->b_fsprivate = (void *)(val) | | #define XFS_BUF_SET_FSPRIVATE(bp,val) (bp)->b_fsprivate = (void *)(val) | |
| #define XFS_BUF_FSPRIVATE2(bp,type) ((type)(bp)->b_fsprivate2) | | #define XFS_BUF_FSPRIVATE2(bp,type) ((type)(bp)->b_fsprivate2) | |
| #define XFS_BUF_SET_FSPRIVATE2(bp,val) (bp)->b_fsprivate2 = (void *)(val) | | #define XFS_BUF_SET_FSPRIVATE2(bp,val) (bp)->b_fsprivate2 = (void *)(val) | |
| #define XFS_BUF_FSPRIVATE3(bp,type) ((type)(bp)->b_fsprivate3) | | #define XFS_BUF_FSPRIVATE3(bp,type) ((type)(bp)->b_fsprivate3) | |
| #define XFS_BUF_SET_FSPRIVATE3(bp,val) (bp)->b_fsprivate3 = (void *)(val) | | #define XFS_BUF_SET_FSPRIVATE3(bp,val) (bp)->b_fsprivate3 = (void *)(val) | |
| | | | |
| | | | |
| skipping to change at line 332 | | skipping to change at line 344 | |
| struct xfs_mount *li_mountp; /* ptr to fs mount *
/ | | struct xfs_mount *li_mountp; /* ptr to fs mount *
/ | |
| uint li_type; /* item type */ | | uint li_type; /* item type */ | |
| } xfs_log_item_t; | | } xfs_log_item_t; | |
| | | | |
| typedef struct xfs_inode_log_item { | | typedef struct xfs_inode_log_item { | |
| xfs_log_item_t ili_item; /* common portion */ | | xfs_log_item_t ili_item; /* common portion */ | |
| struct xfs_inode *ili_inode; /* inode pointer */ | | struct xfs_inode *ili_inode; /* inode pointer */ | |
| unsigned short ili_flags; /* misc flags */ | | unsigned short ili_flags; /* misc flags */ | |
| unsigned int ili_last_fields; /* fields when flush
ed*/ | | unsigned int ili_last_fields; /* fields when flush
ed*/ | |
| xfs_inode_log_format_t ili_format; /* logged structure
*/ | | xfs_inode_log_format_t ili_format; /* logged structure
*/ | |
|
| | | int ili_lock_flags; | |
| } xfs_inode_log_item_t; | | } xfs_inode_log_item_t; | |
| | | | |
| typedef struct xfs_buf_log_item { | | typedef struct xfs_buf_log_item { | |
| xfs_log_item_t bli_item; /* common item structure */ | | xfs_log_item_t bli_item; /* common item structure */ | |
| struct xfs_buf *bli_buf; /* real buffer pointer */ | | struct xfs_buf *bli_buf; /* real buffer pointer */ | |
| unsigned int bli_flags; /* misc flags */ | | unsigned int bli_flags; /* misc flags */ | |
| unsigned int bli_recur; /* recursion count */ | | unsigned int bli_recur; /* recursion count */ | |
| xfs_buf_log_format_t bli_format; /* in-log header */ | | xfs_buf_log_format_t bli_format; /* in-log header */ | |
| } xfs_buf_log_item_t; | | } xfs_buf_log_item_t; | |
| | | | |
| | | | |
| skipping to change at line 354 | | skipping to change at line 367 | |
| typedef struct xfs_trans { | | typedef struct xfs_trans { | |
| unsigned int t_type; /* transaction type */ | | unsigned int t_type; /* transaction type */ | |
| unsigned int t_log_res; /* amt of log space resvd */ | | unsigned int t_log_res; /* amt of log space resvd */ | |
| unsigned int t_log_count; /* count for perm log res */ | | unsigned int t_log_count; /* count for perm log res */ | |
| xfs_mount_t *t_mountp; /* ptr to fs mount struct */ | | xfs_mount_t *t_mountp; /* ptr to fs mount struct */ | |
| unsigned int t_flags; /* misc flags */ | | unsigned int t_flags; /* misc flags */ | |
| long t_icount_delta; /* superblock icount change
*/ | | long t_icount_delta; /* superblock icount change
*/ | |
| long t_ifree_delta; /* superblock ifree change *
/ | | long t_ifree_delta; /* superblock ifree change *
/ | |
| long t_fdblocks_delta; /* superblock fdblocks chg *
/ | | long t_fdblocks_delta; /* superblock fdblocks chg *
/ | |
| long t_frextents_delta; /* superblock freextents chg
*/ | | long t_frextents_delta; /* superblock freextents chg
*/ | |
|
| unsigned int t_items_free; /* log item descs free */ | | struct list_head t_items; /* first log item desc chunk | |
| xfs_log_item_chunk_t t_items; /* first log item desc chunk | | */ | |
| */ | | | |
| } xfs_trans_t; | | } xfs_trans_t; | |
| | | | |
| extern xfs_trans_t *libxfs_trans_alloc (xfs_mount_t *, int); | | extern xfs_trans_t *libxfs_trans_alloc (xfs_mount_t *, int); | |
| extern xfs_trans_t *libxfs_trans_dup (xfs_trans_t *); | | extern xfs_trans_t *libxfs_trans_dup (xfs_trans_t *); | |
| extern int libxfs_trans_reserve (xfs_trans_t *, uint,uint,uint,uint,uin
t); | | extern int libxfs_trans_reserve (xfs_trans_t *, uint,uint,uint,uint,uin
t); | |
| extern int libxfs_trans_commit (xfs_trans_t *, uint); | | extern int libxfs_trans_commit (xfs_trans_t *, uint); | |
| extern void libxfs_trans_cancel (xfs_trans_t *, int); | | extern void libxfs_trans_cancel (xfs_trans_t *, int); | |
| extern void libxfs_mod_sb (xfs_trans_t *, __int64_t); | | extern void libxfs_mod_sb (xfs_trans_t *, __int64_t); | |
| extern xfs_buf_t *libxfs_trans_getsb (xfs_trans_t *, xfs_mount_t *, i
nt); | | extern xfs_buf_t *libxfs_trans_getsb (xfs_trans_t *, xfs_mount_t *, i
nt); | |
| | | | |
| extern int libxfs_trans_iget (xfs_mount_t *, xfs_trans_t *, xfs_ino_t, | | extern int libxfs_trans_iget (xfs_mount_t *, xfs_trans_t *, xfs_ino_t, | |
| uint, uint, struct xfs_inode **); | | uint, uint, struct xfs_inode **); | |
| extern void libxfs_trans_iput(xfs_trans_t *, struct xfs_inode *, uint); | | extern void libxfs_trans_iput(xfs_trans_t *, struct xfs_inode *, uint); | |
| extern void libxfs_trans_ijoin (xfs_trans_t *, struct xfs_inode *, uint)
; | | extern void libxfs_trans_ijoin (xfs_trans_t *, struct xfs_inode *, uint)
; | |
| extern void libxfs_trans_ihold (xfs_trans_t *, struct xfs_inode *); | | extern void libxfs_trans_ihold (xfs_trans_t *, struct xfs_inode *); | |
|
| | | extern void libxfs_trans_ijoin_ref(xfs_trans_t *, struct xfs_inode *, in
t); | |
| extern void libxfs_trans_log_inode (xfs_trans_t *, struct xfs_inode *, | | extern void libxfs_trans_log_inode (xfs_trans_t *, struct xfs_inode *, | |
| uint); | | uint); | |
| | | | |
| extern void libxfs_trans_brelse (xfs_trans_t *, struct xfs_buf *); | | extern void libxfs_trans_brelse (xfs_trans_t *, struct xfs_buf *); | |
| extern void libxfs_trans_binval (xfs_trans_t *, struct xfs_buf *); | | extern void libxfs_trans_binval (xfs_trans_t *, struct xfs_buf *); | |
| extern void libxfs_trans_bjoin (xfs_trans_t *, struct xfs_buf *); | | extern void libxfs_trans_bjoin (xfs_trans_t *, struct xfs_buf *); | |
| extern void libxfs_trans_bhold (xfs_trans_t *, struct xfs_buf *); | | extern void libxfs_trans_bhold (xfs_trans_t *, struct xfs_buf *); | |
| extern void libxfs_trans_log_buf (xfs_trans_t *, struct xfs_buf *, | | extern void libxfs_trans_log_buf (xfs_trans_t *, struct xfs_buf *, | |
| uint, uint); | | uint, uint); | |
| extern xfs_buf_t *libxfs_trans_get_buf (xfs_trans_t *, dev_t, | | extern xfs_buf_t *libxfs_trans_get_buf (xfs_trans_t *, dev_t, | |
| | | | |
| skipping to change at line 392 | | skipping to change at line 405 | |
| extern int libxfs_trans_read_buf (xfs_mount_t *, xfs_trans_t *, dev_t, | | extern int libxfs_trans_read_buf (xfs_mount_t *, xfs_trans_t *, dev_t, | |
| xfs_daddr_t, int, uint, struct xfs_buf **); | | xfs_daddr_t, int, uint, struct xfs_buf **); | |
| | | | |
| /* | | /* | |
| * Inode interface | | * Inode interface | |
| */ | | */ | |
| typedef struct xfs_inode { | | typedef struct xfs_inode { | |
| struct cache_node i_node; | | struct cache_node i_node; | |
| xfs_mount_t *i_mount; /* fs mount struct ptr */ | | xfs_mount_t *i_mount; /* fs mount struct ptr */ | |
| xfs_ino_t i_ino; /* inode number (agno/agino)
*/ | | xfs_ino_t i_ino; /* inode number (agno/agino)
*/ | |
|
| xfs_daddr_t i_blkno; /* blkno of inode buffer */ | | struct xfs_imap i_imap; /* location for xfs_imap() *
/ | |
| dev_t i_dev; /* dev for this inode */ | | dev_t i_dev; /* dev for this inode */ | |
|
| ushort i_len; /* len of inode buffer */ | | | |
| ushort i_boffset; /* off of inode in buffer */ | | | |
| xfs_ifork_t *i_afp; /* attribute fork pointer */ | | xfs_ifork_t *i_afp; /* attribute fork pointer */ | |
| xfs_ifork_t i_df; /* data fork */ | | xfs_ifork_t i_df; /* data fork */ | |
| xfs_trans_t *i_transp; /* ptr to owning transaction
*/ | | xfs_trans_t *i_transp; /* ptr to owning transaction
*/ | |
| xfs_inode_log_item_t *i_itemp; /* logging information */ | | xfs_inode_log_item_t *i_itemp; /* logging information */ | |
| unsigned int i_delayed_blks; /* count of delay alloc blks
*/ | | unsigned int i_delayed_blks; /* count of delay alloc blks
*/ | |
| xfs_icdinode_t i_d; /* most of ondisk inode */ | | xfs_icdinode_t i_d; /* most of ondisk inode */ | |
| xfs_fsize_t i_size; /* in-memory size */ | | xfs_fsize_t i_size; /* in-memory size */ | |
| } xfs_inode_t; | | } xfs_inode_t; | |
| | | | |
| #define LIBXFS_ATTR_ROOT 0x0002 /* use attrs in root namespace */ | | #define LIBXFS_ATTR_ROOT 0x0002 /* use attrs in root namespace */ | |
| | | | |
| skipping to change at line 420 | | skipping to change at line 431 | |
| typedef struct cred { | | typedef struct cred { | |
| uid_t cr_uid; | | uid_t cr_uid; | |
| gid_t cr_gid; | | gid_t cr_gid; | |
| } cred_t; | | } cred_t; | |
| | | | |
| extern int libxfs_inode_alloc (xfs_trans_t **, xfs_inode_t *, mode_t, | | extern int libxfs_inode_alloc (xfs_trans_t **, xfs_inode_t *, mode_t, | |
| nlink_t, xfs_dev_t, struct cred *, | | nlink_t, xfs_dev_t, struct cred *, | |
| struct fsxattr *, xfs_inode_t **); | | struct fsxattr *, xfs_inode_t **); | |
| extern void libxfs_trans_inode_alloc_buf (xfs_trans_t *, xfs_buf_t *); | | extern void libxfs_trans_inode_alloc_buf (xfs_trans_t *, xfs_buf_t *); | |
| | | | |
|
| extern void libxfs_ichgtime (xfs_inode_t *, int); | | extern void libxfs_trans_ichgtime(struct xfs_trans *, | |
| | | struct xfs_inode *, int); | |
| extern int libxfs_iflush_int (xfs_inode_t *, xfs_buf_t *); | | extern int libxfs_iflush_int (xfs_inode_t *, xfs_buf_t *); | |
| extern int libxfs_iread (xfs_mount_t *, xfs_trans_t *, xfs_ino_t, | | extern int libxfs_iread (xfs_mount_t *, xfs_trans_t *, xfs_ino_t, | |
| xfs_inode_t *, xfs_daddr_t); | | xfs_inode_t *, xfs_daddr_t); | |
| | | | |
| /* Inode Cache Interfaces */ | | /* Inode Cache Interfaces */ | |
| extern struct cache *libxfs_icache; | | extern struct cache *libxfs_icache; | |
| extern struct cache_operations libxfs_icache_operations; | | extern struct cache_operations libxfs_icache_operations; | |
| extern void libxfs_icache_purge (void); | | extern void libxfs_icache_purge (void); | |
| extern int libxfs_iget (xfs_mount_t *, xfs_trans_t *, xfs_ino_t, | | extern int libxfs_iget (xfs_mount_t *, xfs_trans_t *, xfs_ino_t, | |
| uint, xfs_inode_t **, xfs_daddr_t); | | uint, xfs_inode_t **, xfs_daddr_t); | |
| extern void libxfs_iput (xfs_inode_t *, uint); | | extern void libxfs_iput (xfs_inode_t *, uint); | |
| | | | |
|
| | | extern int xfs_imap_to_bp(xfs_mount_t *mp, xfs_trans_t *tp, struct xfs_ | |
| | | imap *imap, | |
| | | xfs_buf_t **bpp, uint buf_flags, uint iget_flags); | |
| | | | |
| #include <xfs/xfs_dir_leaf.h> /* dirv1 support in db & repair */ | | #include <xfs/xfs_dir_leaf.h> /* dirv1 support in db & repair */ | |
| #include <xfs/xfs_dir2_data.h> | | #include <xfs/xfs_dir2_data.h> | |
| #include <xfs/xfs_dir2_leaf.h> | | #include <xfs/xfs_dir2_leaf.h> | |
| #include <xfs/xfs_dir2_block.h> | | #include <xfs/xfs_dir2_block.h> | |
| #include <xfs/xfs_dir2_node.h> | | #include <xfs/xfs_dir2_node.h> | |
| | | | |
| /* Shared utility routines */ | | /* Shared utility routines */ | |
| extern unsigned int libxfs_log2_roundup(unsigned int i); | | extern unsigned int libxfs_log2_roundup(unsigned int i); | |
| | | | |
| extern int libxfs_alloc_file_space (xfs_inode_t *, xfs_off_t, | | extern int libxfs_alloc_file_space (xfs_inode_t *, xfs_off_t, | |
| | | | |
| skipping to change at line 467 | | skipping to change at line 482 | |
| #define LIBXFS_BBTOOFF64(bbs) (((xfs_off_t)(bbs)) << BBSHIFT) | | #define LIBXFS_BBTOOFF64(bbs) (((xfs_off_t)(bbs)) << BBSHIFT) | |
| extern int libxfs_nproc(void); | | extern int libxfs_nproc(void); | |
| extern unsigned long libxfs_physmem(void); /* in kilobytes */ | | extern unsigned long libxfs_physmem(void); /* in kilobytes */ | |
| | | | |
| #include <xfs/xfs_ialloc.h> | | #include <xfs/xfs_ialloc.h> | |
| #include <xfs/xfs_rtalloc.h> | | #include <xfs/xfs_rtalloc.h> | |
| | | | |
| #include <xfs/xfs_attr_leaf.h> | | #include <xfs/xfs_attr_leaf.h> | |
| #include <xfs/xfs_quota.h> | | #include <xfs/xfs_quota.h> | |
| #include <xfs/xfs_trans_space.h> | | #include <xfs/xfs_trans_space.h> | |
|
| #include <xfs/xfs_imap.h> | | | |
| #include <xfs/xfs_log.h> | | #include <xfs/xfs_log.h> | |
| #include <xfs/xfs_log_priv.h> | | #include <xfs/xfs_log_priv.h> | |
| | | | |
|
| | | #define XFS_INOBT_CLR_FREE(rp,i) ((rp)->ir_free &= ~XFS_INOBT_MASK(i) | |
| | | ) | |
| | | #define XFS_INOBT_SET_FREE(rp,i) ((rp)->ir_free |= XFS_INOBT_MASK(i)) | |
| #define XFS_INOBT_IS_FREE_DISK(rp,i) \ | | #define XFS_INOBT_IS_FREE_DISK(rp,i) \ | |
| ((be64_to_cpu((rp)->ir_free) & XFS_INOBT_MASK(i)) !=
0) | | ((be64_to_cpu((rp)->ir_free) & XFS_INOBT_MASK(i)) !=
0) | |
|
| | | | |
| /* | | /* | |
| * public xfs kernel routines to be called as libxfs_* | | * public xfs kernel routines to be called as libxfs_* | |
| */ | | */ | |
| | | | |
| /* xfs_alloc.c */ | | /* xfs_alloc.c */ | |
| int libxfs_alloc_fix_freelist(xfs_alloc_arg_t *, int); | | int libxfs_alloc_fix_freelist(xfs_alloc_arg_t *, int); | |
| | | | |
| /* xfs_attr.c */ | | /* xfs_attr.c */ | |
|
| int libxfs_attr_get(struct xfs_inode *, const char *, char *, int *, int); | | int libxfs_attr_get(struct xfs_inode *, const unsigned char *, | |
| int libxfs_attr_set(struct xfs_inode *, const char *, char *, int, int); | | unsigned char *, int *, int); | |
| int libxfs_attr_remove(struct xfs_inode *, const char *, int); | | int libxfs_attr_set(struct xfs_inode *, const unsigned char *, | |
| | | unsigned char *, int, int); | |
| | | int libxfs_attr_remove(struct xfs_inode *, const unsigned char *, int); | |
| | | | |
| /* xfs_bmap.c */ | | /* xfs_bmap.c */ | |
| xfs_bmbt_rec_host_t *xfs_bmap_search_extents(xfs_inode_t *, xfs_fileoff_t, | | xfs_bmbt_rec_host_t *xfs_bmap_search_extents(xfs_inode_t *, xfs_fileoff_t, | |
| int, int *, xfs_extnum_t *, xfs_bmbt_irec_t
*, | | int, int *, xfs_extnum_t *, xfs_bmbt_irec_t
*, | |
| xfs_bmbt_irec_t *); | | xfs_bmbt_irec_t *); | |
|
| | | void xfs_bmbt_disk_get_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s); | |
| | | | |
| /* xfs_attr_leaf.h */ | | /* xfs_attr_leaf.h */ | |
| #define libxfs_attr_leaf_newentsize xfs_attr_leaf_newentsize | | #define libxfs_attr_leaf_newentsize xfs_attr_leaf_newentsize | |
| | | | |
| /* xfs_bit.h */ | | /* xfs_bit.h */ | |
| #define libxfs_highbit32 xfs_highbit32 | | #define libxfs_highbit32 xfs_highbit32 | |
| #define libxfs_highbit64 xfs_highbit64 | | #define libxfs_highbit64 xfs_highbit64 | |
| | | | |
| /* xfs_bmap.h */ | | /* xfs_bmap.h */ | |
| #define libxfs_bmap_cancel xfs_bmap_cancel | | #define libxfs_bmap_cancel xfs_bmap_cancel | |
| | | | |
End of changes. 20 change blocks. |
| 14 lines changed or deleted | | 36 lines changed or added | |
|
| xfs_ag.h | | xfs_ag.h | |
| | | | |
| skipping to change at line 89 | | skipping to change at line 89 | |
| #define XFS_AGF_LEVELS 0x00000020 | | #define XFS_AGF_LEVELS 0x00000020 | |
| #define XFS_AGF_FLFIRST 0x00000040 | | #define XFS_AGF_FLFIRST 0x00000040 | |
| #define XFS_AGF_FLLAST 0x00000080 | | #define XFS_AGF_FLLAST 0x00000080 | |
| #define XFS_AGF_FLCOUNT 0x00000100 | | #define XFS_AGF_FLCOUNT 0x00000100 | |
| #define XFS_AGF_FREEBLKS 0x00000200 | | #define XFS_AGF_FREEBLKS 0x00000200 | |
| #define XFS_AGF_LONGEST 0x00000400 | | #define XFS_AGF_LONGEST 0x00000400 | |
| #define XFS_AGF_BTREEBLKS 0x00000800 | | #define XFS_AGF_BTREEBLKS 0x00000800 | |
| #define XFS_AGF_NUM_BITS 12 | | #define XFS_AGF_NUM_BITS 12 | |
| #define XFS_AGF_ALL_BITS ((1 << XFS_AGF_NUM_BITS) - 1) | | #define XFS_AGF_ALL_BITS ((1 << XFS_AGF_NUM_BITS) - 1) | |
| | | | |
|
| | | #define XFS_AGF_FLAGS \ | |
| | | { XFS_AGF_MAGICNUM, "MAGICNUM" }, \ | |
| | | { XFS_AGF_VERSIONNUM, "VERSIONNUM" }, \ | |
| | | { XFS_AGF_SEQNO, "SEQNO" }, \ | |
| | | { XFS_AGF_LENGTH, "LENGTH" }, \ | |
| | | { XFS_AGF_ROOTS, "ROOTS" }, \ | |
| | | { XFS_AGF_LEVELS, "LEVELS" }, \ | |
| | | { XFS_AGF_FLFIRST, "FLFIRST" }, \ | |
| | | { XFS_AGF_FLLAST, "FLLAST" }, \ | |
| | | { XFS_AGF_FLCOUNT, "FLCOUNT" }, \ | |
| | | { XFS_AGF_FREEBLKS, "FREEBLKS" }, \ | |
| | | { XFS_AGF_LONGEST, "LONGEST" }, \ | |
| | | { XFS_AGF_BTREEBLKS, "BTREEBLKS" } | |
| | | | |
| /* disk block (xfs_daddr_t) in the AG */ | | /* disk block (xfs_daddr_t) in the AG */ | |
| #define XFS_AGF_DADDR(mp) ((xfs_daddr_t)(1 << (mp)->m_sectbb_log)) | | #define XFS_AGF_DADDR(mp) ((xfs_daddr_t)(1 << (mp)->m_sectbb_log)) | |
| #define XFS_AGF_BLOCK(mp) XFS_HDR_BLOCK(mp, XFS_AGF_DADDR(mp)) | | #define XFS_AGF_BLOCK(mp) XFS_HDR_BLOCK(mp, XFS_AGF_DADDR(mp)) | |
| #define XFS_BUF_TO_AGF(bp) ((xfs_agf_t *)XFS_BUF_PTR(bp)) | | #define XFS_BUF_TO_AGF(bp) ((xfs_agf_t *)XFS_BUF_PTR(bp)) | |
| | | | |
|
| | | extern int xfs_read_agf(struct xfs_mount *mp, struct xfs_trans *tp, | |
| | | xfs_agnumber_t agno, int flags, struct xfs_buf **bpp | |
| | | ); | |
| | | | |
| /* | | /* | |
| * Size of the unlinked inode hash table in the agi. | | * Size of the unlinked inode hash table in the agi. | |
| */ | | */ | |
| #define XFS_AGI_UNLINKED_BUCKETS 64 | | #define XFS_AGI_UNLINKED_BUCKETS 64 | |
| | | | |
| typedef struct xfs_agi { | | typedef struct xfs_agi { | |
| /* | | /* | |
| * Common allocation group header information | | * Common allocation group header information | |
| */ | | */ | |
| __be32 agi_magicnum; /* magic number == XFS_AGI_MAGIC */ | | __be32 agi_magicnum; /* magic number == XFS_AGI_MAGIC */ | |
| | | | |
| skipping to change at line 144 | | skipping to change at line 161 | |
| #define XFS_AGI_DIRINO 0x00000200 | | #define XFS_AGI_DIRINO 0x00000200 | |
| #define XFS_AGI_UNLINKED 0x00000400 | | #define XFS_AGI_UNLINKED 0x00000400 | |
| #define XFS_AGI_NUM_BITS 11 | | #define XFS_AGI_NUM_BITS 11 | |
| #define XFS_AGI_ALL_BITS ((1 << XFS_AGI_NUM_BITS) - 1) | | #define XFS_AGI_ALL_BITS ((1 << XFS_AGI_NUM_BITS) - 1) | |
| | | | |
| /* disk block (xfs_daddr_t) in the AG */ | | /* disk block (xfs_daddr_t) in the AG */ | |
| #define XFS_AGI_DADDR(mp) ((xfs_daddr_t)(2 << (mp)->m_sectbb_log)) | | #define XFS_AGI_DADDR(mp) ((xfs_daddr_t)(2 << (mp)->m_sectbb_log)) | |
| #define XFS_AGI_BLOCK(mp) XFS_HDR_BLOCK(mp, XFS_AGI_DADDR(mp)) | | #define XFS_AGI_BLOCK(mp) XFS_HDR_BLOCK(mp, XFS_AGI_DADDR(mp)) | |
| #define XFS_BUF_TO_AGI(bp) ((xfs_agi_t *)XFS_BUF_PTR(bp)) | | #define XFS_BUF_TO_AGI(bp) ((xfs_agi_t *)XFS_BUF_PTR(bp)) | |
| | | | |
|
| | | extern int xfs_read_agi(struct xfs_mount *mp, struct xfs_trans *tp, | |
| | | xfs_agnumber_t agno, struct xfs_buf **bpp); | |
| | | | |
| /* | | /* | |
| * The third a.g. block contains the a.g. freelist, an array | | * The third a.g. block contains the a.g. freelist, an array | |
| * of block pointers to blocks owned by the allocation btree code. | | * of block pointers to blocks owned by the allocation btree code. | |
| */ | | */ | |
| #define XFS_AGFL_DADDR(mp) ((xfs_daddr_t)(3 << (mp)->m_sectbb_log)) | | #define XFS_AGFL_DADDR(mp) ((xfs_daddr_t)(3 << (mp)->m_sectbb_log)) | |
| #define XFS_AGFL_BLOCK(mp) XFS_HDR_BLOCK(mp, XFS_AGFL_DADDR(mp)
) | | #define XFS_AGFL_BLOCK(mp) XFS_HDR_BLOCK(mp, XFS_AGFL_DADDR(mp)
) | |
| #define XFS_AGFL_SIZE(mp) ((mp)->m_sb.sb_sectsize / sizeof(xfs_agblock
_t)) | | #define XFS_AGFL_SIZE(mp) ((mp)->m_sb.sb_sectsize / sizeof(xfs_agblock
_t)) | |
| #define XFS_BUF_TO_AGFL(bp) ((xfs_agfl_t *)XFS_BUF_PTR(bp)) | | #define XFS_BUF_TO_AGFL(bp) ((xfs_agfl_t *)XFS_BUF_PTR(bp)) | |
| | | | |
| typedef struct xfs_agfl { | | typedef struct xfs_agfl { | |
| __be32 agfl_bno[1]; /* actually XFS_AGFL_SIZE(mp) */ | | __be32 agfl_bno[1]; /* actually XFS_AGFL_SIZE(mp) */ | |
| } xfs_agfl_t; | | } xfs_agfl_t; | |
| | | | |
| /* | | /* | |
|
| * Busy block/extent entry. Used in perag to mark blocks that have been fr | | * Busy block/extent entry. Indexed by a rbtree in perag to mark blocks th | |
| eed | | at | |
| * but whose transactions aren't committed to disk yet. | | * have been freed but whose transactions aren't committed to disk yet. | |
| | | * | |
| | | * Note that we use the transaction ID to record the transaction, not the | |
| | | * transaction structure itself. See xfs_alloc_busy_insert() for details. | |
| */ | | */ | |
|
| typedef struct xfs_perag_busy { | | struct xfs_busy_extent { | |
| xfs_agblock_t busy_start; | | #ifdef __KERNEL__ | |
| xfs_extlen_t busy_length; | | struct rb_node rb_node; /* ag by-bno indexed search tree */ | |
| struct xfs_trans *busy_tp; /* transaction that did the free */ | | #endif | |
| } xfs_perag_busy_t; | | struct list_head list; /* transaction busy extent list */ | |
| | | xfs_agnumber_t agno; | |
| | | xfs_agblock_t bno; | |
| | | xfs_extlen_t length; | |
| | | xlog_tid_t tid; /* transaction that created this */ | |
| | | }; | |
| | | | |
| /* | | /* | |
| * Per-ag incore structure, copies of information in agf and agi, | | * Per-ag incore structure, copies of information in agf and agi, | |
| * to improve the performance of allocation group selection. | | * to improve the performance of allocation group selection. | |
|
| * | | | |
| * pick sizes which fit in allocation buckets well | | | |
| */ | | */ | |
|
| #if (BITS_PER_LONG == 32) | | | |
| #define XFS_PAGB_NUM_SLOTS 84 | | | |
| #elif (BITS_PER_LONG == 64) | | | |
| #define XFS_PAGB_NUM_SLOTS 128 | | #define XFS_PAGB_NUM_SLOTS 128 | |
|
| #endif | | | |
| | | | |
|
| typedef struct xfs_perag | | typedef struct xfs_perag { | |
| { | | struct xfs_mount *pag_mount; /* owner filesystem */ | |
| | | xfs_agnumber_t pag_agno; /* AG this structure belongs to */ | |
| | | atomic_t pag_ref; /* perag reference count */ | |
| char pagf_init; /* this agf's entry is initialized *
/ | | char pagf_init; /* this agf's entry is initialized *
/ | |
| char pagi_init; /* this agi's entry is initialized *
/ | | char pagi_init; /* this agi's entry is initialized *
/ | |
| char pagf_metadata; /* the agf is preferred to be metada
ta */ | | char pagf_metadata; /* the agf is preferred to be metada
ta */ | |
| char pagi_inodeok; /* The agi is ok for inodes */ | | char pagi_inodeok; /* The agi is ok for inodes */ | |
| __uint8_t pagf_levels[XFS_BTNUM_AGF]; | | __uint8_t pagf_levels[XFS_BTNUM_AGF]; | |
| /* # of levels in bno & cnt btree */ | | /* # of levels in bno & cnt btree */ | |
| __uint32_t pagf_flcount; /* count of blocks in freelist */ | | __uint32_t pagf_flcount; /* count of blocks in freelist */ | |
| xfs_extlen_t pagf_freeblks; /* total free blocks */ | | xfs_extlen_t pagf_freeblks; /* total free blocks */ | |
| xfs_extlen_t pagf_longest; /* longest free space */ | | xfs_extlen_t pagf_longest; /* longest free space */ | |
| __uint32_t pagf_btreeblks; /* # of blocks held in AGF btrees */ | | __uint32_t pagf_btreeblks; /* # of blocks held in AGF btrees */ | |
| xfs_agino_t pagi_freecount; /* number of free inodes */ | | xfs_agino_t pagi_freecount; /* number of free inodes */ | |
| xfs_agino_t pagi_count; /* number of allocated inodes */ | | xfs_agino_t pagi_count; /* number of allocated inodes */ | |
|
| int pagb_count; /* pagb slots in use */ | | | |
| xfs_perag_busy_t *pagb_list; /* unstable blocks */ | | /* | |
| | | * Inode allocation search lookup optimisation. | |
| | | * If the pagino matches, the search for new inodes | |
| | | * doesn't need to search the near ones again straight away | |
| | | */ | |
| | | xfs_agino_t pagl_pagino; | |
| | | xfs_agino_t pagl_leftrec; | |
| | | xfs_agino_t pagl_rightrec; | |
| #ifdef __KERNEL__ | | #ifdef __KERNEL__ | |
|
| spinlock_t pagb_lock; /* lock for pagb_list */ | | spinlock_t pagb_lock; /* lock for pagb_tree */ | |
| | | struct rb_root pagb_tree; /* ordered tree of busy extents */ | |
| | | | |
| atomic_t pagf_fstrms; /* # of filestreams active in this A
G */ | | atomic_t pagf_fstrms; /* # of filestreams active in this A
G */ | |
| | | | |
|
| int pag_ici_init; /* incore inode cache initialised */ | | spinlock_t pag_ici_lock; /* incore inode cache lock */ | |
| rwlock_t pag_ici_lock; /* incore inode lock */ | | | |
| struct radix_tree_root pag_ici_root; /* incore inode cache root *
/ | | struct radix_tree_root pag_ici_root; /* incore inode cache root *
/ | |
|
| | | int pag_ici_reclaimable; /* reclaimable inodes */ | |
| | | struct mutex pag_ici_reclaim_lock; /* serialisation point */ | |
| | | unsigned long pag_ici_reclaim_cursor; /* reclaim restart point */ | |
| | | | |
| | | /* buffer cache index */ | |
| | | spinlock_t pag_buf_lock; /* lock for pag_buf_tree */ | |
| | | struct rb_root pag_buf_tree; /* ordered tree of active buffers */ | |
| | | | |
| | | /* for rcu-safe freeing */ | |
| | | struct rcu_head rcu_head; | |
| #endif | | #endif | |
|
| | | int pagb_count; /* pagb slots in use */ | |
| } xfs_perag_t; | | } xfs_perag_t; | |
| | | | |
|
| | | /* | |
| | | * tags for inode radix tree | |
| | | */ | |
| | | #define XFS_ICI_NO_TAG (-1) /* special flag for an untagged look | |
| | | up | |
| | | in xfs_inode_ag_iterator */ | |
| | | #define XFS_ICI_RECLAIM_TAG 0 /* inode is to be reclaimed */ | |
| | | | |
| #define XFS_AG_MAXLEVELS(mp) ((mp)->m_ag_maxlevels) | | #define XFS_AG_MAXLEVELS(mp) ((mp)->m_ag_maxlevels) | |
| #define XFS_MIN_FREELIST_RAW(bl,cl,mp) \ | | #define XFS_MIN_FREELIST_RAW(bl,cl,mp) \ | |
| (MIN(bl + 1, XFS_AG_MAXLEVELS(mp)) + MIN(cl + 1, XFS_AG_MAXLEVELS(mp
))) | | (MIN(bl + 1, XFS_AG_MAXLEVELS(mp)) + MIN(cl + 1, XFS_AG_MAXLEVELS(mp
))) | |
| #define XFS_MIN_FREELIST(a,mp) \ | | #define XFS_MIN_FREELIST(a,mp) \ | |
| (XFS_MIN_FREELIST_RAW( \ | | (XFS_MIN_FREELIST_RAW( \ | |
| be32_to_cpu((a)->agf_levels[XFS_BTNUM_BNOi]), \ | | be32_to_cpu((a)->agf_levels[XFS_BTNUM_BNOi]), \ | |
| be32_to_cpu((a)->agf_levels[XFS_BTNUM_CNTi]), mp)) | | be32_to_cpu((a)->agf_levels[XFS_BTNUM_CNTi]), mp)) | |
| #define XFS_MIN_FREELIST_PAG(pag,mp) \ | | #define XFS_MIN_FREELIST_PAG(pag,mp) \ | |
| (XFS_MIN_FREELIST_RAW( \ | | (XFS_MIN_FREELIST_RAW( \ | |
|
| (uint_t)(pag)->pagf_levels[XFS_BTNUM_BNOi], \ | | (unsigned int)(pag)->pagf_levels[XFS_BTNUM_BNOi], \ | |
| (uint_t)(pag)->pagf_levels[XFS_BTNUM_CNTi], mp)) | | (unsigned int)(pag)->pagf_levels[XFS_BTNUM_CNTi], mp)) | |
| | | | |
| #define XFS_AGB_TO_FSB(mp,agno,agbno) \ | | #define XFS_AGB_TO_FSB(mp,agno,agbno) \ | |
| (((xfs_fsblock_t)(agno) << (mp)->m_sb.sb_agblklog) | (agbno)) | | (((xfs_fsblock_t)(agno) << (mp)->m_sb.sb_agblklog) | (agbno)) | |
| #define XFS_FSB_TO_AGNO(mp,fsbno) \ | | #define XFS_FSB_TO_AGNO(mp,fsbno) \ | |
| ((xfs_agnumber_t)((fsbno) >> (mp)->m_sb.sb_agblklog)) | | ((xfs_agnumber_t)((fsbno) >> (mp)->m_sb.sb_agblklog)) | |
| #define XFS_FSB_TO_AGBNO(mp,fsbno) \ | | #define XFS_FSB_TO_AGBNO(mp,fsbno) \ | |
|
| ((xfs_agblock_t)((fsbno) & XFS_MASK32LO((mp)->m_sb.sb_agblklog))) | | ((xfs_agblock_t)((fsbno) & xfs_mask32lo((mp)->m_sb.sb_agblklog))) | |
| #define XFS_AGB_TO_DADDR(mp,agno,agbno) \ | | #define XFS_AGB_TO_DADDR(mp,agno,agbno) \ | |
| ((xfs_daddr_t)XFS_FSB_TO_BB(mp, \ | | ((xfs_daddr_t)XFS_FSB_TO_BB(mp, \ | |
| (xfs_fsblock_t)(agno) * (mp)->m_sb.sb_agblocks + (agbno))) | | (xfs_fsblock_t)(agno) * (mp)->m_sb.sb_agblocks + (agbno))) | |
| #define XFS_AG_DADDR(mp,agno,d) (XFS_AGB_TO_DADDR(mp, agno,
0) + (d)) | | #define XFS_AG_DADDR(mp,agno,d) (XFS_AGB_TO_DADDR(mp, agno,
0) + (d)) | |
| | | | |
| /* | | /* | |
| * For checking for bad ranges of xfs_daddr_t's, covering multiple | | * For checking for bad ranges of xfs_daddr_t's, covering multiple | |
| * allocation groups or a single xfs_daddr_t that's a superblock copy. | | * allocation groups or a single xfs_daddr_t that's a superblock copy. | |
| */ | | */ | |
| #define XFS_AG_CHECK_DADDR(mp,d,len) \ | | #define XFS_AG_CHECK_DADDR(mp,d,len) \ | |
| ((len) == 1 ? \ | | ((len) == 1 ? \ | |
| ASSERT((d) == XFS_SB_DADDR || \ | | ASSERT((d) == XFS_SB_DADDR || \ | |
|
| XFS_DADDR_TO_AGBNO(mp, d) != XFS_SB_DADDR) : \ | | xfs_daddr_to_agbno(mp, d) != XFS_SB_DADDR) : \ | |
| ASSERT(XFS_DADDR_TO_AGNO(mp, d) == \ | | ASSERT(xfs_daddr_to_agno(mp, d) == \ | |
| XFS_DADDR_TO_AGNO(mp, (d) + (len) - 1))) | | xfs_daddr_to_agno(mp, (d) + (len) - 1))) | |
| | | | |
| #endif /* __XFS_AG_H__ */ | | #endif /* __XFS_AG_H__ */ | |
| | | | |
End of changes. 18 change blocks. |
| 27 lines changed or deleted | | 78 lines changed or added | |
|
| xfs_bmap.h | | xfs_bmap.h | |
| | | | |
| skipping to change at line 31 | | skipping to change at line 31 | |
| struct getbmap; | | struct getbmap; | |
| struct xfs_bmbt_irec; | | struct xfs_bmbt_irec; | |
| struct xfs_ifork; | | struct xfs_ifork; | |
| struct xfs_inode; | | struct xfs_inode; | |
| struct xfs_mount; | | struct xfs_mount; | |
| struct xfs_trans; | | struct xfs_trans; | |
| | | | |
| extern kmem_zone_t *xfs_bmap_free_item_zone; | | extern kmem_zone_t *xfs_bmap_free_item_zone; | |
| | | | |
| /* | | /* | |
|
| * DELTA: describe a change to the in-core extent list. | | | |
| * | | | |
| * Internally the use of xed_blockount is somewhat funky. | | | |
| * xed_blockcount contains an offset much of the time because this | | | |
| * makes merging changes easier. (xfs_fileoff_t and xfs_filblks_t are | | | |
| * the same underlying type). | | | |
| */ | | | |
| typedef struct xfs_extdelta | | | |
| { | | | |
| xfs_fileoff_t xed_startoff; /* offset of range */ | | | |
| xfs_filblks_t xed_blockcount; /* blocks in range */ | | | |
| } xfs_extdelta_t; | | | |
| | | | |
| /* | | | |
| * List of extents to be free "later". | | * List of extents to be free "later". | |
| * The list is kept sorted on xbf_startblock. | | * The list is kept sorted on xbf_startblock. | |
| */ | | */ | |
| typedef struct xfs_bmap_free_item | | typedef struct xfs_bmap_free_item | |
| { | | { | |
| xfs_fsblock_t xbfi_startblock;/* starting fs block number
*/ | | xfs_fsblock_t xbfi_startblock;/* starting fs block number
*/ | |
| xfs_extlen_t xbfi_blockcount;/* number of blocks in exten
t */ | | xfs_extlen_t xbfi_blockcount;/* number of blocks in exten
t */ | |
| struct xfs_bmap_free_item *xbfi_next; /* link to next entry */ | | struct xfs_bmap_free_item *xbfi_next; /* link to next entry */ | |
| } xfs_bmap_free_item_t; | | } xfs_bmap_free_item_t; | |
| | | | |
| | | | |
| skipping to change at line 85 | | skipping to change at line 71 | |
| | | | |
| #define XFS_BMAP_MAX_NMAP 4 | | #define XFS_BMAP_MAX_NMAP 4 | |
| | | | |
| /* | | /* | |
| * Flags for xfs_bmapi | | * Flags for xfs_bmapi | |
| */ | | */ | |
| #define XFS_BMAPI_WRITE 0x001 /* write operation: allocate
space */ | | #define XFS_BMAPI_WRITE 0x001 /* write operation: allocate
space */ | |
| #define XFS_BMAPI_DELAY 0x002 /* delayed write operation *
/ | | #define XFS_BMAPI_DELAY 0x002 /* delayed write operation *
/ | |
| #define XFS_BMAPI_ENTIRE 0x004 /* return entire extent, not trimmed
*/ | | #define XFS_BMAPI_ENTIRE 0x004 /* return entire extent, not trimmed
*/ | |
| #define XFS_BMAPI_METADATA 0x008 /* mapping metadata not user data */ | | #define XFS_BMAPI_METADATA 0x008 /* mapping metadata not user data */ | |
|
| #define XFS_BMAPI_EXACT 0x010 /* allocate only to spec'd b | | #define XFS_BMAPI_ATTRFORK 0x010 /* use attribute fork not data */ | |
| ounds */ | | #define XFS_BMAPI_RSVBLOCKS 0x020 /* OK to alloc. reserved data blocks | |
| #define XFS_BMAPI_ATTRFORK 0x020 /* use attribute fork not data */ | | */ | |
| #define XFS_BMAPI_ASYNC 0x040 /* bunmapi xactions can be a | | #define XFS_BMAPI_PREALLOC 0x040 /* preallocation op: unwritt | |
| sync */ | | en space */ | |
| #define XFS_BMAPI_RSVBLOCKS 0x080 /* OK to alloc. reserved data blocks | | #define XFS_BMAPI_IGSTATE 0x080 /* Ignore state - */ | |
| */ | | | |
| #define XFS_BMAPI_PREALLOC 0x100 /* preallocation op: unwritt | | | |
| en space */ | | | |
| #define XFS_BMAPI_IGSTATE 0x200 /* Ignore state - */ | | | |
| /* combine contig. space */ | | /* combine contig. space */ | |
|
| #define XFS_BMAPI_CONTIG 0x400 /* must allocate only one ex | | #define XFS_BMAPI_CONTIG 0x100 /* must allocate only one ex | |
| tent */ | | tent */ | |
| /* XFS_BMAPI_DIRECT_IO 0x800 */ | | /* | |
| #define XFS_BMAPI_CONVERT 0x1000 /* unwritten extent conversion - */ | | * unwritten extent conversion - this needs write cache flushing and no add | |
| /* need write cache flushing and no | | itional | |
| */ | | * allocation alignments. When specified with XFS_BMAPI_PREALLOC it convert | |
| /* additional allocation alignments | | s | |
| */ | | * from written to unwritten, otherwise convert from unwritten to written. | |
| | | */ | |
| | | #define XFS_BMAPI_CONVERT 0x200 | |
| | | | |
| | | #define XFS_BMAPI_FLAGS \ | |
| | | { XFS_BMAPI_WRITE, "WRITE" }, \ | |
| | | { XFS_BMAPI_DELAY, "DELAY" }, \ | |
| | | { XFS_BMAPI_ENTIRE, "ENTIRE" }, \ | |
| | | { XFS_BMAPI_METADATA, "METADATA" }, \ | |
| | | { XFS_BMAPI_ATTRFORK, "ATTRFORK" }, \ | |
| | | { XFS_BMAPI_RSVBLOCKS, "RSVBLOCKS" }, \ | |
| | | { XFS_BMAPI_PREALLOC, "PREALLOC" }, \ | |
| | | { XFS_BMAPI_IGSTATE, "IGSTATE" }, \ | |
| | | { XFS_BMAPI_CONTIG, "CONTIG" }, \ | |
| | | { XFS_BMAPI_CONVERT, "CONVERT" } | |
| | | | |
|
| #define XFS_BMAPI_AFLAG(w) xfs_bmapi_aflag(w) | | | |
| static inline int xfs_bmapi_aflag(int w) | | static inline int xfs_bmapi_aflag(int w) | |
| { | | { | |
| return (w == XFS_ATTR_FORK ? XFS_BMAPI_ATTRFORK : 0); | | return (w == XFS_ATTR_FORK ? XFS_BMAPI_ATTRFORK : 0); | |
| } | | } | |
| | | | |
| /* | | /* | |
| * Special values for xfs_bmbt_irec_t br_startblock field. | | * Special values for xfs_bmbt_irec_t br_startblock field. | |
| */ | | */ | |
| #define DELAYSTARTBLOCK ((xfs_fsblock_t)-1LL) | | #define DELAYSTARTBLOCK ((xfs_fsblock_t)-1LL) | |
| #define HOLESTARTBLOCK ((xfs_fsblock_t)-2LL) | | #define HOLESTARTBLOCK ((xfs_fsblock_t)-2LL) | |
| | | | |
|
| #define XFS_BMAP_INIT(flp,fbp) xfs_bmap_init(flp,fbp) | | | |
| static inline void xfs_bmap_init(xfs_bmap_free_t *flp, xfs_fsblock_t *fbp) | | static inline void xfs_bmap_init(xfs_bmap_free_t *flp, xfs_fsblock_t *fbp) | |
| { | | { | |
| ((flp)->xbf_first = NULL, (flp)->xbf_count = 0, \ | | ((flp)->xbf_first = NULL, (flp)->xbf_count = 0, \ | |
| (flp)->xbf_low = 0, *(fbp) = NULLFSBLOCK); | | (flp)->xbf_low = 0, *(fbp) = NULLFSBLOCK); | |
| } | | } | |
| | | | |
| /* | | /* | |
| * Argument structure for xfs_bmap_alloc. | | * Argument structure for xfs_bmap_alloc. | |
| */ | | */ | |
| typedef struct xfs_bmalloca { | | typedef struct xfs_bmalloca { | |
| xfs_fsblock_t firstblock; /* i/o first block allocated */ | | xfs_fsblock_t firstblock; /* i/o first block allocated */ | |
| xfs_fsblock_t rval; /* starting block of new extent */ | | xfs_fsblock_t rval; /* starting block of new extent */ | |
| xfs_fileoff_t off; /* offset in file filling in */ | | xfs_fileoff_t off; /* offset in file filling in */ | |
| struct xfs_trans *tp; /* transaction pointer */ | | struct xfs_trans *tp; /* transaction pointer */ | |
| struct xfs_inode *ip; /* incore inode pointer */ | | struct xfs_inode *ip; /* incore inode pointer */ | |
| struct xfs_bmbt_irec *prevp; /* extent before the new one */ | | struct xfs_bmbt_irec *prevp; /* extent before the new one */ | |
| struct xfs_bmbt_irec *gotp; /* extent after, or delayed */ | | struct xfs_bmbt_irec *gotp; /* extent after, or delayed */ | |
| xfs_extlen_t alen; /* i/o length asked/allocated */ | | xfs_extlen_t alen; /* i/o length asked/allocated */ | |
| xfs_extlen_t total; /* total blocks needed for xaction *
/ | | xfs_extlen_t total; /* total blocks needed for xaction *
/ | |
|
| xfs_extlen_t minlen; /* mininum allocation size (blocks)
*/ | | xfs_extlen_t minlen; /* minimum allocation size (blocks)
*/ | |
| xfs_extlen_t minleft; /* amount must be left after alloc
*/ | | xfs_extlen_t minleft; /* amount must be left after alloc
*/ | |
| char eof; /* set if allocating past last exten
t */ | | char eof; /* set if allocating past last exten
t */ | |
| char wasdel; /* replacing a delayed allocation */ | | char wasdel; /* replacing a delayed allocation */ | |
| char userdata;/* set if is user data */ | | char userdata;/* set if is user data */ | |
| char low; /* low on space, using seq'l ags */ | | char low; /* low on space, using seq'l ags */ | |
| char aeof; /* allocated space at eof */ | | char aeof; /* allocated space at eof */ | |
| char conv; /* overwriting unwritten extents */ | | char conv; /* overwriting unwritten extents */ | |
| } xfs_bmalloca_t; | | } xfs_bmalloca_t; | |
| | | | |
|
| #if defined(__KERNEL__) && defined(XFS_BMAP_TRACE) | | | |
| /* | | /* | |
|
| * Trace operations for bmap extent tracing | | * Flags for xfs_bmap_add_extent*. | |
| */ | | */ | |
|
| #define XFS_BMAP_KTRACE_DELETE 1 | | #define BMAP_LEFT_CONTIG (1 << 0) | |
| #define XFS_BMAP_KTRACE_INSERT 2 | | #define BMAP_RIGHT_CONTIG (1 << 1) | |
| #define XFS_BMAP_KTRACE_PRE_UP 3 | | #define BMAP_LEFT_FILLING (1 << 2) | |
| #define XFS_BMAP_KTRACE_POST_UP 4 | | #define BMAP_RIGHT_FILLING (1 << 3) | |
| | | #define BMAP_LEFT_DELAY (1 << 4) | |
| #define XFS_BMAP_TRACE_SIZE 4096 /* size of global trace buff | | #define BMAP_RIGHT_DELAY (1 << 5) | |
| er */ | | #define BMAP_LEFT_VALID (1 << 6) | |
| #define XFS_BMAP_KTRACE_SIZE 32 /* size of per-inode trace b | | #define BMAP_RIGHT_VALID (1 << 7) | |
| uffer */ | | #define BMAP_ATTRFORK (1 << 8) | |
| extern ktrace_t *xfs_bmap_trace_buf; | | | |
| | | #define XFS_BMAP_EXT_FLAGS \ | |
| | | { BMAP_LEFT_CONTIG, "LC" }, \ | |
| | | { BMAP_RIGHT_CONTIG, "RC" }, \ | |
| | | { BMAP_LEFT_FILLING, "LF" }, \ | |
| | | { BMAP_RIGHT_FILLING, "RF" }, \ | |
| | | { BMAP_ATTRFORK, "ATTR" } | |
| | | | |
| /* | | /* | |
| * Add bmap trace insert entries for all the contents of the extent list. | | * Add bmap trace insert entries for all the contents of the extent list. | |
|
| | | * | |
| | | * Quite excessive tracing. Only do this for debug builds. | |
| */ | | */ | |
|
| | | #if defined(__KERNEL) && defined(DEBUG) | |
| void | | void | |
| xfs_bmap_trace_exlist( | | xfs_bmap_trace_exlist( | |
|
| const char *fname, /* function name */ | | | |
| struct xfs_inode *ip, /* incore inode pointer */ | | struct xfs_inode *ip, /* incore inode pointer */ | |
| xfs_extnum_t cnt, /* count of entries in list
*/ | | xfs_extnum_t cnt, /* count of entries in list
*/ | |
|
| int whichfork); /* data or attr fork */ | | int whichfork, | |
| | | unsigned long caller_ip); /* data or attr fork */ | |
| #define XFS_BMAP_TRACE_EXLIST(ip,c,w) \ | | #define XFS_BMAP_TRACE_EXLIST(ip,c,w) \ | |
|
| xfs_bmap_trace_exlist(__func__,ip,c,w) | | xfs_bmap_trace_exlist(ip,c,w, _THIS_IP_) | |
| | | #else | |
| #else /* __KERNEL__ && XFS_BMAP_TRACE */ | | | |
| | | | |
| #define XFS_BMAP_TRACE_EXLIST(ip,c,w) | | #define XFS_BMAP_TRACE_EXLIST(ip,c,w) | |
|
| | | #endif | |
| #endif /* __KERNEL__ && XFS_BMAP_TRACE */ | | | |
| | | | |
| /* | | /* | |
| * Convert inode from non-attributed to attributed. | | * Convert inode from non-attributed to attributed. | |
| * Must not be in a transaction, ip must not be locked. | | * Must not be in a transaction, ip must not be locked. | |
| */ | | */ | |
| int /* error code */ | | int /* error code */ | |
| xfs_bmap_add_attrfork( | | xfs_bmap_add_attrfork( | |
| struct xfs_inode *ip, /* incore inode pointer */ | | struct xfs_inode *ip, /* incore inode pointer */ | |
| int size, /* space needed for new attribute */ | | int size, /* space needed for new attribute */ | |
| int rsvd); /* flag for reserved block allocatio
n */ | | int rsvd); /* flag for reserved block allocatio
n */ | |
| | | | |
| skipping to change at line 293 | | skipping to change at line 296 | |
| struct xfs_trans *tp, /* transaction pointer */ | | struct xfs_trans *tp, /* transaction pointer */ | |
| struct xfs_inode *ip, /* incore inode */ | | struct xfs_inode *ip, /* incore inode */ | |
| xfs_fileoff_t bno, /* starting file offs. mappe
d */ | | xfs_fileoff_t bno, /* starting file offs. mappe
d */ | |
| xfs_filblks_t len, /* length to map in file */ | | xfs_filblks_t len, /* length to map in file */ | |
| int flags, /* XFS_BMAPI_... */ | | int flags, /* XFS_BMAPI_... */ | |
| xfs_fsblock_t *firstblock, /* first allocated block | | xfs_fsblock_t *firstblock, /* first allocated block | |
| controls a.g. for allocs
*/ | | controls a.g. for allocs
*/ | |
| xfs_extlen_t total, /* total blocks needed */ | | xfs_extlen_t total, /* total blocks needed */ | |
| struct xfs_bmbt_irec *mval, /* output: map values */ | | struct xfs_bmbt_irec *mval, /* output: map values */ | |
| int *nmap, /* i/o: mval size/count */ | | int *nmap, /* i/o: mval size/count */ | |
|
| xfs_bmap_free_t *flist, /* i/o: list extents to free | | xfs_bmap_free_t *flist); /* i/o: list extents to free | |
| */ | | */ | |
| xfs_extdelta_t *delta); /* o: change made to incore | | | |
| extents */ | | | |
| | | | |
| /* | | /* | |
| * Map file blocks to filesystem blocks, simple version. | | * Map file blocks to filesystem blocks, simple version. | |
| * One block only, read-only. | | * One block only, read-only. | |
| * For flags, only the XFS_BMAPI_ATTRFORK flag is examined. | | * For flags, only the XFS_BMAPI_ATTRFORK flag is examined. | |
| * For the other flag values, the effect is as if XFS_BMAPI_METADATA | | * For the other flag values, the effect is as if XFS_BMAPI_METADATA | |
| * was set and all the others were clear. | | * was set and all the others were clear. | |
| */ | | */ | |
| int /* error */ | | int /* error */ | |
| xfs_bmapi_single( | | xfs_bmapi_single( | |
| | | | |
| skipping to change at line 329 | | skipping to change at line 330 | |
| xfs_bunmapi( | | xfs_bunmapi( | |
| struct xfs_trans *tp, /* transaction pointer */ | | struct xfs_trans *tp, /* transaction pointer */ | |
| struct xfs_inode *ip, /* incore inode */ | | struct xfs_inode *ip, /* incore inode */ | |
| xfs_fileoff_t bno, /* starting offset to unmap
*/ | | xfs_fileoff_t bno, /* starting offset to unmap
*/ | |
| xfs_filblks_t len, /* length to unmap in file *
/ | | xfs_filblks_t len, /* length to unmap in file *
/ | |
| int flags, /* XFS_BMAPI_... */ | | int flags, /* XFS_BMAPI_... */ | |
| xfs_extnum_t nexts, /* number of extents max */ | | xfs_extnum_t nexts, /* number of extents max */ | |
| xfs_fsblock_t *firstblock, /* first allocated block | | xfs_fsblock_t *firstblock, /* first allocated block | |
| controls a.g. for allocs
*/ | | controls a.g. for allocs
*/ | |
| xfs_bmap_free_t *flist, /* i/o: list extents to free
*/ | | xfs_bmap_free_t *flist, /* i/o: list extents to free
*/ | |
|
| xfs_extdelta_t *delta, /* o: change made to incore | | | |
| extents */ | | | |
| int *done); /* set if not done yet */ | | int *done); /* set if not done yet */ | |
| | | | |
| /* | | /* | |
| * Check an extent list, which has just been read, for | | * Check an extent list, which has just been read, for | |
| * any bit in the extent flag field. | | * any bit in the extent flag field. | |
| */ | | */ | |
| int | | int | |
| xfs_check_nostate_extents( | | xfs_check_nostate_extents( | |
| struct xfs_ifork *ifp, | | struct xfs_ifork *ifp, | |
| xfs_extnum_t idx, | | xfs_extnum_t idx, | |
| xfs_extnum_t num); | | xfs_extnum_t num); | |
| | | | |
|
| | | uint | |
| | | xfs_default_attroffset( | |
| | | struct xfs_inode *ip); | |
| | | | |
| #ifdef __KERNEL__ | | #ifdef __KERNEL__ | |
| | | | |
| /* | | /* | |
| * Routine to be called at transaction's end by xfs_bmapi, xfs_bunmapi | | * Routine to be called at transaction's end by xfs_bmapi, xfs_bunmapi | |
| * caller. Frees all the extents that need freeing, which must be done | | * caller. Frees all the extents that need freeing, which must be done | |
| * last due to locking considerations. | | * last due to locking considerations. | |
| * | | * | |
| * Return 1 if the given transaction was committed and a new one allocated, | | * Return 1 if the given transaction was committed and a new one allocated, | |
| * and 0 otherwise. | | * and 0 otherwise. | |
| */ | | */ | |
| int /* error */ | | int /* error */ | |
| xfs_bmap_finish( | | xfs_bmap_finish( | |
| struct xfs_trans **tp, /* transaction pointer addr
*/ | | struct xfs_trans **tp, /* transaction pointer addr
*/ | |
| xfs_bmap_free_t *flist, /* i/o: list extents to free
*/ | | xfs_bmap_free_t *flist, /* i/o: list extents to free
*/ | |
| int *committed); /* xact committed or not */ | | int *committed); /* xact committed or not */ | |
| | | | |
|
| | | /* bmap to userspace formatter - copy to user & advance pointer */ | |
| | | typedef int (*xfs_bmap_format_t)(void **, struct getbmapx *, int *); | |
| | | | |
| /* | | /* | |
|
| * Fcntl interface to xfs_bmapi. | | * Get inode's extents as described in bmv, and format for output. | |
| */ | | */ | |
| int /* error code */ | | int /* error code */ | |
| xfs_getbmap( | | xfs_getbmap( | |
| xfs_inode_t *ip, | | xfs_inode_t *ip, | |
|
| struct getbmap *bmv, /* user bmap structure */ | | struct getbmapx *bmv, /* user bmap structure */ | |
| void __user *ap, /* pointer to user's array * | | xfs_bmap_format_t formatter, /* format to user */ | |
| / | | void *arg); /* formatter arg */ | |
| int iflags); /* interface flags */ | | | |
| | | | |
| /* | | /* | |
| * Check if the endoff is outside the last extent. If so the caller will gr
ow | | * Check if the endoff is outside the last extent. If so the caller will gr
ow | |
| * the allocation to a stripe unit boundary | | * the allocation to a stripe unit boundary | |
| */ | | */ | |
| int | | int | |
| xfs_bmap_eof( | | xfs_bmap_eof( | |
| struct xfs_inode *ip, | | struct xfs_inode *ip, | |
| xfs_fileoff_t endoff, | | xfs_fileoff_t endoff, | |
| int whichfork, | | int whichfork, | |
| | | | |
| skipping to change at line 390 | | skipping to change at line 396 | |
| /* | | /* | |
| * Count fsblocks of the given fork. | | * Count fsblocks of the given fork. | |
| */ | | */ | |
| int | | int | |
| xfs_bmap_count_blocks( | | xfs_bmap_count_blocks( | |
| xfs_trans_t *tp, | | xfs_trans_t *tp, | |
| struct xfs_inode *ip, | | struct xfs_inode *ip, | |
| int whichfork, | | int whichfork, | |
| int *count); | | int *count); | |
| | | | |
|
| /* | | int | |
| * Search the extent records for the entry containing block bno. | | xfs_bmap_punch_delalloc_range( | |
| * If bno lies in a hole, point to the next entry. If bno lies | | struct xfs_inode *ip, | |
| * past eof, *eofp will be set, and *prevp will contain the last | | xfs_fileoff_t start_fsb, | |
| * entry (null if none). Else, *lastxp will be set to the index | | xfs_fileoff_t length); | |
| * of the found entry; *gotp will contain the entry. | | | |
| */ | | | |
| xfs_bmbt_rec_host_t * | | | |
| xfs_bmap_search_multi_extents(struct xfs_ifork *, xfs_fileoff_t, int *, | | | |
| xfs_extnum_t *, xfs_bmbt_irec_t *, xfs_bmbt_irec_t * | | | |
| ); | | | |
| | | | |
| #endif /* __KERNEL__ */ | | #endif /* __KERNEL__ */ | |
| | | | |
| #endif /* __XFS_BMAP_H__ */ | | #endif /* __XFS_BMAP_H__ */ | |
| | | | |
End of changes. 22 change blocks. |
| 78 lines changed or deleted | | 72 lines changed or added | |
|
| xfs_dinode.h | | xfs_dinode.h | |
| | | | |
| skipping to change at line 21 | | skipping to change at line 21 | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| * GNU General Public License for more details. | | * GNU General Public License for more details. | |
| * | | * | |
| * You should have received a copy of the GNU General Public License | | * You should have received a copy of the GNU General Public License | |
| * along with this program; if not, write the Free Software Foundation, | | * along with this program; if not, write the Free Software Foundation, | |
| * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
| */ | | */ | |
| #ifndef __XFS_DINODE_H__ | | #ifndef __XFS_DINODE_H__ | |
| #define __XFS_DINODE_H__ | | #define __XFS_DINODE_H__ | |
| | | | |
|
| struct xfs_buf; | | #define XFS_DINODE_MAGIC 0x494e /* 'IN' */ | |
| struct xfs_mount; | | #define XFS_DINODE_GOOD_VERSION(v) (((v) == 1 || (v) == 2)) | |
| | | | |
|
| #define XFS_DINODE_VERSION_1 1 | | | |
| #define XFS_DINODE_VERSION_2 2 | | | |
| #define XFS_DINODE_GOOD_VERSION(v) \ | | | |
| (((v) == XFS_DINODE_VERSION_1 || (v) == XFS_DINODE_VERSION_2)) | | | |
| #define XFS_DINODE_MAGIC 0x494e /* 'IN' */ | | | |
| | | | |
| /* | | | |
| * Disk inode structure. | | | |
| * This is just the header; the inode is expanded to fill a variable size | | | |
| * with the last field expanding. It is split into the core and "other" | | | |
| * because we only need the core part in the in-core inode. | | | |
| */ | | | |
| typedef struct xfs_timestamp { | | typedef struct xfs_timestamp { | |
| __be32 t_sec; /* timestamp seconds */ | | __be32 t_sec; /* timestamp seconds */ | |
| __be32 t_nsec; /* timestamp nanoseconds */ | | __be32 t_nsec; /* timestamp nanoseconds */ | |
| } xfs_timestamp_t; | | } xfs_timestamp_t; | |
| | | | |
| /* | | /* | |
|
| * Note: Coordinate changes to this structure with the XFS_DI_* #defines | | * On-disk inode structure. | |
| * below, the offsets table in xfs_ialloc_log_di() and struct xfs_icdinode | | * | |
| * in xfs_inode.h. | | * This is just the header or "dinode core", the inode is expanded to fill | |
| | | a | |
| | | * variable size the leftover area split into a data and an attribute fork. | |
| | | * The format of the data and attribute fork depends on the format of the | |
| | | * inode as indicated by di_format and di_aformat. To access the data and | |
| | | * attribute use the XFS_DFORK_PTR, XFS_DFORK_DPTR, and XFS_DFORK_PTR macro | |
| | | s | |
| | | * below. | |
| | | * | |
| | | * There is a very similar struct icdinode in xfs_inode which matches the | |
| | | * layout of the first 96 bytes of this structure, but is kept in native | |
| | | * format instead of big endian. | |
| */ | | */ | |
|
| typedef struct xfs_dinode_core { | | typedef struct xfs_dinode { | |
| __be16 di_magic; /* inode magic # = XFS_DINODE_MAGIC
*/ | | __be16 di_magic; /* inode magic # = XFS_DINODE_MAGIC
*/ | |
| __be16 di_mode; /* mode and type of file */ | | __be16 di_mode; /* mode and type of file */ | |
| __u8 di_version; /* inode version */ | | __u8 di_version; /* inode version */ | |
| __u8 di_format; /* format of di_c data */ | | __u8 di_format; /* format of di_c data */ | |
| __be16 di_onlink; /* old number of links to file */ | | __be16 di_onlink; /* old number of links to file */ | |
| __be32 di_uid; /* owner's user id */ | | __be32 di_uid; /* owner's user id */ | |
| __be32 di_gid; /* owner's group id */ | | __be32 di_gid; /* owner's group id */ | |
| __be32 di_nlink; /* number of links to file */ | | __be32 di_nlink; /* number of links to file */ | |
| __be16 di_projid_lo; /* lower part of owner's project id
*/ | | __be16 di_projid_lo; /* lower part of owner's project id
*/ | |
| __be16 di_projid_hi; /* higher part owner's project id */ | | __be16 di_projid_hi; /* higher part owner's project id */ | |
| | | | |
| skipping to change at line 73 | | skipping to change at line 70 | |
| __be64 di_nblocks; /* # of direct & btree blocks used *
/ | | __be64 di_nblocks; /* # of direct & btree blocks used *
/ | |
| __be32 di_extsize; /* basic/minimum extent size for fil
e */ | | __be32 di_extsize; /* basic/minimum extent size for fil
e */ | |
| __be32 di_nextents; /* number of extents in data fork */ | | __be32 di_nextents; /* number of extents in data fork */ | |
| __be16 di_anextents; /* number of extents in attribute fo
rk*/ | | __be16 di_anextents; /* number of extents in attribute fo
rk*/ | |
| __u8 di_forkoff; /* attr fork offs, <<3 for 64b align
*/ | | __u8 di_forkoff; /* attr fork offs, <<3 for 64b align
*/ | |
| __s8 di_aformat; /* format of attr fork's data */ | | __s8 di_aformat; /* format of attr fork's data */ | |
| __be32 di_dmevmask; /* DMIG event mask */ | | __be32 di_dmevmask; /* DMIG event mask */ | |
| __be16 di_dmstate; /* DMIG state info */ | | __be16 di_dmstate; /* DMIG state info */ | |
| __be16 di_flags; /* random flags, XFS_DIFLAG_... */ | | __be16 di_flags; /* random flags, XFS_DIFLAG_... */ | |
| __be32 di_gen; /* generation number */ | | __be32 di_gen; /* generation number */ | |
|
| } xfs_dinode_core_t; | | | |
| | | | |
|
| #define DI_MAX_FLUSH 0xffff | | /* di_next_unlinked is the only non-core field in the old dinode */ | |
| | | __be32 di_next_unlinked;/* agi unlinked list ptr */ | |
| | | } __attribute__((packed)) xfs_dinode_t; | |
| | | | |
|
| typedef struct xfs_dinode | | #define DI_MAX_FLUSH 0xffff | |
| { | | | |
| xfs_dinode_core_t di_core; | | | |
| /* | | | |
| * In adding anything between the core and the union, be | | | |
| * sure to update the macros like XFS_LITINO below. | | | |
| */ | | | |
| __be32 di_next_unlinked;/* agi unlinked list ptr */ | | | |
| union { | | | |
| xfs_bmdr_block_t di_bmbt; /* btree root block */ | | | |
| xfs_bmbt_rec_32_t di_bmx[1]; /* extent list */ | | | |
| xfs_dir2_sf_t di_dir2sf; /* shortform directory v2 */ | | | |
| char di_c[1]; /* local contents */ | | | |
| __be32 di_dev; /* device for S_IFCHR/S_IFBL | | | |
| K */ | | | |
| uuid_t di_muuid; /* mount point value */ | | | |
| char di_symlink[1]; /* local symbolic link */ | | | |
| } di_u; | | | |
| union { | | | |
| xfs_bmdr_block_t di_abmbt; /* btree root block */ | | | |
| xfs_bmbt_rec_32_t di_abmx[1]; /* extent list */ | | | |
| xfs_attr_shortform_t di_attrsf; /* shortform attribute list | | | |
| */ | | | |
| } di_a; | | | |
| } xfs_dinode_t; | | | |
| | | | |
| /* | | /* | |
| * The 32 bit link count in the inode theoretically maxes out at UINT_MAX. | | * The 32 bit link count in the inode theoretically maxes out at UINT_MAX. | |
| * Since the pathconf interface is signed, we use 2^31 - 1 instead. | | * Since the pathconf interface is signed, we use 2^31 - 1 instead. | |
| * The old inode format had a 16 bit link count, so its maximum is USHRT_MA
X. | | * The old inode format had a 16 bit link count, so its maximum is USHRT_MA
X. | |
| */ | | */ | |
| #define XFS_MAXLINK ((1U << 31) - 1U) | | #define XFS_MAXLINK ((1U << 31) - 1U) | |
| #define XFS_MAXLINK_1 65535U | | #define XFS_MAXLINK_1 65535U | |
| | | | |
| /* | | /* | |
|
| * Bit names for logging disk inodes only | | | |
| */ | | | |
| #define XFS_DI_MAGIC 0x0000001 | | | |
| #define XFS_DI_MODE 0x0000002 | | | |
| #define XFS_DI_VERSION 0x0000004 | | | |
| #define XFS_DI_FORMAT 0x0000008 | | | |
| #define XFS_DI_ONLINK 0x0000010 | | | |
| #define XFS_DI_UID 0x0000020 | | | |
| #define XFS_DI_GID 0x0000040 | | | |
| #define XFS_DI_NLINK 0x0000080 | | | |
| #define XFS_DI_PROJID 0x0000100 | | | |
| #define XFS_DI_PAD 0x0000200 | | | |
| #define XFS_DI_ATIME 0x0000400 | | | |
| #define XFS_DI_MTIME 0x0000800 | | | |
| #define XFS_DI_CTIME 0x0001000 | | | |
| #define XFS_DI_SIZE 0x0002000 | | | |
| #define XFS_DI_NBLOCKS 0x0004000 | | | |
| #define XFS_DI_EXTSIZE 0x0008000 | | | |
| #define XFS_DI_NEXTENTS 0x0010000 | | | |
| #define XFS_DI_NAEXTENTS 0x0020000 | | | |
| #define XFS_DI_FORKOFF 0x0040000 | | | |
| #define XFS_DI_AFORMAT 0x0080000 | | | |
| #define XFS_DI_DMEVMASK 0x0100000 | | | |
| #define XFS_DI_DMSTATE 0x0200000 | | | |
| #define XFS_DI_FLAGS 0x0400000 | | | |
| #define XFS_DI_GEN 0x0800000 | | | |
| #define XFS_DI_NEXT_UNLINKED 0x1000000 | | | |
| #define XFS_DI_U 0x2000000 | | | |
| #define XFS_DI_A 0x4000000 | | | |
| #define XFS_DI_NUM_BITS 27 | | | |
| #define XFS_DI_ALL_BITS ((1 << XFS_DI_NUM_BITS) - 1) | | | |
| #define XFS_DI_CORE_BITS (XFS_DI_ALL_BITS & ~(XFS_DI_U|XFS_DI | | | |
| _A)) | | | |
| | | | |
| /* | | | |
| * Values for di_format | | * Values for di_format | |
| */ | | */ | |
|
| typedef enum xfs_dinode_fmt | | typedef enum xfs_dinode_fmt { | |
| { | | XFS_DINODE_FMT_DEV, /* xfs_dev_t */ | |
| XFS_DINODE_FMT_DEV, /* CHR, BLK: di_dev */ | | XFS_DINODE_FMT_LOCAL, /* bulk data */ | |
| XFS_DINODE_FMT_LOCAL, /* DIR, REG: di_c */ | | XFS_DINODE_FMT_EXTENTS, /* struct xfs_bmbt_rec */ | |
| /* LNK: di_symlink */ | | XFS_DINODE_FMT_BTREE, /* struct xfs_bmdr_block */ | |
| XFS_DINODE_FMT_EXTENTS, /* DIR, REG, LNK: di_bmx */ | | XFS_DINODE_FMT_UUID /* uuid_t */ | |
| XFS_DINODE_FMT_BTREE, /* DIR, REG, LNK: di_bmbt */ | | | |
| XFS_DINODE_FMT_UUID /* MNT: di_uuid */ | | | |
| } xfs_dinode_fmt_t; | | } xfs_dinode_fmt_t; | |
| | | | |
| /* | | /* | |
| * Inode minimum and maximum sizes. | | * Inode minimum and maximum sizes. | |
| */ | | */ | |
| #define XFS_DINODE_MIN_LOG 8 | | #define XFS_DINODE_MIN_LOG 8 | |
| #define XFS_DINODE_MAX_LOG 11 | | #define XFS_DINODE_MAX_LOG 11 | |
| #define XFS_DINODE_MIN_SIZE (1 << XFS_DINODE_MIN_LOG) | | #define XFS_DINODE_MIN_SIZE (1 << XFS_DINODE_MIN_LOG) | |
| #define XFS_DINODE_MAX_SIZE (1 << XFS_DINODE_MAX_LOG) | | #define XFS_DINODE_MAX_SIZE (1 << XFS_DINODE_MAX_LOG) | |
| | | | |
| /* | | /* | |
| * Inode size for given fs. | | * Inode size for given fs. | |
| */ | | */ | |
|
| #define XFS_LITINO(mp) ((mp)->m_litino) | | #define XFS_LITINO(mp) \ | |
| | | ((int)(((mp)->m_sb.sb_inodesize) - sizeof(struct xfs_dinode))) | |
| | | | |
| #define XFS_BROOT_SIZE_ADJ \ | | #define XFS_BROOT_SIZE_ADJ \ | |
| (XFS_BTREE_LBLOCK_LEN - sizeof(xfs_bmdr_block_t)) | | (XFS_BTREE_LBLOCK_LEN - sizeof(xfs_bmdr_block_t)) | |
| | | | |
| /* | | /* | |
| * Inode data & attribute fork sizes, per inode. | | * Inode data & attribute fork sizes, per inode. | |
| */ | | */ | |
|
| #define XFS_DFORK_Q(dip) ((dip)->di_core.di_forkoff != 0) | | #define XFS_DFORK_Q(dip) ((dip)->di_forkoff != 0) | |
| #define XFS_DFORK_BOFF(dip) ((int)((dip)->di_core.di_forkoff << | | #define XFS_DFORK_BOFF(dip) ((int)((dip)->di_forkoff << 3)) | |
| 3)) | | | |
| | | | |
| #define XFS_DFORK_DSIZE(dip,mp) \ | | #define XFS_DFORK_DSIZE(dip,mp) \ | |
| (XFS_DFORK_Q(dip) ? \ | | (XFS_DFORK_Q(dip) ? \ | |
| XFS_DFORK_BOFF(dip) : \ | | XFS_DFORK_BOFF(dip) : \ | |
| XFS_LITINO(mp)) | | XFS_LITINO(mp)) | |
| #define XFS_DFORK_ASIZE(dip,mp) \ | | #define XFS_DFORK_ASIZE(dip,mp) \ | |
| (XFS_DFORK_Q(dip) ? \ | | (XFS_DFORK_Q(dip) ? \ | |
| XFS_LITINO(mp) - XFS_DFORK_BOFF(dip) : \ | | XFS_LITINO(mp) - XFS_DFORK_BOFF(dip) : \ | |
| 0) | | 0) | |
| #define XFS_DFORK_SIZE(dip,mp,w) \ | | #define XFS_DFORK_SIZE(dip,mp,w) \ | |
| ((w) == XFS_DATA_FORK ? \ | | ((w) == XFS_DATA_FORK ? \ | |
| XFS_DFORK_DSIZE(dip, mp) : \ | | XFS_DFORK_DSIZE(dip, mp) : \ | |
| XFS_DFORK_ASIZE(dip, mp)) | | XFS_DFORK_ASIZE(dip, mp)) | |
| | | | |
|
| #define XFS_DFORK_DPTR(dip) ((dip)->di_u.di_c) | | /* | |
| | | * Return pointers to the data or attribute forks. | |
| | | */ | |
| | | #define XFS_DFORK_DPTR(dip) \ | |
| | | ((char *)(dip) + sizeof(struct xfs_dinode)) | |
| #define XFS_DFORK_APTR(dip) \ | | #define XFS_DFORK_APTR(dip) \ | |
|
| ((dip)->di_u.di_c + XFS_DFORK_BOFF(dip)) | | (XFS_DFORK_DPTR(dip) + XFS_DFORK_BOFF(dip)) | |
| #define XFS_DFORK_PTR(dip,w) \ | | #define XFS_DFORK_PTR(dip,w) \ | |
| ((w) == XFS_DATA_FORK ? XFS_DFORK_DPTR(dip) : XFS_DFORK_APTR(dip)) | | ((w) == XFS_DATA_FORK ? XFS_DFORK_DPTR(dip) : XFS_DFORK_APTR(dip)) | |
|
| | | | |
| #define XFS_DFORK_FORMAT(dip,w) \ | | #define XFS_DFORK_FORMAT(dip,w) \ | |
| ((w) == XFS_DATA_FORK ? \ | | ((w) == XFS_DATA_FORK ? \ | |
|
| (dip)->di_core.di_format : \ | | (dip)->di_format : \ | |
| (dip)->di_core.di_aformat) | | (dip)->di_aformat) | |
| #define XFS_DFORK_NEXTENTS(dip,w) \ | | #define XFS_DFORK_NEXTENTS(dip,w) \ | |
| ((w) == XFS_DATA_FORK ? \ | | ((w) == XFS_DATA_FORK ? \ | |
|
| be32_to_cpu((dip)->di_core.di_nextents) : \ | | be32_to_cpu((dip)->di_nextents) : \ | |
| be16_to_cpu((dip)->di_core.di_anextents)) | | be16_to_cpu((dip)->di_anextents)) | |
| | | | |
| #define XFS_BUF_TO_DINODE(bp) ((xfs_dinode_t *)XFS_BUF_PTR(bp)) | | #define XFS_BUF_TO_DINODE(bp) ((xfs_dinode_t *)XFS_BUF_PTR(bp)) | |
| | | | |
| /* | | /* | |
|
| | | * For block and character special files the 32bit dev_t is stored at the | |
| | | * beginning of the data fork. | |
| | | */ | |
| | | static inline xfs_dev_t xfs_dinode_get_rdev(struct xfs_dinode *dip) | |
| | | { | |
| | | return be32_to_cpu(*(__be32 *)XFS_DFORK_DPTR(dip)); | |
| | | } | |
| | | | |
| | | static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rd | |
| | | ev) | |
| | | { | |
| | | *(__be32 *)XFS_DFORK_DPTR(dip) = cpu_to_be32(rdev); | |
| | | } | |
| | | | |
| | | /* | |
| * Values for di_flags | | * Values for di_flags | |
| * There should be a one-to-one correspondence between these flags and the | | * There should be a one-to-one correspondence between these flags and the | |
| * XFS_XFLAG_s. | | * XFS_XFLAG_s. | |
| */ | | */ | |
| #define XFS_DIFLAG_REALTIME_BIT 0 /* file's blocks come from rt area *
/ | | #define XFS_DIFLAG_REALTIME_BIT 0 /* file's blocks come from rt area *
/ | |
| #define XFS_DIFLAG_PREALLOC_BIT 1 /* file space has been preallocated
*/ | | #define XFS_DIFLAG_PREALLOC_BIT 1 /* file space has been preallocated
*/ | |
| #define XFS_DIFLAG_NEWRTBM_BIT 2 /* for rtbitmap inode, new format */ | | #define XFS_DIFLAG_NEWRTBM_BIT 2 /* for rtbitmap inode, new format */ | |
| #define XFS_DIFLAG_IMMUTABLE_BIT 3 /* inode is immutable */ | | #define XFS_DIFLAG_IMMUTABLE_BIT 3 /* inode is immutable */ | |
| #define XFS_DIFLAG_APPEND_BIT 4 /* inode is append-only */ | | #define XFS_DIFLAG_APPEND_BIT 4 /* inode is append-only */ | |
| #define XFS_DIFLAG_SYNC_BIT 5 /* inode is written synchronously */ | | #define XFS_DIFLAG_SYNC_BIT 5 /* inode is written synchronously */ | |
| | | | |
End of changes. 17 change blocks. |
| 98 lines changed or deleted | | 58 lines changed or added | |
|
| xfs_inode.h | | xfs_inode.h | |
| | | | |
| skipping to change at line 21 | | skipping to change at line 21 | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| * GNU General Public License for more details. | | * GNU General Public License for more details. | |
| * | | * | |
| * You should have received a copy of the GNU General Public License | | * You should have received a copy of the GNU General Public License | |
| * along with this program; if not, write the Free Software Foundation, | | * along with this program; if not, write the Free Software Foundation, | |
| * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
| */ | | */ | |
| #ifndef __XFS_INODE_H__ | | #ifndef __XFS_INODE_H__ | |
| #define __XFS_INODE_H__ | | #define __XFS_INODE_H__ | |
| | | | |
|
| | | struct posix_acl; | |
| struct xfs_dinode; | | struct xfs_dinode; | |
|
| struct xfs_dinode_core; | | | |
| struct xfs_inode; | | struct xfs_inode; | |
| | | | |
| /* | | /* | |
| * Fork identifiers. | | * Fork identifiers. | |
| */ | | */ | |
| #define XFS_DATA_FORK 0 | | #define XFS_DATA_FORK 0 | |
| #define XFS_ATTR_FORK 1 | | #define XFS_ATTR_FORK 1 | |
| | | | |
| /* | | /* | |
| * The following xfs_ext_irec_t struct introduces a second (top) level | | * The following xfs_ext_irec_t struct introduces a second (top) level | |
| | | | |
| skipping to change at line 87 | | skipping to change at line 87 | |
| xfs_bmbt_rec_host_t if_inline_ext[XFS_INLINE_EXTS]; | | xfs_bmbt_rec_host_t if_inline_ext[XFS_INLINE_EXTS]; | |
| /* very small file extents *
/ | | /* very small file extents *
/ | |
| char if_inline_data[XFS_INLINE_DATA]; | | char if_inline_data[XFS_INLINE_DATA]; | |
| /* very small file data */ | | /* very small file data */ | |
| xfs_dev_t if_rdev; /* dev number if special */ | | xfs_dev_t if_rdev; /* dev number if special */ | |
| uuid_t if_uuid; /* mount point value */ | | uuid_t if_uuid; /* mount point value */ | |
| } if_u2; | | } if_u2; | |
| } xfs_ifork_t; | | } xfs_ifork_t; | |
| | | | |
| /* | | /* | |
|
| | | * Inode location information. Stored in the inode and passed to | |
| | | * xfs_imap_to_bp() to get a buffer and dinode for a given inode. | |
| | | */ | |
| | | struct xfs_imap { | |
| | | xfs_daddr_t im_blkno; /* starting BB of inode chunk */ | |
| | | ushort im_len; /* length in BBs of inode chunk */ | |
| | | ushort im_boffset; /* inode offset in block in bytes */ | |
| | | }; | |
| | | | |
| | | /* | |
| * This is the xfs in-core inode structure. | | * This is the xfs in-core inode structure. | |
| * Most of the on-disk inode is embedded in the i_d field. | | * Most of the on-disk inode is embedded in the i_d field. | |
| * | | * | |
| * The extent pointers/inline file space, however, are managed | | * The extent pointers/inline file space, however, are managed | |
| * separately. The memory for this information is pointed to by | | * separately. The memory for this information is pointed to by | |
| * the if_u1 unions depending on the type of the data. | | * the if_u1 unions depending on the type of the data. | |
| * This is used to linearize the array of extents for fast in-core | | * This is used to linearize the array of extents for fast in-core | |
| * access. This is used until the file's number of extents | | * access. This is used until the file's number of extents | |
| * surpasses XFS_MAX_INCORE_EXTENTS, at which point all extent pointers | | * surpasses XFS_MAX_INCORE_EXTENTS, at which point all extent pointers | |
| * are accessed through the buffer cache. | | * are accessed through the buffer cache. | |
| | | | |
| skipping to change at line 115 | | skipping to change at line 125 | |
| * i_mnext and i_mprev fields, it is used as a marker in the inode | | * i_mnext and i_mprev fields, it is used as a marker in the inode | |
| * chain off the mount structure by xfs_sync calls. | | * chain off the mount structure by xfs_sync calls. | |
| */ | | */ | |
| | | | |
| typedef struct xfs_ictimestamp { | | typedef struct xfs_ictimestamp { | |
| __int32_t t_sec; /* timestamp seconds */ | | __int32_t t_sec; /* timestamp seconds */ | |
| __int32_t t_nsec; /* timestamp nanoseconds */ | | __int32_t t_nsec; /* timestamp nanoseconds */ | |
| } xfs_ictimestamp_t; | | } xfs_ictimestamp_t; | |
| | | | |
| /* | | /* | |
|
| * NOTE: This structure must be kept identical to struct xfs_dinode_core | | * NOTE: This structure must be kept identical to struct xfs_dinode | |
| * in xfs_dinode.h except for the endianess annotations. | | * in xfs_dinode.h except for the endianness annotations. | |
| */ | | */ | |
| typedef struct xfs_icdinode { | | typedef struct xfs_icdinode { | |
| __uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC
*/ | | __uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC
*/ | |
| __uint16_t di_mode; /* mode and type of file */ | | __uint16_t di_mode; /* mode and type of file */ | |
| __int8_t di_version; /* inode version */ | | __int8_t di_version; /* inode version */ | |
| __int8_t di_format; /* format of di_c data */ | | __int8_t di_format; /* format of di_c data */ | |
| __uint16_t di_onlink; /* old number of links to file */ | | __uint16_t di_onlink; /* old number of links to file */ | |
| __uint32_t di_uid; /* owner's user id */ | | __uint32_t di_uid; /* owner's user id */ | |
| __uint32_t di_gid; /* owner's group id */ | | __uint32_t di_gid; /* owner's group id */ | |
| __uint32_t di_nlink; /* number of links to file */ | | __uint32_t di_nlink; /* number of links to file */ | |
| | | | |
| skipping to change at line 162 | | skipping to change at line 172 | |
| | | | |
| /* | | /* | |
| * Per-fork incore inode flags. | | * Per-fork incore inode flags. | |
| */ | | */ | |
| #define XFS_IFINLINE 0x01 /* Inline data is read in */ | | #define XFS_IFINLINE 0x01 /* Inline data is read in */ | |
| #define XFS_IFEXTENTS 0x02 /* All extent pointers are read in *
/ | | #define XFS_IFEXTENTS 0x02 /* All extent pointers are read in *
/ | |
| #define XFS_IFBROOT 0x04 /* i_broot points to the bmap b-tree
root */ | | #define XFS_IFBROOT 0x04 /* i_broot points to the bmap b-tree
root */ | |
| #define XFS_IFEXTIREC 0x08 /* Indirection array of extent block
s */ | | #define XFS_IFEXTIREC 0x08 /* Indirection array of extent block
s */ | |
| | | | |
| /* | | /* | |
|
| * Flags for xfs_itobp(), xfs_imap() and xfs_dilocate(). | | | |
| */ | | | |
| #define XFS_IMAP_LOOKUP 0x1 | | | |
| #define XFS_IMAP_BULKSTAT 0x2 | | | |
| | | | |
| /* | | | |
| * Fork handling. | | * Fork handling. | |
| */ | | */ | |
| | | | |
| #define XFS_IFORK_Q(ip) ((ip)->i_d.di_forkoff != 0) | | #define XFS_IFORK_Q(ip) ((ip)->i_d.di_forkoff != 0) | |
| #define XFS_IFORK_BOFF(ip) ((int)((ip)->i_d.di_forkoff << 3)) | | #define XFS_IFORK_BOFF(ip) ((int)((ip)->i_d.di_forkoff << 3)) | |
| | | | |
| #define XFS_IFORK_PTR(ip,w) \ | | #define XFS_IFORK_PTR(ip,w) \ | |
| ((w) == XFS_DATA_FORK ? \ | | ((w) == XFS_DATA_FORK ? \ | |
| &(ip)->i_df : \ | | &(ip)->i_df : \ | |
| (ip)->i_afp) | | (ip)->i_afp) | |
| | | | |
| skipping to change at line 229 | | skipping to change at line 233 | |
| xfs_set_projid(struct xfs_icdinode *i_d, | | xfs_set_projid(struct xfs_icdinode *i_d, | |
| __uint32_t projid) | | __uint32_t projid) | |
| { | | { | |
| i_d->di_projid_hi = (__uint16_t) (projid >> 16); | | i_d->di_projid_hi = (__uint16_t) (projid >> 16); | |
| i_d->di_projid_lo = (__uint16_t) (projid & 0xffff); | | i_d->di_projid_lo = (__uint16_t) (projid & 0xffff); | |
| } | | } | |
| | | | |
| #ifdef __KERNEL__ | | #ifdef __KERNEL__ | |
| | | | |
| struct bhv_desc; | | struct bhv_desc; | |
|
| struct cred; | | | |
| struct ktrace; | | | |
| struct xfs_buf; | | struct xfs_buf; | |
| struct xfs_bmap_free; | | struct xfs_bmap_free; | |
| struct xfs_bmbt_irec; | | struct xfs_bmbt_irec; | |
| struct xfs_inode_log_item; | | struct xfs_inode_log_item; | |
| struct xfs_mount; | | struct xfs_mount; | |
| struct xfs_trans; | | struct xfs_trans; | |
| struct xfs_dquot; | | struct xfs_dquot; | |
| | | | |
|
| #if defined(XFS_ILOCK_TRACE) | | | |
| #define XFS_ILOCK_KTRACE_SIZE 32 | | | |
| extern ktrace_t *xfs_ilock_trace_buf; | | | |
| extern void xfs_ilock_trace(struct xfs_inode *, int, unsigned int, inst_t * | | | |
| ); | | | |
| #else | | | |
| #define xfs_ilock_trace(i,n,f,ra) | | | |
| #endif | | | |
| | | | |
| typedef struct dm_attrs_s { | | typedef struct dm_attrs_s { | |
| __uint32_t da_dmevmask; /* DMIG event mask */ | | __uint32_t da_dmevmask; /* DMIG event mask */ | |
| __uint16_t da_dmstate; /* DMIG state info */ | | __uint16_t da_dmstate; /* DMIG state info */ | |
| __uint16_t da_pad; /* DMIG extra padding */ | | __uint16_t da_pad; /* DMIG extra padding */ | |
| } dm_attrs_t; | | } dm_attrs_t; | |
| | | | |
|
| typedef struct { | | | |
| struct xfs_inode *ip_mnext; /* next inode in mount list | | | |
| */ | | | |
| struct xfs_inode *ip_mprev; /* ptr to prev inode */ | | | |
| struct xfs_mount *ip_mount; /* fs mount struct ptr */ | | | |
| } xfs_iptr_t; | | | |
| | | | |
| typedef struct xfs_inode { | | typedef struct xfs_inode { | |
| /* Inode linking and identification information. */ | | /* Inode linking and identification information. */ | |
|
| struct xfs_inode *i_mnext; /* next inode in mount list | | | |
| */ | | | |
| struct xfs_inode *i_mprev; /* ptr to prev inode */ | | | |
| struct xfs_mount *i_mount; /* fs mount struct ptr */ | | struct xfs_mount *i_mount; /* fs mount struct ptr */ | |
|
| struct list_head i_reclaim; /* reclaim list */ | | | |
| struct inode *i_vnode; /* vnode backpointer */ | | | |
| struct xfs_dquot *i_udquot; /* user dquot */ | | struct xfs_dquot *i_udquot; /* user dquot */ | |
| struct xfs_dquot *i_gdquot; /* group dquot */ | | struct xfs_dquot *i_gdquot; /* group dquot */ | |
| | | | |
| /* Inode location stuff */ | | /* Inode location stuff */ | |
| xfs_ino_t i_ino; /* inode number (agno/agino)
*/ | | xfs_ino_t i_ino; /* inode number (agno/agino)
*/ | |
|
| xfs_daddr_t i_blkno; /* blkno of inode buffer */ | | struct xfs_imap i_imap; /* location for xfs_imap() * | |
| ushort i_len; /* len of inode buffer */ | | / | |
| ushort i_boffset; /* off of inode in buffer */ | | | |
| | | | |
| /* Extent information. */ | | /* Extent information. */ | |
| xfs_ifork_t *i_afp; /* attribute fork pointer */ | | xfs_ifork_t *i_afp; /* attribute fork pointer */ | |
| xfs_ifork_t i_df; /* data fork */ | | xfs_ifork_t i_df; /* data fork */ | |
| | | | |
| /* Transaction and locking information. */ | | /* Transaction and locking information. */ | |
| struct xfs_trans *i_transp; /* ptr to owning transaction
*/ | | struct xfs_trans *i_transp; /* ptr to owning transaction
*/ | |
| struct xfs_inode_log_item *i_itemp; /* logging information */ | | struct xfs_inode_log_item *i_itemp; /* logging information */ | |
| mrlock_t i_lock; /* inode lock */ | | mrlock_t i_lock; /* inode lock */ | |
| mrlock_t i_iolock; /* inode IO lock */ | | mrlock_t i_iolock; /* inode IO lock */ | |
| struct completion i_flush; /* inode flush completion q
*/ | | struct completion i_flush; /* inode flush completion q
*/ | |
| atomic_t i_pincount; /* inode pin count */ | | atomic_t i_pincount; /* inode pin count */ | |
| wait_queue_head_t i_ipin_wait; /* inode pinning wait queue
*/ | | wait_queue_head_t i_ipin_wait; /* inode pinning wait queue
*/ | |
| spinlock_t i_flags_lock; /* inode i_flags lock */ | | spinlock_t i_flags_lock; /* inode i_flags lock */ | |
| /* Miscellaneous state. */ | | /* Miscellaneous state. */ | |
| unsigned short i_flags; /* see defined flags below *
/ | | unsigned short i_flags; /* see defined flags below *
/ | |
| unsigned char i_update_core; /* timestamps/size is dirty
*/ | | unsigned char i_update_core; /* timestamps/size is dirty
*/ | |
|
| unsigned char i_update_size; /* di_size field is dirty */ | | | |
| unsigned int i_gen; /* generation count */ | | | |
| unsigned int i_delayed_blks; /* count of delay alloc blks
*/ | | unsigned int i_delayed_blks; /* count of delay alloc blks
*/ | |
| | | | |
| xfs_icdinode_t i_d; /* most of ondisk inode */ | | xfs_icdinode_t i_d; /* most of ondisk inode */ | |
| | | | |
| xfs_fsize_t i_size; /* in-memory size */ | | xfs_fsize_t i_size; /* in-memory size */ | |
| xfs_fsize_t i_new_size; /* size when write completes
*/ | | xfs_fsize_t i_new_size; /* size when write completes
*/ | |
| atomic_t i_iocount; /* outstanding I/O count */ | | atomic_t i_iocount; /* outstanding I/O count */ | |
|
| /* Trace buffers per inode. */ | | | |
| #ifdef XFS_INODE_TRACE | | /* VFS inode */ | |
| struct ktrace *i_trace; /* general inode trace */ | | struct inode i_vnode; /* embedded VFS inode */ | |
| #endif | | | |
| #ifdef XFS_BMAP_TRACE | | | |
| struct ktrace *i_xtrace; /* inode extent list trace * | | | |
| / | | | |
| #endif | | | |
| #ifdef XFS_BTREE_TRACE | | | |
| struct ktrace *i_btrace; /* inode bmap btree trace */ | | | |
| #endif | | | |
| #ifdef XFS_RW_TRACE | | | |
| struct ktrace *i_rwtrace; /* inode read/write trace */ | | | |
| #endif | | | |
| #ifdef XFS_ILOCK_TRACE | | | |
| struct ktrace *i_lock_trace; /* inode lock/unlock trace * | | | |
| / | | | |
| #endif | | | |
| #ifdef XFS_DIR2_TRACE | | | |
| struct ktrace *i_dir_trace; /* inode directory trace */ | | | |
| #endif | | | |
| } xfs_inode_t; | | } xfs_inode_t; | |
| | | | |
| #define XFS_ISIZE(ip) (((ip)->i_d.di_mode & S_IFMT) == S_IFREG) ? \ | | #define XFS_ISIZE(ip) (((ip)->i_d.di_mode & S_IFMT) == S_IFREG) ? \ | |
| (ip)->i_size : (ip)->i_d.di_size; | | (ip)->i_size : (ip)->i_d.di_size; | |
| | | | |
| /* Convert from vfs inode to xfs inode */ | | /* Convert from vfs inode to xfs inode */ | |
| static inline struct xfs_inode *XFS_I(struct inode *inode) | | static inline struct xfs_inode *XFS_I(struct inode *inode) | |
| { | | { | |
|
| return (struct xfs_inode *)inode->i_private; | | return container_of(inode, struct xfs_inode, i_vnode); | |
| } | | } | |
| | | | |
| /* convert from xfs inode to vfs inode */ | | /* convert from xfs inode to vfs inode */ | |
| static inline struct inode *VFS_I(struct xfs_inode *ip) | | static inline struct inode *VFS_I(struct xfs_inode *ip) | |
| { | | { | |
|
| return (struct inode *)ip->i_vnode; | | return &ip->i_vnode; | |
| } | | } | |
| | | | |
| /* | | /* | |
| * i_flags helper functions | | * i_flags helper functions | |
| */ | | */ | |
| static inline void | | static inline void | |
| __xfs_iflags_set(xfs_inode_t *ip, unsigned short flags) | | __xfs_iflags_set(xfs_inode_t *ip, unsigned short flags) | |
| { | | { | |
| ip->i_flags |= flags; | | ip->i_flags |= flags; | |
| } | | } | |
| | | | |
| skipping to change at line 391 | | skipping to change at line 355 | |
| | | | |
| spin_lock(&ip->i_flags_lock); | | spin_lock(&ip->i_flags_lock); | |
| ret = ip->i_flags & flags; | | ret = ip->i_flags & flags; | |
| if (ret) | | if (ret) | |
| ip->i_flags &= ~flags; | | ip->i_flags &= ~flags; | |
| spin_unlock(&ip->i_flags_lock); | | spin_unlock(&ip->i_flags_lock); | |
| return ret; | | return ret; | |
| } | | } | |
| | | | |
| /* | | /* | |
|
| | | * Project quota id helpers (previously projid was 16bit only | |
| | | * and using two 16bit values to hold new 32bit projid was choosen | |
| | | * to retain compatibility with "old" filesystems). | |
| | | */ | |
| | | static inline prid_t | |
| | | xfs_get_projid(struct xfs_inode *ip) | |
| | | { | |
| | | return (prid_t)ip->i_d.di_projid_hi << 16 | ip->i_d.di_projid_lo; | |
| | | } | |
| | | | |
| | | static inline void | |
| | | xfs_set_projid(struct xfs_inode *ip, | |
| | | prid_t projid) | |
| | | { | |
| | | ip->i_d.di_projid_hi = (__uint16_t) (projid >> 16); | |
| | | ip->i_d.di_projid_lo = (__uint16_t) (projid & 0xffff); | |
| | | } | |
| | | | |
| | | /* | |
| * Manage the i_flush queue embedded in the inode. This completion | | * Manage the i_flush queue embedded in the inode. This completion | |
| * queue synchronizes processes attempting to flush the in-core | | * queue synchronizes processes attempting to flush the in-core | |
| * inode back to disk. | | * inode back to disk. | |
| */ | | */ | |
| static inline void xfs_iflock(xfs_inode_t *ip) | | static inline void xfs_iflock(xfs_inode_t *ip) | |
| { | | { | |
| wait_for_completion(&ip->i_flush); | | wait_for_completion(&ip->i_flush); | |
| } | | } | |
| | | | |
| static inline int xfs_iflock_nowait(xfs_inode_t *ip) | | static inline int xfs_iflock_nowait(xfs_inode_t *ip) | |
| | | | |
| skipping to change at line 413 | | skipping to change at line 396 | |
| } | | } | |
| | | | |
| static inline void xfs_ifunlock(xfs_inode_t *ip) | | static inline void xfs_ifunlock(xfs_inode_t *ip) | |
| { | | { | |
| complete(&ip->i_flush); | | complete(&ip->i_flush); | |
| } | | } | |
| | | | |
| /* | | /* | |
| * In-core inode flags. | | * In-core inode flags. | |
| */ | | */ | |
|
| #define XFS_IGRIO 0x0001 /* inode used for guaranteed rate i/o */ | | #define XFS_IRECLAIM 0x0001 /* started reclaiming this inode */ | |
| #define XFS_IUIOSZ 0x0002 /* inode i/o sizes have been explicitly set | | #define XFS_ISTALE 0x0002 /* inode has been staled */ | |
| */ | | #define XFS_IRECLAIMABLE 0x0004 /* inode can be reclaimed */ | |
| #define XFS_IQUIESCE 0x0004 /* we have started quiescing for this inode | | #define XFS_INEW 0x0008 /* inode has just been allocated */ | |
| */ | | #define XFS_IFILESTREAM 0x0010 /* inode is in a filestream | |
| #define XFS_IRECLAIM 0x0008 /* we have started reclaiming this inode | | directory */ | |
| */ | | #define XFS_ITRUNCATED 0x0020 /* truncated down so flush-on-close | |
| #define XFS_ISTALE 0x0010 /* inode has been staled */ | | */ | |
| #define XFS_IRECLAIMABLE 0x0020 /* inode can be reclaimed */ | | #define XFS_IDIRTY_RELEASE 0x0040 /* dirty release already seen */ | |
| #define XFS_INEW 0x0040 | | | |
| #define XFS_IFILESTREAM 0x0080 /* inode is in a filestream director | | | |
| y */ | | | |
| #define XFS_IMODIFIED 0x0100 /* XFS inode state possibly differs */ | | | |
| /* to the Linux inode state. */ | | | |
| #define XFS_ITRUNCATED 0x0200 /* truncated down so flush-on-close */ | | | |
| | | | |
| /* | | /* | |
| * Flags for inode locking. | | * Flags for inode locking. | |
| * Bit ranges: 1<<1 - 1<<16-1 -- iolock/ilock modes (bitfield) | | * Bit ranges: 1<<1 - 1<<16-1 -- iolock/ilock modes (bitfield) | |
| * 1<<16 - 1<<32-1 -- lockdep annotation (integers) | | * 1<<16 - 1<<32-1 -- lockdep annotation (integers) | |
| */ | | */ | |
| #define XFS_IOLOCK_EXCL (1<<0) | | #define XFS_IOLOCK_EXCL (1<<0) | |
| #define XFS_IOLOCK_SHARED (1<<1) | | #define XFS_IOLOCK_SHARED (1<<1) | |
| #define XFS_ILOCK_EXCL (1<<2) | | #define XFS_ILOCK_EXCL (1<<2) | |
| #define XFS_ILOCK_SHARED (1<<3) | | #define XFS_ILOCK_SHARED (1<<3) | |
| #define XFS_IUNLOCK_NONOTIFY (1<<4) | | #define XFS_IUNLOCK_NONOTIFY (1<<4) | |
| | | | |
| #define XFS_LOCK_MASK (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED \ | | #define XFS_LOCK_MASK (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED \ | |
| | XFS_ILOCK_EXCL | XFS_ILOCK_SHARED) | | | XFS_ILOCK_EXCL | XFS_ILOCK_SHARED) | |
| | | | |
|
| | | #define XFS_LOCK_FLAGS \ | |
| | | { XFS_IOLOCK_EXCL, "IOLOCK_EXCL" }, \ | |
| | | { XFS_IOLOCK_SHARED, "IOLOCK_SHARED" }, \ | |
| | | { XFS_ILOCK_EXCL, "ILOCK_EXCL" }, \ | |
| | | { XFS_ILOCK_SHARED, "ILOCK_SHARED" }, \ | |
| | | { XFS_IUNLOCK_NONOTIFY, "IUNLOCK_NONOTIFY" } | |
| | | | |
| /* | | /* | |
| * Flags for lockdep annotations. | | * Flags for lockdep annotations. | |
| * | | * | |
| * XFS_I[O]LOCK_PARENT - for operations that require locking two inodes | | * XFS_I[O]LOCK_PARENT - for operations that require locking two inodes | |
| * (ie directory operations that require locking a directory inode and | | * (ie directory operations that require locking a directory inode and | |
| * an entry inode). The first inode gets locked with this flag so it | | * an entry inode). The first inode gets locked with this flag so it | |
| * gets a lockdep subclass of 1 and the second lock will have a lockdep | | * gets a lockdep subclass of 1 and the second lock will have a lockdep | |
| * subclass of 0. | | * subclass of 0. | |
| * | | * | |
| * XFS_LOCK_INUMORDER - for locking several inodes at the some time | | * XFS_LOCK_INUMORDER - for locking several inodes at the some time | |
| | | | |
| skipping to change at line 472 | | skipping to change at line 458 | |
| #define XFS_ILOCK_SHIFT 24 | | #define XFS_ILOCK_SHIFT 24 | |
| #define XFS_ILOCK_PARENT (XFS_LOCK_PARENT << XFS_ILOCK_SHIFT) | | #define XFS_ILOCK_PARENT (XFS_LOCK_PARENT << XFS_ILOCK_SHIFT) | |
| | | | |
| #define XFS_IOLOCK_DEP_MASK 0x00ff0000 | | #define XFS_IOLOCK_DEP_MASK 0x00ff0000 | |
| #define XFS_ILOCK_DEP_MASK 0xff000000 | | #define XFS_ILOCK_DEP_MASK 0xff000000 | |
| #define XFS_LOCK_DEP_MASK (XFS_IOLOCK_DEP_MASK | XFS_ILOCK_DEP_MASK) | | #define XFS_LOCK_DEP_MASK (XFS_IOLOCK_DEP_MASK | XFS_ILOCK_DEP_MASK) | |
| | | | |
| #define XFS_IOLOCK_DEP(flags) (((flags) & XFS_IOLOCK_DEP_MASK) >> XFS_IOLO
CK_SHIFT) | | #define XFS_IOLOCK_DEP(flags) (((flags) & XFS_IOLOCK_DEP_MASK) >> XFS_IOLO
CK_SHIFT) | |
| #define XFS_ILOCK_DEP(flags) (((flags) & XFS_ILOCK_DEP_MASK) >> XFS_ILOCK
_SHIFT) | | #define XFS_ILOCK_DEP(flags) (((flags) & XFS_ILOCK_DEP_MASK) >> XFS_ILOCK
_SHIFT) | |
| | | | |
|
| /* | | extern struct lock_class_key xfs_iolock_reclaimable; | |
| * Flags for xfs_iflush() | | | |
| */ | | | |
| #define XFS_IFLUSH_DELWRI_ELSE_SYNC 1 | | | |
| #define XFS_IFLUSH_DELWRI_ELSE_ASYNC 2 | | | |
| #define XFS_IFLUSH_SYNC 3 | | | |
| #define XFS_IFLUSH_ASYNC 4 | | | |
| #define XFS_IFLUSH_DELWRI 5 | | | |
| #define XFS_IFLUSH_ASYNC_NOBLOCK 6 | | | |
| | | | |
| /* | | /* | |
| * Flags for xfs_itruncate_start(). | | * Flags for xfs_itruncate_start(). | |
| */ | | */ | |
| #define XFS_ITRUNC_DEFINITE 0x1 | | #define XFS_ITRUNC_DEFINITE 0x1 | |
| #define XFS_ITRUNC_MAYBE 0x2 | | #define XFS_ITRUNC_MAYBE 0x2 | |
| | | | |
|
| | | #define XFS_ITRUNC_FLAGS \ | |
| | | { XFS_ITRUNC_DEFINITE, "DEFINITE" }, \ | |
| | | { XFS_ITRUNC_MAYBE, "MAYBE" } | |
| | | | |
| /* | | /* | |
| * For multiple groups support: if S_ISGID bit is set in the parent | | * For multiple groups support: if S_ISGID bit is set in the parent | |
| * directory, group of new file is set to that of the parent, and | | * directory, group of new file is set to that of the parent, and | |
| * new subdirectory gets S_ISGID bit from parent. | | * new subdirectory gets S_ISGID bit from parent. | |
| */ | | */ | |
| #define XFS_INHERIT_GID(pip) \ | | #define XFS_INHERIT_GID(pip) \ | |
| (((pip)->i_mount->m_flags & XFS_MOUNT_GRPID) || \ | | (((pip)->i_mount->m_flags & XFS_MOUNT_GRPID) || \ | |
| ((pip)->i_d.di_mode & S_ISGID)) | | ((pip)->i_d.di_mode & S_ISGID)) | |
| | | | |
| /* | | /* | |
|
| * Flags for xfs_iget() | | | |
| */ | | | |
| #define XFS_IGET_CREATE 0x1 | | | |
| #define XFS_IGET_BULKSTAT 0x2 | | | |
| | | | |
| /* | | | |
| * xfs_iget.c prototypes. | | * xfs_iget.c prototypes. | |
| */ | | */ | |
|
| void xfs_ihash_init(struct xfs_mount *); | | | |
| void xfs_ihash_free(struct xfs_mount *); | | | |
| xfs_inode_t *xfs_inode_incore(struct xfs_mount *, xfs_ino_t, | | | |
| struct xfs_trans *); | | | |
| int xfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, | | int xfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, | |
|
| uint, uint, xfs_inode_t **, xfs_daddr_t); | | uint, uint, xfs_inode_t **); | |
| void xfs_iput(xfs_inode_t *, uint); | | | |
| void xfs_iput_new(xfs_inode_t *, uint); | | | |
| void xfs_ilock(xfs_inode_t *, uint); | | void xfs_ilock(xfs_inode_t *, uint); | |
| int xfs_ilock_nowait(xfs_inode_t *, uint); | | int xfs_ilock_nowait(xfs_inode_t *, uint); | |
| void xfs_iunlock(xfs_inode_t *, uint); | | void xfs_iunlock(xfs_inode_t *, uint); | |
| void xfs_ilock_demote(xfs_inode_t *, uint); | | void xfs_ilock_demote(xfs_inode_t *, uint); | |
| int xfs_isilocked(xfs_inode_t *, uint); | | int xfs_isilocked(xfs_inode_t *, uint); | |
| uint xfs_ilock_map_shared(xfs_inode_t *); | | uint xfs_ilock_map_shared(xfs_inode_t *); | |
| void xfs_iunlock_map_shared(xfs_inode_t *, uint); | | void xfs_iunlock_map_shared(xfs_inode_t *, uint); | |
|
| void xfs_ireclaim(xfs_inode_t *); | | void xfs_inode_free(struct xfs_inode *ip); | |
| int xfs_finish_reclaim(xfs_inode_t *, int, int); | | | |
| int xfs_finish_reclaim_all(struct xfs_mount *, int); | | | |
| | | | |
| /* | | /* | |
| * xfs_inode.c prototypes. | | * xfs_inode.c prototypes. | |
| */ | | */ | |
|
| int xfs_iread(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, | | | |
| xfs_inode_t **, xfs_daddr_t, uint); | | | |
| int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, | | int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, | |
|
| xfs_nlink_t, xfs_dev_t, struct cred *, prid_t, | | xfs_nlink_t, xfs_dev_t, prid_t, int, | |
| int, struct xfs_buf **, boolean_t *, xfs_inode_t | | struct xfs_buf **, boolean_t *, xfs_inode_t **); | |
| **); | | | |
| | | | |
| uint xfs_ip2xflags(struct xfs_inode *); | | uint xfs_ip2xflags(struct xfs_inode *); | |
| uint xfs_dic2xflags(struct xfs_dinode *); | | uint xfs_dic2xflags(struct xfs_dinode *); | |
| int xfs_ifree(struct xfs_trans *, xfs_inode_t *, | | int xfs_ifree(struct xfs_trans *, xfs_inode_t *, | |
| struct xfs_bmap_free *); | | struct xfs_bmap_free *); | |
| int xfs_itruncate_start(xfs_inode_t *, uint, xfs_fsize_t); | | int xfs_itruncate_start(xfs_inode_t *, uint, xfs_fsize_t); | |
| int xfs_itruncate_finish(struct xfs_trans **, xfs_inode_t *, | | int xfs_itruncate_finish(struct xfs_trans **, xfs_inode_t *, | |
| xfs_fsize_t, int, int); | | xfs_fsize_t, int, int); | |
| int xfs_iunlink(struct xfs_trans *, xfs_inode_t *); | | int xfs_iunlink(struct xfs_trans *, xfs_inode_t *); | |
| | | | |
|
| struct xfs_inode * xfs_inode_alloc(struct xfs_mount *, xfs_ino_t); | | | |
| void xfs_idestroy(xfs_inode_t *); | | | |
| void xfs_iextract(xfs_inode_t *); | | | |
| void xfs_iext_realloc(xfs_inode_t *, int, int); | | void xfs_iext_realloc(xfs_inode_t *, int, int); | |
|
| void xfs_ipin(xfs_inode_t *); | | void xfs_iunpin_wait(xfs_inode_t *); | |
| void xfs_iunpin(xfs_inode_t *); | | | |
| int xfs_iflush(xfs_inode_t *, uint); | | int xfs_iflush(xfs_inode_t *, uint); | |
|
| void xfs_iflush_all(struct xfs_mount *); | | | |
| void xfs_ichgtime(xfs_inode_t *, int); | | | |
| xfs_fsize_t xfs_file_last_byte(xfs_inode_t *); | | | |
| void xfs_lock_inodes(xfs_inode_t **, int, uint); | | void xfs_lock_inodes(xfs_inode_t **, int, uint); | |
| void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint); | | void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint); | |
| | | | |
|
| void xfs_synchronize_atime(xfs_inode_t *); | | void xfs_synchronize_times(xfs_inode_t *); | |
| | | void xfs_mark_inode_dirty(xfs_inode_t *); | |
| void xfs_mark_inode_dirty_sync(xfs_inode_t *); | | void xfs_mark_inode_dirty_sync(xfs_inode_t *); | |
| | | | |
|
| | | #define IHOLD(ip) \ | |
| | | do { \ | |
| | | ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \ | |
| | | ihold(VFS_I(ip)); \ | |
| | | trace_xfs_ihold(ip, _THIS_IP_); \ | |
| | | } while (0) | |
| | | | |
| | | #define IRELE(ip) \ | |
| | | do { \ | |
| | | trace_xfs_irele(ip, _THIS_IP_); \ | |
| | | iput(VFS_I(ip)); \ | |
| | | } while (0) | |
| | | | |
| #endif /* __KERNEL__ */ | | #endif /* __KERNEL__ */ | |
| | | | |
|
| | | /* | |
| | | * Flags for xfs_iget() | |
| | | */ | |
| | | #define XFS_IGET_CREATE 0x1 | |
| | | #define XFS_IGET_UNTRUSTED 0x2 | |
| | | | |
| | | int xfs_inotobp(struct xfs_mount *, struct xfs_trans *, | |
| | | xfs_ino_t, struct xfs_dinode **, | |
| | | struct xfs_buf **, int *, uint); | |
| int xfs_itobp(struct xfs_mount *, struct xfs_trans *, | | int xfs_itobp(struct xfs_mount *, struct xfs_trans *, | |
| struct xfs_inode *, struct xfs_dinode **, | | struct xfs_inode *, struct xfs_dinode **, | |
|
| struct xfs_buf **, xfs_daddr_t, uint, uint); | | struct xfs_buf **, uint); | |
| void xfs_dinode_from_disk(struct xfs_icdinode *, | | int xfs_iread(struct xfs_mount *, struct xfs_trans *, | |
| struct xfs_dinode_core *); | | struct xfs_inode *, uint); | |
| void xfs_dinode_to_disk(struct xfs_dinode_core *, | | void xfs_dinode_to_disk(struct xfs_dinode *, | |
| struct xfs_icdinode *); | | struct xfs_icdinode *); | |
|
| | | void xfs_dinode_from_disk(struct xfs_icdinode *, | |
| | | struct xfs_dinode *); | |
| void xfs_idestroy_fork(struct xfs_inode *, int); | | void xfs_idestroy_fork(struct xfs_inode *, int); | |
| void xfs_idata_realloc(struct xfs_inode *, int, int); | | void xfs_idata_realloc(struct xfs_inode *, int, int); | |
| void xfs_iroot_realloc(struct xfs_inode *, int, int); | | void xfs_iroot_realloc(struct xfs_inode *, int, int); | |
| int xfs_iread_extents(struct xfs_trans *, struct xfs_inode *, in
t); | | int xfs_iread_extents(struct xfs_trans *, struct xfs_inode *, in
t); | |
| int xfs_iextents_copy(struct xfs_inode *, xfs_bmbt_rec_t *, int)
; | | int xfs_iextents_copy(struct xfs_inode *, xfs_bmbt_rec_t *, int)
; | |
| | | | |
| xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t); | | xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t); | |
|
| void xfs_iext_insert(xfs_ifork_t *, xfs_extnum_t, xfs_extnum_t, | | void xfs_iext_insert(struct xfs_inode *, xfs_extnum_t, xfs_extnum | |
| xfs_bmbt_irec_t *); | | _t, | |
| | | xfs_bmbt_irec_t *, int); | |
| void xfs_iext_add(xfs_ifork_t *, xfs_extnum_t, int); | | void xfs_iext_add(xfs_ifork_t *, xfs_extnum_t, int); | |
| void xfs_iext_add_indirect_multi(xfs_ifork_t *, int, xfs_extnum_t
, int); | | void xfs_iext_add_indirect_multi(xfs_ifork_t *, int, xfs_extnum_t
, int); | |
|
| void xfs_iext_remove(xfs_ifork_t *, xfs_extnum_t, int); | | void xfs_iext_remove(struct xfs_inode *, xfs_extnum_t, int, int); | |
| void xfs_iext_remove_inline(xfs_ifork_t *, xfs_extnum_t, int); | | void xfs_iext_remove_inline(xfs_ifork_t *, xfs_extnum_t, int); | |
| void xfs_iext_remove_direct(xfs_ifork_t *, xfs_extnum_t, int); | | void xfs_iext_remove_direct(xfs_ifork_t *, xfs_extnum_t, int); | |
| void xfs_iext_remove_indirect(xfs_ifork_t *, xfs_extnum_t, int); | | void xfs_iext_remove_indirect(xfs_ifork_t *, xfs_extnum_t, int); | |
| void xfs_iext_realloc_direct(xfs_ifork_t *, int); | | void xfs_iext_realloc_direct(xfs_ifork_t *, int); | |
|
| void xfs_iext_realloc_indirect(xfs_ifork_t *, int); | | | |
| void xfs_iext_indirect_to_direct(xfs_ifork_t *); | | | |
| void xfs_iext_direct_to_inline(xfs_ifork_t *, xfs_extnum_t); | | void xfs_iext_direct_to_inline(xfs_ifork_t *, xfs_extnum_t); | |
| void xfs_iext_inline_to_direct(xfs_ifork_t *, int); | | void xfs_iext_inline_to_direct(xfs_ifork_t *, int); | |
| void xfs_iext_destroy(xfs_ifork_t *); | | void xfs_iext_destroy(xfs_ifork_t *); | |
| xfs_bmbt_rec_host_t *xfs_iext_bno_to_ext(xfs_ifork_t *, xfs_fileoff_t, int
*); | | xfs_bmbt_rec_host_t *xfs_iext_bno_to_ext(xfs_ifork_t *, xfs_fileoff_t, int
*); | |
| xfs_ext_irec_t *xfs_iext_bno_to_irec(xfs_ifork_t *, xfs_fileoff_t, int *); | | xfs_ext_irec_t *xfs_iext_bno_to_irec(xfs_ifork_t *, xfs_fileoff_t, int *); | |
| xfs_ext_irec_t *xfs_iext_idx_to_irec(xfs_ifork_t *, xfs_extnum_t *, int *,
int); | | xfs_ext_irec_t *xfs_iext_idx_to_irec(xfs_ifork_t *, xfs_extnum_t *, int *,
int); | |
| void xfs_iext_irec_init(xfs_ifork_t *); | | void xfs_iext_irec_init(xfs_ifork_t *); | |
| xfs_ext_irec_t *xfs_iext_irec_new(xfs_ifork_t *, int); | | xfs_ext_irec_t *xfs_iext_irec_new(xfs_ifork_t *, int); | |
| void xfs_iext_irec_remove(xfs_ifork_t *, int); | | void xfs_iext_irec_remove(xfs_ifork_t *, int); | |
| void xfs_iext_irec_compact(xfs_ifork_t *); | | void xfs_iext_irec_compact(xfs_ifork_t *); | |
| | | | |
End of changes. 37 change blocks. |
| 123 lines changed or deleted | | 99 lines changed or added | |
|
| xfs_log_priv.h | | xfs_log_priv.h | |
| | | | |
| skipping to change at line 22 | | skipping to change at line 22 | |
| * GNU General Public License for more details. | | * GNU General Public License for more details. | |
| * | | * | |
| * You should have received a copy of the GNU General Public License | | * You should have received a copy of the GNU General Public License | |
| * along with this program; if not, write the Free Software Foundation, | | * along with this program; if not, write the Free Software Foundation, | |
| * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
| */ | | */ | |
| #ifndef __XFS_LOG_PRIV_H__ | | #ifndef __XFS_LOG_PRIV_H__ | |
| #define __XFS_LOG_PRIV_H__ | | #define __XFS_LOG_PRIV_H__ | |
| | | | |
| struct xfs_buf; | | struct xfs_buf; | |
|
| struct ktrace; | | | |
| struct log; | | struct log; | |
| struct xlog_ticket; | | struct xlog_ticket; | |
|
| struct xfs_buf_cancel; | | | |
| struct xfs_mount; | | struct xfs_mount; | |
| | | | |
| /* | | /* | |
| * Macros, structures, prototypes for internal log manager use. | | * Macros, structures, prototypes for internal log manager use. | |
| */ | | */ | |
| | | | |
| #define XLOG_MIN_ICLOGS 2 | | #define XLOG_MIN_ICLOGS 2 | |
| #define XLOG_MAX_ICLOGS 8 | | #define XLOG_MAX_ICLOGS 8 | |
| #define XLOG_HEADER_MAGIC_NUM 0xFEEDbabe /* Invalid cycle number */ | | #define XLOG_HEADER_MAGIC_NUM 0xFEEDbabe /* Invalid cycle number */ | |
| #define XLOG_VERSION_1 1 | | #define XLOG_VERSION_1 1 | |
| | | | |
| skipping to change at line 136 | | skipping to change at line 134 | |
| #define XLOG_WAS_CONT_TRANS 0x08 /* Cont this trans into new region *
/ | | #define XLOG_WAS_CONT_TRANS 0x08 /* Cont this trans into new region *
/ | |
| #define XLOG_END_TRANS 0x10 /* End a continued transaction */ | | #define XLOG_END_TRANS 0x10 /* End a continued transaction */ | |
| #define XLOG_UNMOUNT_TRANS 0x20 /* Unmount a filesystem transaction
*/ | | #define XLOG_UNMOUNT_TRANS 0x20 /* Unmount a filesystem transaction
*/ | |
| | | | |
| #ifdef __KERNEL__ | | #ifdef __KERNEL__ | |
| /* | | /* | |
| * Flags to log ticket | | * Flags to log ticket | |
| */ | | */ | |
| #define XLOG_TIC_INITED 0x1 /* has been initialized */ | | #define XLOG_TIC_INITED 0x1 /* has been initialized */ | |
| #define XLOG_TIC_PERM_RESERV 0x2 /* permanent reservation */ | | #define XLOG_TIC_PERM_RESERV 0x2 /* permanent reservation */ | |
|
| #define XLOG_TIC_IN_Q 0x4 | | | |
| | | #define XLOG_TIC_FLAGS \ | |
| | | { XLOG_TIC_INITED, "XLOG_TIC_INITED" }, \ | |
| | | { XLOG_TIC_PERM_RESERV, "XLOG_TIC_PERM_RESERV" } | |
| | | | |
| #endif /* __KERNEL__ */ | | #endif /* __KERNEL__ */ | |
| | | | |
| #define XLOG_UNMOUNT_TYPE 0x556e /* Un for Unmount */ | | #define XLOG_UNMOUNT_TYPE 0x556e /* Un for Unmount */ | |
| | | | |
| /* | | /* | |
| * Flags for log structure | | * Flags for log structure | |
| */ | | */ | |
| #define XLOG_CHKSUM_MISMATCH 0x1 /* used only during recovery */ | | #define XLOG_CHKSUM_MISMATCH 0x1 /* used only during recovery */ | |
| #define XLOG_ACTIVE_RECOVERY 0x2 /* in the middle of recovery */ | | #define XLOG_ACTIVE_RECOVERY 0x2 /* in the middle of recovery */ | |
| #define XLOG_RECOVERY_NEEDED 0x4 /* log was recovered */ | | #define XLOG_RECOVERY_NEEDED 0x4 /* log was recovered */ | |
| #define XLOG_IO_ERROR 0x8 /* log hit an I/O error, and being | | #define XLOG_IO_ERROR 0x8 /* log hit an I/O error, and being | |
| shutdown */ | | shutdown */ | |
|
| typedef __uint32_t xlog_tid_t; | | | |
| | | | |
| #ifdef __KERNEL__ | | #ifdef __KERNEL__ | |
| /* | | /* | |
| * Below are states for covering allocation transactions. | | * Below are states for covering allocation transactions. | |
| * By covering, we mean changing the h_tail_lsn in the last on-disk | | * By covering, we mean changing the h_tail_lsn in the last on-disk | |
| * log write such that no allocation transactions will be re-done during | | * log write such that no allocation transactions will be re-done during | |
| * recovery after a system crash. Recovery starts at the last on-disk | | * recovery after a system crash. Recovery starts at the last on-disk | |
| * log write. | | * log write. | |
| * | | * | |
| * These states are used to insert dummy log entries to cover | | * These states are used to insert dummy log entries to cover | |
| | | | |
| skipping to change at line 241 | | skipping to change at line 242 | |
| * Reservation region | | * Reservation region | |
| * As would be stored in xfs_log_iovec but without the i_addr which | | * As would be stored in xfs_log_iovec but without the i_addr which | |
| * we don't care about. | | * we don't care about. | |
| */ | | */ | |
| typedef struct xlog_res { | | typedef struct xlog_res { | |
| uint r_len; /* region length :4 */ | | uint r_len; /* region length :4 */ | |
| uint r_type; /* region's transaction type :4 */ | | uint r_type; /* region's transaction type :4 */ | |
| } xlog_res_t; | | } xlog_res_t; | |
| | | | |
| typedef struct xlog_ticket { | | typedef struct xlog_ticket { | |
|
| sv_t t_wait; /* ticket wait queue : 2 | | wait_queue_head_t t_wait; /* ticket wait queue */ | |
| 0 */ | | struct list_head t_queue; /* reserve/write queue */ | |
| struct xlog_ticket *t_next; /* :4| | | | |
| 8 */ | | | |
| struct xlog_ticket *t_prev; /* :4| | | | |
| 8 */ | | | |
| xlog_tid_t t_tid; /* transaction identifier : 4
*/ | | xlog_tid_t t_tid; /* transaction identifier : 4
*/ | |
|
| | | atomic_t t_ref; /* ticket reference count : 4
*/ | |
| int t_curr_res; /* current reservation in bytes : 4
*/ | | int t_curr_res; /* current reservation in bytes : 4
*/ | |
| int t_unit_res; /* unit reservation in bytes : 4
*/ | | int t_unit_res; /* unit reservation in bytes : 4
*/ | |
| char t_ocnt; /* original count : 1
*/ | | char t_ocnt; /* original count : 1
*/ | |
| char t_cnt; /* current count : 1
*/ | | char t_cnt; /* current count : 1
*/ | |
| char t_clientid; /* who does this belong to; : 1
*/ | | char t_clientid; /* who does this belong to; : 1
*/ | |
| char t_flags; /* properties of reservation : 1
*/ | | char t_flags; /* properties of reservation : 1
*/ | |
| uint t_trans_type; /* transaction type : 4
*/ | | uint t_trans_type; /* transaction type : 4
*/ | |
| | | | |
| /* reservation array fields */ | | /* reservation array fields */ | |
| uint t_res_num; /* num in array : 4
*/ | | uint t_res_num; /* num in array : 4
*/ | |
| | | | |
| skipping to change at line 307 | | skipping to change at line 308 | |
| uuid_t h_fs_uuid; /* uuid of FS : 16
*/ | | uuid_t h_fs_uuid; /* uuid of FS : 16
*/ | |
| __be32 h_size; /* iclog size : 4
*/ | | __be32 h_size; /* iclog size : 4
*/ | |
| } xlog_rec_header_t; | | } xlog_rec_header_t; | |
| | | | |
| typedef struct xlog_rec_ext_header { | | typedef struct xlog_rec_ext_header { | |
| __be32 xh_cycle; /* write cycle of log : 4
*/ | | __be32 xh_cycle; /* write cycle of log : 4
*/ | |
| __be32 xh_cycle_data[XLOG_HEADER_CYCLE_SIZE / BBSIZE]; /* : 25
6 */ | | __be32 xh_cycle_data[XLOG_HEADER_CYCLE_SIZE / BBSIZE]; /* : 25
6 */ | |
| } xlog_rec_ext_header_t; | | } xlog_rec_ext_header_t; | |
| | | | |
| #ifdef __KERNEL__ | | #ifdef __KERNEL__ | |
|
| | | | |
| | | /* | |
| | | * Quite misnamed, because this union lays out the actual on-disk log buffe | |
| | | r. | |
| | | */ | |
| | | typedef union xlog_in_core2 { | |
| | | xlog_rec_header_t hic_header; | |
| | | xlog_rec_ext_header_t hic_xheader; | |
| | | char hic_sector[XLOG_HEADER_SIZE]; | |
| | | } xlog_in_core_2_t; | |
| | | | |
| /* | | /* | |
| * - A log record header is 512 bytes. There is plenty of room to grow the | | * - A log record header is 512 bytes. There is plenty of room to grow the | |
| * xlog_rec_header_t into the reserved space. | | * xlog_rec_header_t into the reserved space. | |
| * - ic_data follows, so a write to disk can start at the beginning of | | * - ic_data follows, so a write to disk can start at the beginning of | |
| * the iclog. | | * the iclog. | |
| * - ic_forcewait is used to implement synchronous forcing of the iclog to
disk. | | * - ic_forcewait is used to implement synchronous forcing of the iclog to
disk. | |
| * - ic_next is the pointer to the next iclog in the ring. | | * - ic_next is the pointer to the next iclog in the ring. | |
| * - ic_bp is a pointer to the buffer used to write this incore log to disk
. | | * - ic_bp is a pointer to the buffer used to write this incore log to disk
. | |
| * - ic_log is a pointer back to the global log structure. | | * - ic_log is a pointer back to the global log structure. | |
| * - ic_callback is a linked list of callback function/argument pairs to be | | * - ic_callback is a linked list of callback function/argument pairs to be | |
| | | | |
| skipping to change at line 336 | | skipping to change at line 347 | |
| * by independent processes: | | * by independent processes: | |
| * | | * | |
| * - ic_callback_* | | * - ic_callback_* | |
| * - ic_refcnt | | * - ic_refcnt | |
| * - fields protected by the global l_icloglock | | * - fields protected by the global l_icloglock | |
| * | | * | |
| * so we need to ensure that these fields are located in separate cacheline
s. | | * so we need to ensure that these fields are located in separate cacheline
s. | |
| * We'll put all the read-only and l_icloglock fields in the first cachelin
e, | | * We'll put all the read-only and l_icloglock fields in the first cachelin
e, | |
| * and move everything else out to subsequent cachelines. | | * and move everything else out to subsequent cachelines. | |
| */ | | */ | |
|
| typedef struct xlog_iclog_fields { | | typedef struct xlog_in_core { | |
| sv_t ic_force_wait; | | wait_queue_head_t ic_force_wait; | |
| sv_t ic_write_wait; | | wait_queue_head_t ic_write_wait; | |
| struct xlog_in_core *ic_next; | | struct xlog_in_core *ic_next; | |
| struct xlog_in_core *ic_prev; | | struct xlog_in_core *ic_prev; | |
| struct xfs_buf *ic_bp; | | struct xfs_buf *ic_bp; | |
| struct log *ic_log; | | struct log *ic_log; | |
| int ic_size; | | int ic_size; | |
| int ic_offset; | | int ic_offset; | |
| int ic_bwritecnt; | | int ic_bwritecnt; | |
|
| ushort_t ic_state; | | unsigned short ic_state; | |
| char *ic_datap; /* pointer to iclog data */ | | char *ic_datap; /* pointer to iclog data */ | |
|
| #ifdef XFS_LOG_TRACE | | | |
| struct ktrace *ic_trace; | | | |
| #endif | | | |
| | | | |
| /* Callback structures need their own cacheline */ | | /* Callback structures need their own cacheline */ | |
| spinlock_t ic_callback_lock ____cacheline_aligned_in_sm
p; | | spinlock_t ic_callback_lock ____cacheline_aligned_in_sm
p; | |
| xfs_log_callback_t *ic_callback; | | xfs_log_callback_t *ic_callback; | |
| xfs_log_callback_t **ic_callback_tail; | | xfs_log_callback_t **ic_callback_tail; | |
| | | | |
| /* reference counts need their own cacheline */ | | /* reference counts need their own cacheline */ | |
| atomic_t ic_refcnt ____cacheline_aligned_in_smp; | | atomic_t ic_refcnt ____cacheline_aligned_in_smp; | |
|
| } xlog_iclog_fields_t; | | xlog_in_core_2_t *ic_data; | |
| | | #define ic_header ic_data->hic_header | |
| typedef union xlog_in_core2 { | | | |
| xlog_rec_header_t hic_header; | | | |
| xlog_rec_ext_header_t hic_xheader; | | | |
| char hic_sector[XLOG_HEADER_SIZE]; | | | |
| } xlog_in_core_2_t; | | | |
| | | | |
| typedef struct xlog_in_core { | | | |
| xlog_iclog_fields_t hic_fields; | | | |
| xlog_in_core_2_t *hic_data; | | | |
| } xlog_in_core_t; | | } xlog_in_core_t; | |
| | | | |
| /* | | /* | |
|
| * Defines to save our code from this glop. | | * The CIL context is used to aggregate per-transaction details as well be | |
| | | * passed to the iclog for checkpoint post-commit processing. After being | |
| | | * passed to the iclog, another context needs to be allocated for tracking | |
| | | the | |
| | | * next set of transactions to be aggregated into a checkpoint. | |
| | | */ | |
| | | struct xfs_cil; | |
| | | | |
| | | struct xfs_cil_ctx { | |
| | | struct xfs_cil *cil; | |
| | | xfs_lsn_t sequence; /* chkpt sequence # */ | |
| | | xfs_lsn_t start_lsn; /* first LSN of chkpt commit | |
| | | */ | |
| | | xfs_lsn_t commit_lsn; /* chkpt commit record lsn * | |
| | | / | |
| | | struct xlog_ticket *ticket; /* chkpt ticket */ | |
| | | int nvecs; /* number of regions */ | |
| | | int space_used; /* aggregate size of regions | |
| | | */ | |
| | | struct list_head busy_extents; /* busy extents in chkpt */ | |
| | | struct xfs_log_vec *lv_chain; /* logvecs being pushed */ | |
| | | xfs_log_callback_t log_cb; /* completion callback hook. | |
| | | */ | |
| | | struct list_head committing; /* ctx committing list */ | |
| | | }; | |
| | | | |
| | | /* | |
| | | * Committed Item List structure | |
| | | * | |
| | | * This structure is used to track log items that have been committed but n | |
| | | ot | |
| | | * yet written into the log. It is used only when the delayed logging mount | |
| | | * option is enabled. | |
| | | * | |
| | | * This structure tracks the list of committing checkpoint contexts so | |
| | | * we can avoid the problem of having to hold out new transactions during a | |
| | | * flush until we have a the commit record LSN of the checkpoint. We can | |
| | | * traverse the list of committing contexts in xlog_cil_push_lsn() to find | |
| | | a | |
| | | * sequence match and extract the commit LSN directly from there. If the | |
| | | * checkpoint is still in the process of committing, we can block waiting f | |
| | | or | |
| | | * the commit LSN to be determined as well. This should make synchronous | |
| | | * operations almost as efficient as the old logging methods. | |
| | | */ | |
| | | struct xfs_cil { | |
| | | struct log *xc_log; | |
| | | struct list_head xc_cil; | |
| | | spinlock_t xc_cil_lock; | |
| | | struct xfs_cil_ctx *xc_ctx; | |
| | | struct rw_semaphore xc_ctx_lock; | |
| | | struct list_head xc_committing; | |
| | | wait_queue_head_t xc_commit_wait; | |
| | | xfs_lsn_t xc_current_sequence; | |
| | | }; | |
| | | | |
| | | /* | |
| | | * The amount of log space we allow the CIL to aggregate is difficult to si | |
| | | ze. | |
| | | * Whatever we choose, we have to make sure we can get a reservation for th | |
| | | e | |
| | | * log space effectively, that it is large enough to capture sufficient | |
| | | * relogging to reduce log buffer IO significantly, but it is not too large | |
| | | for | |
| | | * the log or induces too much latency when writing out through the iclogs. | |
| | | We | |
| | | * track both space consumed and the number of vectors in the checkpoint | |
| | | * context, so we need to decide which to use for limiting. | |
| | | * | |
| | | * Every log buffer we write out during a push needs a header reserved, whi | |
| | | ch | |
| | | * is at least one sector and more for v2 logs. Hence we need a reservation | |
| | | of | |
| | | * at least 512 bytes per 32k of log space just for the LR headers. That me | |
| | | ans | |
| | | * 16KB of reservation per megabyte of delayed logging space we will consum | |
| | | e, | |
| | | * plus various headers. The number of headers will vary based on the num | |
| | | of | |
| | | * io vectors, so limiting on a specific number of vectors is going to resu | |
| | | lt | |
| | | * in transactions of varying size. IOWs, it is more consistent to track an | |
| | | d | |
| | | * limit space consumed in the log rather than by the number of objects bei | |
| | | ng | |
| | | * logged in order to prevent checkpoint ticket overruns. | |
| | | * | |
| | | * Further, use of static reservations through the log grant mechanism is | |
| | | * problematic. It introduces a lot of complexity (e.g. reserve grant vs wr | |
| | | ite | |
| | | * grant) and a significant deadlock potential because regranting write spa | |
| | | ce | |
| | | * can block on log pushes. Hence if we have to regrant log space during a | |
| | | log | |
| | | * push, we can deadlock. | |
| | | * | |
| | | * However, we can avoid this by use of a dynamic "reservation stealing" | |
| | | * technique during transaction commit whereby unused reservation space in | |
| | | the | |
| | | * transaction ticket is transferred to the CIL ctx commit ticket to cover | |
| | | the | |
| | | * space needed by the checkpoint transaction. This means that we never nee | |
| | | d to | |
| | | * specifically reserve space for the CIL checkpoint transaction, nor do we | |
| | | * need to regrant space once the checkpoint completes. This also means the | |
| | | * checkpoint transaction ticket is specific to the checkpoint context, rat | |
| | | her | |
| | | * than the CIL itself. | |
| | | * | |
| | | * With dynamic reservations, we can effectively make up arbitrary limits f | |
| | | or | |
| | | * the checkpoint size so long as they don't violate any other size rules. | |
| | | * Recovery imposes a rule that no transaction exceed half the log, so we a | |
| | | re | |
| | | * limited by that. Furthermore, the log transaction reservation subsystem | |
| | | * tries to keep 25% of the log free, so we need to keep below that limit o | |
| | | r we | |
| | | * risk running out of free log space to start any new transactions. | |
| | | * | |
| | | * In order to keep background CIL push efficient, we will set a lower | |
| | | * threshold at which background pushing is attempted without blocking curr | |
| | | ent | |
| | | * transaction commits. A separate, higher bound defines when CIL pushes a | |
| | | re | |
| | | * enforced to ensure we stay within our maximum checkpoint size bounds. | |
| | | * threshold, yet give us plenty of space for aggregation on large logs. | |
| */ | | */ | |
|
| #define ic_force_wait hic_fields.ic_force_wait | | #define XLOG_CIL_SPACE_LIMIT(log) (log->l_logsize >> 3) | |
| #define ic_write_wait hic_fields.ic_write_wait | | #define XLOG_CIL_HARD_SPACE_LIMIT(log) (3 * (log->l_logsize >> 4)) | |
| #define ic_next hic_fields.ic_next | | | |
| #define ic_prev hic_fields.ic_prev | | | |
| #define ic_bp hic_fields.ic_bp | | | |
| #define ic_log hic_fields.ic_log | | | |
| #define ic_callback hic_fields.ic_callback | | | |
| #define ic_callback_lock hic_fields.ic_callback_lock | | | |
| #define ic_callback_tail hic_fields.ic_callback_tail | | | |
| #define ic_trace hic_fields.ic_trace | | | |
| #define ic_size hic_fields.ic_size | | | |
| #define ic_offset hic_fields.ic_offset | | | |
| #define ic_refcnt hic_fields.ic_refcnt | | | |
| #define ic_bwritecnt hic_fields.ic_bwritecnt | | | |
| #define ic_state hic_fields.ic_state | | | |
| #define ic_datap hic_fields.ic_datap | | | |
| #define ic_header hic_data->hic_header | | | |
| | | | |
| /* | | /* | |
| * The reservation head lsn is not made up of a cycle number and block numb
er. | | * The reservation head lsn is not made up of a cycle number and block numb
er. | |
| * Instead, it uses a cycle number and byte number. Logs don't expect to | | * Instead, it uses a cycle number and byte number. Logs don't expect to | |
| * overflow 31 bits worth of byte offset, so using a byte number will mean | | * overflow 31 bits worth of byte offset, so using a byte number will mean | |
| * that round off problems won't occur when releasing partial reservations. | | * that round off problems won't occur when releasing partial reservations. | |
| */ | | */ | |
| typedef struct log { | | typedef struct log { | |
| /* The following fields don't need locking */ | | /* The following fields don't need locking */ | |
| struct xfs_mount *l_mp; /* mount point */ | | struct xfs_mount *l_mp; /* mount point */ | |
|
| | | struct xfs_ail *l_ailp; /* AIL log is working with * | |
| | | / | |
| | | struct xfs_cil *l_cilp; /* CIL log is working with * | |
| | | / | |
| struct xfs_buf *l_xbuf; /* extra buffer for log | | struct xfs_buf *l_xbuf; /* extra buffer for log | |
| * wrapping */ | | * wrapping */ | |
| struct xfs_buftarg *l_targ; /* buftarg of log */ | | struct xfs_buftarg *l_targ; /* buftarg of log */ | |
| uint l_flags; | | uint l_flags; | |
| uint l_quotaoffs_flag; /* XFS_DQ_*, for QUOTAOFFs
*/ | | uint l_quotaoffs_flag; /* XFS_DQ_*, for QUOTAOFFs
*/ | |
|
| struct xfs_buf_cancel **l_buf_cancel_table; | | struct list_head *l_buf_cancel_table; | |
| int l_iclog_hsize; /* size of iclog header */ | | int l_iclog_hsize; /* size of iclog header */ | |
| int l_iclog_heads; /* # of iclog header sectors
*/ | | int l_iclog_heads; /* # of iclog header sectors
*/ | |
|
| uint l_sectbb_log; /* log2 of sector size in BB | | uint l_sectBBsize; /* sector size in BBs (2^n) | |
| s */ | | */ | |
| uint l_sectbb_mask; /* sector size (in BBs) | | | |
| * alignment mask */ | | | |
| int l_iclog_size; /* size of log in bytes */ | | int l_iclog_size; /* size of log in bytes */ | |
| int l_iclog_size_log; /* log power size of log *
/ | | int l_iclog_size_log; /* log power size of log *
/ | |
| int l_iclog_bufs; /* number of iclog buffers *
/ | | int l_iclog_bufs; /* number of iclog buffers *
/ | |
| xfs_daddr_t l_logBBstart; /* start block of log */ | | xfs_daddr_t l_logBBstart; /* start block of log */ | |
| int l_logsize; /* size of log in bytes */ | | int l_logsize; /* size of log in bytes */ | |
| int l_logBBsize; /* size of log in BB chunks
*/ | | int l_logBBsize; /* size of log in BB chunks
*/ | |
| | | | |
| /* The following block of fields are changed while holding icloglock
*/ | | /* The following block of fields are changed while holding icloglock
*/ | |
|
| sv_t l_flush_wait ____cacheline_aligned_in_smp; | | wait_queue_head_t l_flush_wait ____cacheline_aligned_in_smp; | |
| /* waiting for iclog flush *
/ | | /* waiting for iclog flush *
/ | |
| int l_covered_state;/* state of "covering disk | | int l_covered_state;/* state of "covering disk | |
| * log entries" */ | | * log entries" */ | |
| xlog_in_core_t *l_iclog; /* head log queue */ | | xlog_in_core_t *l_iclog; /* head log queue */ | |
| spinlock_t l_icloglock; /* grab to change iclog stat
e */ | | spinlock_t l_icloglock; /* grab to change iclog stat
e */ | |
|
| xfs_lsn_t l_tail_lsn; /* lsn of 1st LR with unflus | | | |
| hed | | | |
| * buffers */ | | | |
| xfs_lsn_t l_last_sync_lsn;/* lsn of last LR on disk */ | | | |
| int l_curr_cycle; /* Cycle number of log write
s */ | | int l_curr_cycle; /* Cycle number of log write
s */ | |
| int l_prev_cycle; /* Cycle number before last | | int l_prev_cycle; /* Cycle number before last | |
| * block increment */ | | * block increment */ | |
| int l_curr_block; /* current logical log block
*/ | | int l_curr_block; /* current logical log block
*/ | |
| int l_prev_block; /* previous logical log bloc
k */ | | int l_prev_block; /* previous logical log bloc
k */ | |
| | | | |
|
| /* The following block of fields are changed while holding grant_loc | | /* | |
| k */ | | * l_last_sync_lsn and l_tail_lsn are atomics so they can be set and | |
| spinlock_t l_grant_lock ____cacheline_aligned_in_smp; | | * read without needing to hold specific locks. To avoid operations | |
| xlog_ticket_t *l_reserve_headq; | | * contending with other hot objects, place each of them on a separa | |
| xlog_ticket_t *l_write_headq; | | te | |
| int l_grant_reserve_cycle; | | * cacheline. | |
| int l_grant_reserve_bytes; | | */ | |
| int l_grant_write_cycle; | | /* lsn of last LR on disk */ | |
| int l_grant_write_bytes; | | atomic64_t l_last_sync_lsn ____cacheline_aligned_in_smp | |
| | | ; | |
| #ifdef XFS_LOG_TRACE | | /* lsn of 1st LR with unflushed * buffers */ | |
| struct ktrace *l_grant_trace; | | atomic64_t l_tail_lsn ____cacheline_aligned_in_smp; | |
| #endif | | | |
| | | /* | |
| | | * ticket grant locks, queues and accounting have their own cachline | |
| | | s | |
| | | * as these are quite hot and can be operated on concurrently. | |
| | | */ | |
| | | spinlock_t l_grant_reserve_lock ____cacheline_aligned_i | |
| | | n_smp; | |
| | | struct list_head l_reserveq; | |
| | | atomic64_t l_grant_reserve_head; | |
| | | | |
| | | spinlock_t l_grant_write_lock ____cacheline_aligned_in_ | |
| | | smp; | |
| | | struct list_head l_writeq; | |
| | | atomic64_t l_grant_write_head; | |
| | | | |
| /* The following field are used for debugging; need to hold iclogloc
k */ | | /* The following field are used for debugging; need to hold iclogloc
k */ | |
| #ifdef DEBUG | | #ifdef DEBUG | |
| char *l_iclog_bak[XLOG_MAX_ICLOGS]; | | char *l_iclog_bak[XLOG_MAX_ICLOGS]; | |
| #endif | | #endif | |
| | | | |
| } xlog_t; | | } xlog_t; | |
| | | | |
|
| | | #define XLOG_BUF_CANCEL_BUCKET(log, blkno) \ | |
| | | ((log)->l_buf_cancel_table + ((__uint64_t)blkno % XLOG_BC_TABLE_SIZE | |
| | | )) | |
| | | | |
| #define XLOG_FORCED_SHUTDOWN(log) ((log)->l_flags & XLOG_IO_ERROR) | | #define XLOG_FORCED_SHUTDOWN(log) ((log)->l_flags & XLOG_IO_ERROR) | |
| | | | |
| /* common routines */ | | /* common routines */ | |
| extern xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp); | | extern xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp); | |
|
| extern int xlog_find_tail(xlog_t *log, | | | |
| xfs_daddr_t *head_blk, | | | |
| xfs_daddr_t *tail_blk); | | | |
| extern int xlog_recover(xlog_t *log); | | extern int xlog_recover(xlog_t *log); | |
| extern int xlog_recover_finish(xlog_t *log); | | extern int xlog_recover_finish(xlog_t *log); | |
| extern void xlog_pack_data(xlog_t *log, xlog_in_core_t *iclog, int); | | extern void xlog_pack_data(xlog_t *log, xlog_in_core_t *iclog, int); | |
|
| extern void xlog_recover_process_iunlinks(xlog_t *log); | | | |
| | | | |
|
| extern struct xfs_buf *xlog_get_bp(xlog_t *, int); | | extern kmem_zone_t *xfs_log_ticket_zone; | |
| extern void xlog_put_bp(struct xfs_buf *); | | struct xlog_ticket *xlog_ticket_alloc(struct log *log, int unit_bytes, | |
| extern int xlog_bread(xlog_t *, xfs_daddr_t, int, struct xfs_buf *); | | int count, char client, uint xflags, | |
| | | int alloc_flags); | |
| extern kmem_zone_t *xfs_log_ticket_zone; | | | |
| | | static inline void | |
| /* iclog tracing */ | | xlog_write_adv_cnt(void **ptr, int *len, int *off, size_t bytes) | |
| #define XLOG_TRACE_GRAB_FLUSH 1 | | { | |
| #define XLOG_TRACE_REL_FLUSH 2 | | *ptr += bytes; | |
| #define XLOG_TRACE_SLEEP_FLUSH 3 | | *len -= bytes; | |
| #define XLOG_TRACE_WAKE_FLUSH 4 | | *off += bytes; | |
| | | } | |
| | | | |
| | | void xlog_print_tic_res(struct xfs_mount *mp, struct xlog_ticket *ticket) | |
| | | ; | |
| | | int xlog_write(struct log *log, struct xfs_log_vec *log_vector, | |
| | | struct xlog_ticket *tic, xfs_lsn_t *start_ls | |
| | | n, | |
| | | xlog_in_core_t **commit_iclog, uint flags); | |
| | | | |
| | | /* | |
| | | * When we crack an atomic LSN, we sample it first so that the value will n | |
| | | ot | |
| | | * change while we are cracking it into the component values. This means we | |
| | | * will always get consistent component values to work from. This should al | |
| | | ways | |
| | | * be used to smaple and crack LSNs taht are stored and updated in atomic | |
| | | * variables. | |
| | | */ | |
| | | static inline void | |
| | | xlog_crack_atomic_lsn(atomic64_t *lsn, uint *cycle, uint *block) | |
| | | { | |
| | | xfs_lsn_t val = atomic64_read(lsn); | |
| | | | |
| | | *cycle = CYCLE_LSN(val); | |
| | | *block = BLOCK_LSN(val); | |
| | | } | |
| | | | |
| | | /* | |
| | | * Calculate and assign a value to an atomic LSN variable from component pi | |
| | | eces. | |
| | | */ | |
| | | static inline void | |
| | | xlog_assign_atomic_lsn(atomic64_t *lsn, uint cycle, uint block) | |
| | | { | |
| | | atomic64_set(lsn, xlog_assign_lsn(cycle, block)); | |
| | | } | |
| | | | |
| | | /* | |
| | | * When we crack the grant head, we sample it first so that the value will | |
| | | not | |
| | | * change while we are cracking it into the component values. This means we | |
| | | * will always get consistent component values to work from. | |
| | | */ | |
| | | static inline void | |
| | | xlog_crack_grant_head_val(int64_t val, int *cycle, int *space) | |
| | | { | |
| | | *cycle = val >> 32; | |
| | | *space = val & 0xffffffff; | |
| | | } | |
| | | | |
| | | static inline void | |
| | | xlog_crack_grant_head(atomic64_t *head, int *cycle, int *space) | |
| | | { | |
| | | xlog_crack_grant_head_val(atomic64_read(head), cycle, space); | |
| | | } | |
| | | | |
| | | static inline int64_t | |
| | | xlog_assign_grant_head_val(int cycle, int space) | |
| | | { | |
| | | return ((int64_t)cycle << 32) | space; | |
| | | } | |
| | | | |
| | | static inline void | |
| | | xlog_assign_grant_head(atomic64_t *head, int cycle, int space) | |
| | | { | |
| | | atomic64_set(head, xlog_assign_grant_head_val(cycle, space)); | |
| | | } | |
| | | | |
| | | /* | |
| | | * Committed Item List interfaces | |
| | | */ | |
| | | int xlog_cil_init(struct log *log); | |
| | | void xlog_cil_init_post_recovery(struct log *log); | |
| | | void xlog_cil_destroy(struct log *log); | |
| | | | |
| | | /* | |
| | | * CIL force routines | |
| | | */ | |
| | | xfs_lsn_t xlog_cil_force_lsn(struct log *log, xfs_lsn_t sequence); | |
| | | | |
| | | static inline void | |
| | | xlog_cil_force(struct log *log) | |
| | | { | |
| | | xlog_cil_force_lsn(log, log->l_cilp->xc_current_sequence); | |
| | | } | |
| | | | |
| /* | | /* | |
| * Unmount record type is used as a pseudo transaction type for the ticket. | | * Unmount record type is used as a pseudo transaction type for the ticket. | |
| * It's value must be outside the range of XFS_TRANS_* values. | | * It's value must be outside the range of XFS_TRANS_* values. | |
| */ | | */ | |
| #define XLOG_UNMOUNT_REC_TYPE (-1U) | | #define XLOG_UNMOUNT_REC_TYPE (-1U) | |
| | | | |
|
| | | /* | |
| | | * Wrapper function for waiting on a wait queue serialised against wakeups | |
| | | * by a spinlock. This matches the semantics of all the wait queues used in | |
| | | the | |
| | | * log code. | |
| | | */ | |
| | | static inline void xlog_wait(wait_queue_head_t *wq, spinlock_t *lock) | |
| | | { | |
| | | DECLARE_WAITQUEUE(wait, current); | |
| | | | |
| | | add_wait_queue_exclusive(wq, &wait); | |
| | | __set_current_state(TASK_UNINTERRUPTIBLE); | |
| | | spin_unlock(lock); | |
| | | schedule(); | |
| | | remove_wait_queue(wq, &wait); | |
| | | } | |
| #endif /* __KERNEL__ */ | | #endif /* __KERNEL__ */ | |
| | | | |
| #endif /* __XFS_LOG_PRIV_H__ */ | | #endif /* __XFS_LOG_PRIV_H__ */ | |
| | | | |
End of changes. 24 change blocks. |
| 84 lines changed or deleted | | 304 lines changed or added | |
|
| xfs_mount.h | | xfs_mount.h | |
| | | | |
| skipping to change at line 47 | | skipping to change at line 47 | |
| uint tr_attrset; /* set/create an attribute */ | | uint tr_attrset; /* set/create an attribute */ | |
| uint tr_attrrm; /* remove an attribute */ | | uint tr_attrrm; /* remove an attribute */ | |
| uint tr_clearagi; /* clear bad agi unlinked ino bucket */ | | uint tr_clearagi; /* clear bad agi unlinked ino bucket */ | |
| uint tr_growrtalloc; /* grow realtime allocations */ | | uint tr_growrtalloc; /* grow realtime allocations */ | |
| uint tr_growrtzero; /* grow realtime zeroing */ | | uint tr_growrtzero; /* grow realtime zeroing */ | |
| uint tr_growrtfree; /* grow realtime freeing */ | | uint tr_growrtfree; /* grow realtime freeing */ | |
| } xfs_trans_reservations_t; | | } xfs_trans_reservations_t; | |
| | | | |
| #ifndef __KERNEL__ | | #ifndef __KERNEL__ | |
| | | | |
|
| #define XFS_DADDR_TO_AGNO(mp,d) \ | | #define xfs_daddr_to_agno(mp,d) \ | |
| ((xfs_agnumber_t)(XFS_BB_TO_FSBT(mp, d) / (mp)->m_sb.sb_agblocks)) | | ((xfs_agnumber_t)(XFS_BB_TO_FSBT(mp, d) / (mp)->m_sb.sb_agblocks)) | |
|
| #define XFS_DADDR_TO_AGBNO(mp,d) \ | | #define xfs_daddr_to_agbno(mp,d) \ | |
| ((xfs_agblock_t)(XFS_BB_TO_FSBT(mp, d) % (mp)->m_sb.sb_agblocks)) | | ((xfs_agblock_t)(XFS_BB_TO_FSBT(mp, d) % (mp)->m_sb.sb_agblocks)) | |
| | | | |
| #else /* __KERNEL__ */ | | #else /* __KERNEL__ */ | |
| | | | |
|
| struct cred; | | #include "xfs_sync.h" | |
| | | | |
| struct log; | | struct log; | |
| struct xfs_mount_args; | | struct xfs_mount_args; | |
| struct xfs_inode; | | struct xfs_inode; | |
| struct xfs_bmbt_irec; | | struct xfs_bmbt_irec; | |
| struct xfs_bmap_free; | | struct xfs_bmap_free; | |
| struct xfs_extdelta; | | struct xfs_extdelta; | |
| struct xfs_swapext; | | struct xfs_swapext; | |
| struct xfs_mru_cache; | | struct xfs_mru_cache; | |
| struct xfs_nameops; | | struct xfs_nameops; | |
|
| | | struct xfs_ail; | |
| /* | | | |
| * Prototypes and functions for the Data Migration subsystem. | | | |
| */ | | | |
| | | | |
| typedef int (*xfs_send_data_t)(int, struct xfs_inode *, | | | |
| xfs_off_t, size_t, int, int *); | | | |
| typedef int (*xfs_send_mmap_t)(struct vm_area_struct *, uint); | | | |
| typedef int (*xfs_send_destroy_t)(struct xfs_inode *, dm_right_t); | | | |
| typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct xfs_mount *, | | | |
| struct xfs_inode *, dm_right_t, | | | |
| struct xfs_inode *, dm_right_t, | | | |
| const char *, const char *, mode_t, int, int); | | | |
| typedef int (*xfs_send_mount_t)(struct xfs_mount *, dm_right_t, | | | |
| char *, char *); | | | |
| typedef void (*xfs_send_unmount_t)(struct xfs_mount *, struct xfs_inode * | | | |
| , | | | |
| dm_right_t, mode_t, int, int); | | | |
| | | | |
| typedef struct xfs_dmops { | | | |
| xfs_send_data_t xfs_send_data; | | | |
| xfs_send_mmap_t xfs_send_mmap; | | | |
| xfs_send_destroy_t xfs_send_destroy; | | | |
| xfs_send_namesp_t xfs_send_namesp; | | | |
| xfs_send_mount_t xfs_send_mount; | | | |
| xfs_send_unmount_t xfs_send_unmount; | | | |
| } xfs_dmops_t; | | | |
| | | | |
| #define XFS_SEND_DATA(mp, ev,ip,off,len,fl,lock) \ | | | |
| (*(mp)->m_dm_ops->xfs_send_data)(ev,ip,off,len,fl,lock) | | | |
| #define XFS_SEND_MMAP(mp, vma,fl) \ | | | |
| (*(mp)->m_dm_ops->xfs_send_mmap)(vma,fl) | | | |
| #define XFS_SEND_DESTROY(mp, ip,right) \ | | | |
| (*(mp)->m_dm_ops->xfs_send_destroy)(ip,right) | | | |
| #define XFS_SEND_NAMESP(mp, ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) \ | | | |
| (*(mp)->m_dm_ops->xfs_send_namesp)(ev,NULL,b1,r1,b2,r2,n1,n2,mode,rv | | | |
| al,fl) | | | |
| #define XFS_SEND_PREUNMOUNT(mp,b1,r1,b2,r2,n1,n2,mode,rval,fl) \ | | | |
| (*(mp)->m_dm_ops->xfs_send_namesp)(DM_EVENT_PREUNMOUNT,mp,b1,r1,b2,r | | | |
| 2,n1,n2,mode,rval,fl) | | | |
| #define XFS_SEND_MOUNT(mp,right,path,name) \ | | | |
| (*(mp)->m_dm_ops->xfs_send_mount)(mp,right,path,name) | | | |
| #define XFS_SEND_UNMOUNT(mp, ip,right,mode,rval,fl) \ | | | |
| (*(mp)->m_dm_ops->xfs_send_unmount)(mp,ip,right,mode,rval,fl) | | | |
| | | | |
| /* | | | |
| * Prototypes and functions for the Quota Management subsystem. | | | |
| */ | | | |
| | | | |
| struct xfs_dquot; | | | |
| struct xfs_dqtrxops; | | | |
| struct xfs_quotainfo; | | struct xfs_quotainfo; | |
| | | | |
|
| typedef int (*xfs_qminit_t)(struct xfs_mount *, uint *, uint *); | | | |
| typedef int (*xfs_qmmount_t)(struct xfs_mount *, uint, uint); | | | |
| typedef int (*xfs_qmunmount_t)(struct xfs_mount *); | | | |
| typedef void (*xfs_qmdone_t)(struct xfs_mount *); | | | |
| typedef void (*xfs_dqrele_t)(struct xfs_dquot *); | | | |
| typedef int (*xfs_dqattach_t)(struct xfs_inode *, uint); | | | |
| typedef void (*xfs_dqdetach_t)(struct xfs_inode *); | | | |
| typedef int (*xfs_dqpurgeall_t)(struct xfs_mount *, uint); | | | |
| typedef int (*xfs_dqvopalloc_t)(struct xfs_mount *, | | | |
| struct xfs_inode *, uid_t, gid_t, prid_t, uint, | | | |
| struct xfs_dquot **, struct xfs_dquot **); | | | |
| typedef void (*xfs_dqvopcreate_t)(struct xfs_trans *, struct xfs_inode *, | | | |
| struct xfs_dquot *, struct xfs_dquot *); | | | |
| typedef int (*xfs_dqvoprename_t)(struct xfs_inode **); | | | |
| typedef struct xfs_dquot * (*xfs_dqvopchown_t)( | | | |
| struct xfs_trans *, struct xfs_inode *, | | | |
| struct xfs_dquot **, struct xfs_dquot *); | | | |
| typedef int (*xfs_dqvopchownresv_t)(struct xfs_trans *, struct xfs_inode | | | |
| *, | | | |
| struct xfs_dquot *, struct xfs_dquot *, uint); | | | |
| typedef void (*xfs_dqstatvfs_t)(struct xfs_inode *, bhv_statvfs_t *); | | | |
| typedef int (*xfs_dqsync_t)(struct xfs_mount *, int flags); | | | |
| typedef int (*xfs_quotactl_t)(struct xfs_mount *, int, int, xfs_caddr_t) | | | |
| ; | | | |
| | | | |
| typedef struct xfs_qmops { | | | |
| xfs_qminit_t xfs_qminit; | | | |
| xfs_qmdone_t xfs_qmdone; | | | |
| xfs_qmmount_t xfs_qmmount; | | | |
| xfs_qmunmount_t xfs_qmunmount; | | | |
| xfs_dqrele_t xfs_dqrele; | | | |
| xfs_dqattach_t xfs_dqattach; | | | |
| xfs_dqdetach_t xfs_dqdetach; | | | |
| xfs_dqpurgeall_t xfs_dqpurgeall; | | | |
| xfs_dqvopalloc_t xfs_dqvopalloc; | | | |
| xfs_dqvopcreate_t xfs_dqvopcreate; | | | |
| xfs_dqvoprename_t xfs_dqvoprename; | | | |
| xfs_dqvopchown_t xfs_dqvopchown; | | | |
| xfs_dqvopchownresv_t xfs_dqvopchownresv; | | | |
| xfs_dqstatvfs_t xfs_dqstatvfs; | | | |
| xfs_dqsync_t xfs_dqsync; | | | |
| xfs_quotactl_t xfs_quotactl; | | | |
| struct xfs_dqtrxops *xfs_dqtrxops; | | | |
| } xfs_qmops_t; | | | |
| | | | |
| #define XFS_QM_INIT(mp, mnt, fl) \ | | | |
| (*(mp)->m_qm_ops->xfs_qminit)(mp, mnt, fl) | | | |
| #define XFS_QM_MOUNT(mp, mnt, fl) \ | | | |
| (*(mp)->m_qm_ops->xfs_qmmount)(mp, mnt, fl) | | | |
| #define XFS_QM_UNMOUNT(mp) \ | | | |
| (*(mp)->m_qm_ops->xfs_qmunmount)(mp) | | | |
| #define XFS_QM_DONE(mp) \ | | | |
| (*(mp)->m_qm_ops->xfs_qmdone)(mp) | | | |
| #define XFS_QM_DQRELE(mp, dq) \ | | | |
| (*(mp)->m_qm_ops->xfs_dqrele)(dq) | | | |
| #define XFS_QM_DQATTACH(mp, ip, fl) \ | | | |
| (*(mp)->m_qm_ops->xfs_dqattach)(ip, fl) | | | |
| #define XFS_QM_DQDETACH(mp, ip) \ | | | |
| (*(mp)->m_qm_ops->xfs_dqdetach)(ip) | | | |
| #define XFS_QM_DQPURGEALL(mp, fl) \ | | | |
| (*(mp)->m_qm_ops->xfs_dqpurgeall)(mp, fl) | | | |
| #define XFS_QM_DQVOPALLOC(mp, ip, uid, gid, prid, fl, dq1, dq2) \ | | | |
| (*(mp)->m_qm_ops->xfs_dqvopalloc)(mp, ip, uid, gid, prid, fl, dq1, d | | | |
| q2) | | | |
| #define XFS_QM_DQVOPCREATE(mp, tp, ip, dq1, dq2) \ | | | |
| (*(mp)->m_qm_ops->xfs_dqvopcreate)(tp, ip, dq1, dq2) | | | |
| #define XFS_QM_DQVOPRENAME(mp, ip) \ | | | |
| (*(mp)->m_qm_ops->xfs_dqvoprename)(ip) | | | |
| #define XFS_QM_DQVOPCHOWN(mp, tp, ip, dqp, dq) \ | | | |
| (*(mp)->m_qm_ops->xfs_dqvopchown)(tp, ip, dqp, dq) | | | |
| #define XFS_QM_DQVOPCHOWNRESV(mp, tp, ip, dq1, dq2, fl) \ | | | |
| (*(mp)->m_qm_ops->xfs_dqvopchownresv)(tp, ip, dq1, dq2, fl) | | | |
| #define XFS_QM_DQSTATVFS(ip, statp) \ | | | |
| (*(ip)->i_mount->m_qm_ops->xfs_dqstatvfs)(ip, statp) | | | |
| #define XFS_QM_DQSYNC(mp, flags) \ | | | |
| (*(mp)->m_qm_ops->xfs_dqsync)(mp, flags) | | | |
| #define XFS_QM_QUOTACTL(mp, cmd, id, addr) \ | | | |
| (*(mp)->m_qm_ops->xfs_quotactl)(mp, cmd, id, addr) | | | |
| | | | |
| #ifdef HAVE_PERCPU_SB | | #ifdef HAVE_PERCPU_SB | |
| | | | |
| /* | | /* | |
| * Valid per-cpu incore superblock counters. Note that if you add new count
ers, | | * Valid per-cpu incore superblock counters. Note that if you add new count
ers, | |
| * you may need to define new counter disabled bit field descriptors as the
re | | * you may need to define new counter disabled bit field descriptors as the
re | |
| * are more possible fields in the superblock that can fit in a bitfield on
a | | * are more possible fields in the superblock that can fit in a bitfield on
a | |
| * 32 bit platform. The XFS_SBS_* values for the current current counters j
ust | | * 32 bit platform. The XFS_SBS_* values for the current current counters j
ust | |
| * fit. | | * fit. | |
| */ | | */ | |
| typedef struct xfs_icsb_cnts { | | typedef struct xfs_icsb_cnts { | |
| | | | |
| skipping to change at line 215 | | skipping to change at line 93 | |
| | | | |
| #define XFS_ICSB_FLAG_LOCK (1 << 0) /* counter lock bit */ | | #define XFS_ICSB_FLAG_LOCK (1 << 0) /* counter lock bit */ | |
| | | | |
| #define XFS_ICSB_LAZY_COUNT (1 << 1) /* accuracy not needed */ | | #define XFS_ICSB_LAZY_COUNT (1 << 1) /* accuracy not needed */ | |
| | | | |
| extern int xfs_icsb_init_counters(struct xfs_mount *); | | extern int xfs_icsb_init_counters(struct xfs_mount *); | |
| extern void xfs_icsb_reinit_counters(struct xfs_mount *); | | extern void xfs_icsb_reinit_counters(struct xfs_mount *); | |
| extern void xfs_icsb_destroy_counters(struct xfs_mount *); | | extern void xfs_icsb_destroy_counters(struct xfs_mount *); | |
| extern void xfs_icsb_sync_counters(struct xfs_mount *, int); | | extern void xfs_icsb_sync_counters(struct xfs_mount *, int); | |
| extern void xfs_icsb_sync_counters_locked(struct xfs_mount *, int); | | extern void xfs_icsb_sync_counters_locked(struct xfs_mount *, int); | |
|
| | | extern int xfs_icsb_modify_counters(struct xfs_mount *, xfs_sb_field_t, | |
| | | int64_t, int); | |
| | | | |
| #else | | #else | |
| #define xfs_icsb_init_counters(mp) (0) | | #define xfs_icsb_init_counters(mp) (0) | |
| #define xfs_icsb_destroy_counters(mp) do { } while (0) | | #define xfs_icsb_destroy_counters(mp) do { } while (0) | |
| #define xfs_icsb_reinit_counters(mp) do { } while (0) | | #define xfs_icsb_reinit_counters(mp) do { } while (0) | |
| #define xfs_icsb_sync_counters(mp, flags) do { } while (0) | | #define xfs_icsb_sync_counters(mp, flags) do { } while (0) | |
| #define xfs_icsb_sync_counters_locked(mp, flags) do { } while (0) | | #define xfs_icsb_sync_counters_locked(mp, flags) do { } while (0) | |
|
| | | #define xfs_icsb_modify_counters(mp, field, delta, rsvd) \ | |
| | | xfs_mod_incore_sb(mp, field, delta, rsvd) | |
| #endif | | #endif | |
| | | | |
|
| typedef struct xfs_ail { | | /* dynamic preallocation free space thresholds, 5% down to 1% */ | |
| struct list_head xa_ail; | | enum { | |
| uint xa_gen; | | XFS_LOWSP_1_PCNT = 0, | |
| struct task_struct *xa_task; | | XFS_LOWSP_2_PCNT, | |
| xfs_lsn_t xa_target; | | XFS_LOWSP_3_PCNT, | |
| } xfs_ail_t; | | XFS_LOWSP_4_PCNT, | |
| | | XFS_LOWSP_5_PCNT, | |
| | | XFS_LOWSP_MAX, | |
| | | }; | |
| | | | |
| typedef struct xfs_mount { | | typedef struct xfs_mount { | |
| struct super_block *m_super; | | struct super_block *m_super; | |
| xfs_tid_t m_tid; /* next unused tid for fs */ | | xfs_tid_t m_tid; /* next unused tid for fs */ | |
|
| spinlock_t m_ail_lock; /* fs AIL mutex */ | | struct xfs_ail *m_ail; /* fs active log item list * | |
| xfs_ail_t m_ail; /* fs active log item list * | | / | |
| / | | | |
| xfs_sb_t m_sb; /* copy of fs superblock */ | | xfs_sb_t m_sb; /* copy of fs superblock */ | |
| spinlock_t m_sb_lock; /* sb counter lock */ | | spinlock_t m_sb_lock; /* sb counter lock */ | |
| struct xfs_buf *m_sb_bp; /* buffer for superblock */ | | struct xfs_buf *m_sb_bp; /* buffer for superblock */ | |
| char *m_fsname; /* filesystem name */ | | char *m_fsname; /* filesystem name */ | |
| int m_fsname_len; /* strlen of fs name */ | | int m_fsname_len; /* strlen of fs name */ | |
| char *m_rtname; /* realtime device name */ | | char *m_rtname; /* realtime device name */ | |
| char *m_logname; /* external log device name
*/ | | char *m_logname; /* external log device name
*/ | |
| int m_bsize; /* fs logical block size */ | | int m_bsize; /* fs logical block size */ | |
| xfs_agnumber_t m_agfrotor; /* last ag where space found
*/ | | xfs_agnumber_t m_agfrotor; /* last ag where space found
*/ | |
| xfs_agnumber_t m_agirotor; /* last ag dir inode alloced
*/ | | xfs_agnumber_t m_agirotor; /* last ag dir inode alloced
*/ | |
| spinlock_t m_agirotor_lock;/* .. and lock protecting it
*/ | | spinlock_t m_agirotor_lock;/* .. and lock protecting it
*/ | |
| xfs_agnumber_t m_maxagi; /* highest inode alloc group
*/ | | xfs_agnumber_t m_maxagi; /* highest inode alloc group
*/ | |
|
| struct xfs_inode *m_inodes; /* active inode list */ | | | |
| struct list_head m_del_inodes; /* inodes to reclaim */ | | | |
| mutex_t m_ilock; /* inode list mutex */ | | | |
| uint m_ireclaims; /* count of calls to reclaim | | | |
| */ | | | |
| uint m_readio_log; /* min read size log bytes *
/ | | uint m_readio_log; /* min read size log bytes *
/ | |
| uint m_readio_blocks; /* min read size blocks */ | | uint m_readio_blocks; /* min read size blocks */ | |
| uint m_writeio_log; /* min write size log bytes
*/ | | uint m_writeio_log; /* min write size log bytes
*/ | |
| uint m_writeio_blocks; /* min write size blocks *
/ | | uint m_writeio_blocks; /* min write size blocks *
/ | |
| struct log *m_log; /* log specific stuff */ | | struct log *m_log; /* log specific stuff */ | |
| int m_logbufs; /* number of log buffers */ | | int m_logbufs; /* number of log buffers */ | |
| int m_logbsize; /* size of each log buffer *
/ | | int m_logbsize; /* size of each log buffer *
/ | |
| uint m_rsumlevels; /* rt summary levels */ | | uint m_rsumlevels; /* rt summary levels */ | |
| uint m_rsumsize; /* size of rt summary, bytes
*/ | | uint m_rsumsize; /* size of rt summary, bytes
*/ | |
| struct xfs_inode *m_rbmip; /* pointer to bitmap inode *
/ | | struct xfs_inode *m_rbmip; /* pointer to bitmap inode *
/ | |
| | | | |
| skipping to change at line 284 | | skipping to change at line 164 | |
| uint m_blockwsize; /* sb_blocksize in words */ | | uint m_blockwsize; /* sb_blocksize in words */ | |
| uint m_blockwmask; /* blockwsize-1 */ | | uint m_blockwmask; /* blockwsize-1 */ | |
| uint m_alloc_mxr[2]; /* max alloc btree records *
/ | | uint m_alloc_mxr[2]; /* max alloc btree records *
/ | |
| uint m_alloc_mnr[2]; /* min alloc btree records *
/ | | uint m_alloc_mnr[2]; /* min alloc btree records *
/ | |
| uint m_bmap_dmxr[2]; /* max bmap btree records */ | | uint m_bmap_dmxr[2]; /* max bmap btree records */ | |
| uint m_bmap_dmnr[2]; /* min bmap btree records */ | | uint m_bmap_dmnr[2]; /* min bmap btree records */ | |
| uint m_inobt_mxr[2]; /* max inobt btree records *
/ | | uint m_inobt_mxr[2]; /* max inobt btree records *
/ | |
| uint m_inobt_mnr[2]; /* min inobt btree records *
/ | | uint m_inobt_mnr[2]; /* min inobt btree records *
/ | |
| uint m_ag_maxlevels; /* XFS_AG_MAXLEVELS */ | | uint m_ag_maxlevels; /* XFS_AG_MAXLEVELS */ | |
| uint m_bm_maxlevels[2]; /* XFS_BM_MAXLEVELS */ | | uint m_bm_maxlevels[2]; /* XFS_BM_MAXLEVELS */ | |
|
| uint m_in_maxlevels; /* XFS_IN_MAXLEVELS */ | | uint m_in_maxlevels; /* max inobt btree levels. * | |
| struct xfs_perag *m_perag; /* per-ag accounting info */ | | / | |
| struct rw_semaphore m_peraglock; /* lock for m_perag (pointer | | struct radix_tree_root m_perag_tree; /* per-ag accounting info */ | |
| ) */ | | spinlock_t m_perag_lock; /* lock for m_perag_tree */ | |
| struct mutex m_growlock; /* growfs mutex */ | | struct mutex m_growlock; /* growfs mutex */ | |
| int m_fixedfsid[2]; /* unchanged for life of FS
*/ | | int m_fixedfsid[2]; /* unchanged for life of FS
*/ | |
| uint m_dmevmask; /* DMI events for this FS */ | | uint m_dmevmask; /* DMI events for this FS */ | |
| __uint64_t m_flags; /* global mount flags */ | | __uint64_t m_flags; /* global mount flags */ | |
|
| uint m_attroffset; /* inode attribute offset */ | | | |
| uint m_dir_node_ents; /* #entries in a dir danode
*/ | | uint m_dir_node_ents; /* #entries in a dir danode
*/ | |
| uint m_attr_node_ents; /* #entries in attr danode
*/ | | uint m_attr_node_ents; /* #entries in attr danode
*/ | |
| int m_ialloc_inos; /* inodes in inode allocatio
n */ | | int m_ialloc_inos; /* inodes in inode allocatio
n */ | |
| int m_ialloc_blks; /* blocks in inode allocatio
n */ | | int m_ialloc_blks; /* blocks in inode allocatio
n */ | |
|
| int m_litino; /* size of inode union area
*/ | | | |
| int m_inoalign_mask;/* mask sb_inoalignmt if use
d */ | | int m_inoalign_mask;/* mask sb_inoalignmt if use
d */ | |
| uint m_qflags; /* quota status flags */ | | uint m_qflags; /* quota status flags */ | |
| xfs_trans_reservations_t m_reservations;/* precomputed res values */ | | xfs_trans_reservations_t m_reservations;/* precomputed res values */ | |
| __uint64_t m_maxicount; /* maximum inode count */ | | __uint64_t m_maxicount; /* maximum inode count */ | |
| __uint64_t m_maxioffset; /* maximum inode offset */ | | __uint64_t m_maxioffset; /* maximum inode offset */ | |
| __uint64_t m_resblks; /* total reserved blocks */ | | __uint64_t m_resblks; /* total reserved blocks */ | |
| __uint64_t m_resblks_avail;/* available reserved blocks
*/ | | __uint64_t m_resblks_avail;/* available reserved blocks
*/ | |
|
| #if XFS_BIG_INUMS | | __uint64_t m_resblks_save; /* reserved blks @ remount,r | |
| xfs_ino_t m_inoadd; /* add value for ino64_offse | | o */ | |
| t */ | | | |
| #endif | | | |
| int m_dalign; /* stripe unit */ | | int m_dalign; /* stripe unit */ | |
| int m_swidth; /* stripe width */ | | int m_swidth; /* stripe width */ | |
| int m_sinoalign; /* stripe unit inode alignme
nt */ | | int m_sinoalign; /* stripe unit inode alignme
nt */ | |
| int m_attr_magicpct;/* 37% of the blocksize */ | | int m_attr_magicpct;/* 37% of the blocksize */ | |
| int m_dir_magicpct; /* 37% of the dir blocksize
*/ | | int m_dir_magicpct; /* 37% of the dir blocksize
*/ | |
|
| __uint8_t m_mk_sharedro; /* mark shared ro on unmount | | | |
| */ | | | |
| __uint8_t m_inode_quiesce;/* call quiesce on new inode | | | |
| s. | | | |
| field governed by m_ilock | | | |
| */ | | | |
| __uint8_t m_sectbb_log; /* sectlog - BBSHIFT */ | | __uint8_t m_sectbb_log; /* sectlog - BBSHIFT */ | |
| const struct xfs_nameops *m_dirnameops; /* vector of dir name ops */ | | const struct xfs_nameops *m_dirnameops; /* vector of dir name ops */ | |
| int m_dirblksize; /* directory block sz--bytes
*/ | | int m_dirblksize; /* directory block sz--bytes
*/ | |
| int m_dirblkfsbs; /* directory block sz--fsbs
*/ | | int m_dirblkfsbs; /* directory block sz--fsbs
*/ | |
| xfs_dablk_t m_dirdatablk; /* blockno of dir data v2 */ | | xfs_dablk_t m_dirdatablk; /* blockno of dir data v2 */ | |
| xfs_dablk_t m_dirleafblk; /* blockno of dir non-data v
2 */ | | xfs_dablk_t m_dirleafblk; /* blockno of dir non-data v
2 */ | |
| xfs_dablk_t m_dirfreeblk; /* blockno of dirfreeindex v
2 */ | | xfs_dablk_t m_dirfreeblk; /* blockno of dirfreeindex v
2 */ | |
| uint m_chsize; /* size of next field */ | | uint m_chsize; /* size of next field */ | |
| struct xfs_chash *m_chash; /* fs private inode per-clus
ter | | struct xfs_chash *m_chash; /* fs private inode per-clus
ter | |
| * hash table */ | | * hash table */ | |
|
| struct xfs_dmops *m_dm_ops; /* vector of DMI ops */ | | | |
| struct xfs_qmops *m_qm_ops; /* vector of XQM ops */ | | | |
| atomic_t m_active_trans; /* number trans frozen */ | | atomic_t m_active_trans; /* number trans frozen */ | |
| #ifdef HAVE_PERCPU_SB | | #ifdef HAVE_PERCPU_SB | |
|
| xfs_icsb_cnts_t *m_sb_cnts; /* per-cpu superblock counte
rs */ | | xfs_icsb_cnts_t __percpu *m_sb_cnts; /* per-cpu superblock counte
rs */ | |
| unsigned long m_icsb_counters; /* disabled per-cpu counter
s */ | | unsigned long m_icsb_counters; /* disabled per-cpu counter
s */ | |
| struct notifier_block m_icsb_notifier; /* hotplug cpu notifier */ | | struct notifier_block m_icsb_notifier; /* hotplug cpu notifier */ | |
| struct mutex m_icsb_mutex; /* balancer sync lock */ | | struct mutex m_icsb_mutex; /* balancer sync lock */ | |
| #endif | | #endif | |
| struct xfs_mru_cache *m_filestream; /* per-mount filestream data
*/ | | struct xfs_mru_cache *m_filestream; /* per-mount filestream data
*/ | |
| struct task_struct *m_sync_task; /* generalised sync thread *
/ | | struct task_struct *m_sync_task; /* generalised sync thread *
/ | |
|
| bhv_vfs_sync_work_t m_sync_work; /* work item for VFS_SYNC */ | | xfs_sync_work_t m_sync_work; /* work item for VFS_SYNC */ | |
| struct list_head m_sync_list; /* sync thread work item lis
t */ | | struct list_head m_sync_list; /* sync thread work item lis
t */ | |
| spinlock_t m_sync_lock; /* work item list lock */ | | spinlock_t m_sync_lock; /* work item list lock */ | |
| int m_sync_seq; /* sync thread generation no
. */ | | int m_sync_seq; /* sync thread generation no
. */ | |
| wait_queue_head_t m_wait_single_sync_task; | | wait_queue_head_t m_wait_single_sync_task; | |
|
| struct vfsmount *m_vfsmount; | | __int64_t m_update_flags; /* sb flags we need to updat | |
| | | e | |
| | | on the next remount,rw */ | |
| | | struct shrinker m_inode_shrink; /* inode reclaim shrinker */ | |
| | | int64_t m_low_space[XFS_LOWSP_MAX]; | |
| | | /* low free space thresholds | |
| | | */ | |
| } xfs_mount_t; | | } xfs_mount_t; | |
| | | | |
| /* | | /* | |
| * Flags for m_flags. | | * Flags for m_flags. | |
| */ | | */ | |
| #define XFS_MOUNT_WSYNC (1ULL << 0) /* for nfs - all met
adata ops | | #define XFS_MOUNT_WSYNC (1ULL << 0) /* for nfs - all met
adata ops | |
| must be synchronous excep
t | | must be synchronous excep
t | |
| for space allocations */ | | for space allocations */ | |
|
| #define XFS_MOUNT_INO64 (1ULL << 1) | | #define XFS_MOUNT_DELAYLOG (1ULL << 1) /* delayed logging is enable | |
| #define XFS_MOUNT_DMAPI (1ULL << 2) /* dmapi is enabled | | d */ | |
| */ | | | |
| #define XFS_MOUNT_WAS_CLEAN (1ULL << 3) | | #define XFS_MOUNT_WAS_CLEAN (1ULL << 3) | |
| #define XFS_MOUNT_FS_SHUTDOWN (1ULL << 4) /* atomic stop of all filesy
stem | | #define XFS_MOUNT_FS_SHUTDOWN (1ULL << 4) /* atomic stop of all filesy
stem | |
| operations, typically for | | operations, typically for | |
| disk errors in metadata *
/ | | disk errors in metadata *
/ | |
| #define XFS_MOUNT_RETERR (1ULL << 6) /* return alignment errors t
o | | #define XFS_MOUNT_RETERR (1ULL << 6) /* return alignment errors t
o | |
| user */ | | user */ | |
| #define XFS_MOUNT_NOALIGN (1ULL << 7) /* turn off stripe alignment | | #define XFS_MOUNT_NOALIGN (1ULL << 7) /* turn off stripe alignment | |
| allocations */ | | allocations */ | |
| #define XFS_MOUNT_ATTR2 (1ULL << 8) /* allow use of attr
2 format */ | | #define XFS_MOUNT_ATTR2 (1ULL << 8) /* allow use of attr
2 format */ | |
| #define XFS_MOUNT_GRPID (1ULL << 9) /* group-ID assigned
from directory */ | | #define XFS_MOUNT_GRPID (1ULL << 9) /* group-ID assigned
from directory */ | |
| #define XFS_MOUNT_NORECOVERY (1ULL << 10) /* no recovery - dirty fs */ | | #define XFS_MOUNT_NORECOVERY (1ULL << 10) /* no recovery - dirty fs */ | |
|
| #define XFS_MOUNT_SHARED (1ULL << 11) /* shared mount */ | | | |
| #define XFS_MOUNT_DFLT_IOSIZE (1ULL << 12) /* set default i/o size */ | | #define XFS_MOUNT_DFLT_IOSIZE (1ULL << 12) /* set default i/o size */ | |
|
| #define XFS_MOUNT_OSYNCISOSYNC (1ULL << 13) /* o_sync is REALLY o_sync * | | | |
| / | | | |
| /* osyncisdsync is now defau | | | |
| lt*/ | | | |
| #define XFS_MOUNT_32BITINODES (1ULL << 14) /* do not create inodes abov
e | | #define XFS_MOUNT_32BITINODES (1ULL << 14) /* do not create inodes abov
e | |
| * 32 bits in size */ | | * 32 bits in size */ | |
| #define XFS_MOUNT_SMALL_INUMS (1ULL << 15) /* users wants 32bit inodes
*/ | | #define XFS_MOUNT_SMALL_INUMS (1ULL << 15) /* users wants 32bit inodes
*/ | |
| #define XFS_MOUNT_NOUUID (1ULL << 16) /* ignore uuid during mount
*/ | | #define XFS_MOUNT_NOUUID (1ULL << 16) /* ignore uuid during mount
*/ | |
| #define XFS_MOUNT_BARRIER (1ULL << 17) | | #define XFS_MOUNT_BARRIER (1ULL << 17) | |
| #define XFS_MOUNT_IKEEP (1ULL << 18) /* keep empty inode
clusters*/ | | #define XFS_MOUNT_IKEEP (1ULL << 18) /* keep empty inode
clusters*/ | |
| #define XFS_MOUNT_SWALLOC (1ULL << 19) /* turn on stripe width | | #define XFS_MOUNT_SWALLOC (1ULL << 19) /* turn on stripe width | |
| * allocation */ | | * allocation */ | |
| #define XFS_MOUNT_RDONLY (1ULL << 20) /* read-only fs */ | | #define XFS_MOUNT_RDONLY (1ULL << 20) /* read-only fs */ | |
| #define XFS_MOUNT_DIRSYNC (1ULL << 21) /* synchronous directory ops
*/ | | #define XFS_MOUNT_DIRSYNC (1ULL << 21) /* synchronous directory ops
*/ | |
| #define XFS_MOUNT_COMPAT_IOSIZE (1ULL << 22) /* don't report larg
e preferred | | #define XFS_MOUNT_COMPAT_IOSIZE (1ULL << 22) /* don't report larg
e preferred | |
| * I/O size in stat() */ | | * I/O size in stat() */ | |
|
| #define XFS_MOUNT_NO_PERCPU_SB (1ULL << 23) /* don't use per-cpu superbl | | | |
| ock | | | |
| counters */ | | | |
| #define XFS_MOUNT_FILESTREAMS (1ULL << 24) /* enable the filestreams | | #define XFS_MOUNT_FILESTREAMS (1ULL << 24) /* enable the filestreams | |
| allocator */ | | allocator */ | |
| #define XFS_MOUNT_NOATTR2 (1ULL << 25) /* disable use of attr2 form
at */ | | #define XFS_MOUNT_NOATTR2 (1ULL << 25) /* disable use of attr2 form
at */ | |
| | | | |
| /* | | /* | |
| * Default minimum read and write sizes. | | * Default minimum read and write sizes. | |
| */ | | */ | |
| #define XFS_READIO_LOG_LARGE 16 | | #define XFS_READIO_LOG_LARGE 16 | |
| #define XFS_WRITEIO_LOG_LARGE 16 | | #define XFS_WRITEIO_LOG_LARGE 16 | |
| | | | |
| | | | |
| skipping to change at line 402 | | skipping to change at line 271 | |
| * Max and min values for mount-option defined I/O | | * Max and min values for mount-option defined I/O | |
| * preallocation sizes. | | * preallocation sizes. | |
| */ | | */ | |
| #define XFS_MAX_IO_LOG 30 /* 1G */ | | #define XFS_MAX_IO_LOG 30 /* 1G */ | |
| #define XFS_MIN_IO_LOG PAGE_SHIFT | | #define XFS_MIN_IO_LOG PAGE_SHIFT | |
| | | | |
| /* | | /* | |
| * Synchronous read and write sizes. This should be | | * Synchronous read and write sizes. This should be | |
| * better for NFSv2 wsync filesystems. | | * better for NFSv2 wsync filesystems. | |
| */ | | */ | |
|
| #define XFS_WSYNC_READIO_LOG 15 /* 32K */ | | #define XFS_WSYNC_READIO_LOG 15 /* 32k */ | |
| #define XFS_WSYNC_WRITEIO_LOG 14 /* 16K */ | | #define XFS_WSYNC_WRITEIO_LOG 14 /* 16k */ | |
| | | | |
| /* | | /* | |
| * Allow large block sizes to be reported to userspace programs if the | | * Allow large block sizes to be reported to userspace programs if the | |
| * "largeio" mount option is used. | | * "largeio" mount option is used. | |
| * | | * | |
| * If compatibility mode is specified, simply return the basic unit of cach
ing | | * If compatibility mode is specified, simply return the basic unit of cach
ing | |
| * so that we don't get inefficient read/modify/write I/O from user apps. | | * so that we don't get inefficient read/modify/write I/O from user apps. | |
| * Otherwise.... | | * Otherwise.... | |
| * | | * | |
| * If the underlying volume is a stripe, then return the stripe width in by
tes | | * If the underlying volume is a stripe, then return the stripe width in by
tes | |
| | | | |
| skipping to change at line 439 | | skipping to change at line 308 | |
| #define XFS_MAXIOFFSET(mp) ((mp)->m_maxioffset) | | #define XFS_MAXIOFFSET(mp) ((mp)->m_maxioffset) | |
| | | | |
| #define XFS_LAST_UNMOUNT_WAS_CLEAN(mp) \ | | #define XFS_LAST_UNMOUNT_WAS_CLEAN(mp) \ | |
| ((mp)->m_flags & XFS_MOUNT_WAS_CLEAN) | | ((mp)->m_flags & XFS_MOUNT_WAS_CLEAN) | |
| #define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDO
WN) | | #define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDO
WN) | |
| void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname, | | void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname, | |
| int lnnum); | | int lnnum); | |
| #define xfs_force_shutdown(m,f) \ | | #define xfs_force_shutdown(m,f) \ | |
| xfs_do_force_shutdown(m, f, __FILE__, __LINE__) | | xfs_do_force_shutdown(m, f, __FILE__, __LINE__) | |
| | | | |
|
| | | #define SHUTDOWN_META_IO_ERROR 0x0001 /* write attempt to metadata failed | |
| | | */ | |
| | | #define SHUTDOWN_LOG_IO_ERROR 0x0002 /* write attempt to the log failed * | |
| | | / | |
| | | #define SHUTDOWN_FORCE_UMOUNT 0x0004 /* shutdown from a forced unmount */ | |
| | | #define SHUTDOWN_CORRUPT_INCORE 0x0008 /* corrupt in-memory data st | |
| | | ructures */ | |
| | | #define SHUTDOWN_REMOTE_REQ 0x0010 /* shutdown came from remote cell */ | |
| | | #define SHUTDOWN_DEVICE_REQ 0x0020 /* failed all paths to the device */ | |
| | | | |
| | | #define xfs_test_for_freeze(mp) ((mp)->m_super->s_frozen) | |
| | | #define xfs_wait_for_freeze(mp,l) vfs_check_frozen((mp)->m_super, (l)) | |
| | | | |
| /* | | /* | |
| * Flags for xfs_mountfs | | * Flags for xfs_mountfs | |
| */ | | */ | |
| #define XFS_MFSI_QUIET 0x40 /* Be silent if mount errors found *
/ | | #define XFS_MFSI_QUIET 0x40 /* Be silent if mount errors found *
/ | |
| | | | |
|
| #define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d) | | | |
| static inline xfs_agnumber_t | | static inline xfs_agnumber_t | |
| xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d) | | xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d) | |
| { | | { | |
| xfs_daddr_t ld = XFS_BB_TO_FSBT(mp, d); | | xfs_daddr_t ld = XFS_BB_TO_FSBT(mp, d); | |
| do_div(ld, mp->m_sb.sb_agblocks); | | do_div(ld, mp->m_sb.sb_agblocks); | |
| return (xfs_agnumber_t) ld; | | return (xfs_agnumber_t) ld; | |
| } | | } | |
| | | | |
|
| #define XFS_DADDR_TO_AGBNO(mp,d) xfs_daddr_to_agbno(mp,d) | | | |
| static inline xfs_agblock_t | | static inline xfs_agblock_t | |
| xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d) | | xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d) | |
| { | | { | |
| xfs_daddr_t ld = XFS_BB_TO_FSBT(mp, d); | | xfs_daddr_t ld = XFS_BB_TO_FSBT(mp, d); | |
| return (xfs_agblock_t) do_div(ld, mp->m_sb.sb_agblocks); | | return (xfs_agblock_t) do_div(ld, mp->m_sb.sb_agblocks); | |
| } | | } | |
| | | | |
| /* | | /* | |
|
| * perag get/put wrappers for eventual ref counting | | | |
| */ | | | |
| static inline xfs_perag_t * | | | |
| xfs_get_perag(struct xfs_mount *mp, xfs_ino_t ino) | | | |
| { | | | |
| return &mp->m_perag[XFS_INO_TO_AGNO(mp, ino)]; | | | |
| } | | | |
| | | | |
| static inline void | | | |
| xfs_put_perag(struct xfs_mount *mp, xfs_perag_t *pag) | | | |
| { | | | |
| /* nothing to see here, move along */ | | | |
| } | | | |
| | | | |
| /* | | | |
| * Per-cpu superblock locking functions | | * Per-cpu superblock locking functions | |
| */ | | */ | |
| #ifdef HAVE_PERCPU_SB | | #ifdef HAVE_PERCPU_SB | |
|
| STATIC_INLINE void | | static inline void | |
| xfs_icsb_lock(xfs_mount_t *mp) | | xfs_icsb_lock(xfs_mount_t *mp) | |
| { | | { | |
| mutex_lock(&mp->m_icsb_mutex); | | mutex_lock(&mp->m_icsb_mutex); | |
| } | | } | |
| | | | |
|
| STATIC_INLINE void | | static inline void | |
| xfs_icsb_unlock(xfs_mount_t *mp) | | xfs_icsb_unlock(xfs_mount_t *mp) | |
| { | | { | |
| mutex_unlock(&mp->m_icsb_mutex); | | mutex_unlock(&mp->m_icsb_mutex); | |
| } | | } | |
| #else | | #else | |
| #define xfs_icsb_lock(mp) | | #define xfs_icsb_lock(mp) | |
| #define xfs_icsb_unlock(mp) | | #define xfs_icsb_unlock(mp) | |
| #endif | | #endif | |
| | | | |
| /* | | /* | |
| * This structure is for use by the xfs_mod_incore_sb_batch() routine. | | * This structure is for use by the xfs_mod_incore_sb_batch() routine. | |
| * xfs_growfs can specify a few fields which are more than int limit | | * xfs_growfs can specify a few fields which are more than int limit | |
| */ | | */ | |
| typedef struct xfs_mod_sb { | | typedef struct xfs_mod_sb { | |
| xfs_sb_field_t msb_field; /* Field to modify, see below */ | | xfs_sb_field_t msb_field; /* Field to modify, see below */ | |
| int64_t msb_delta; /* Change to make to specified field
*/ | | int64_t msb_delta; /* Change to make to specified field
*/ | |
| } xfs_mod_sb_t; | | } xfs_mod_sb_t; | |
| | | | |
|
| #define XFS_MOUNT_ILOCK(mp) mutex_lock(&((mp)->m_ilock)) | | | |
| #define XFS_MOUNT_IUNLOCK(mp) mutex_unlock(&((mp)->m_ilock)) | | | |
| | | | |
| extern int xfs_log_sbcount(xfs_mount_t *, uint); | | extern int xfs_log_sbcount(xfs_mount_t *, uint); | |
|
| | | extern __uint64_t xfs_default_resblks(xfs_mount_t *mp); | |
| extern int xfs_mountfs(xfs_mount_t *mp); | | extern int xfs_mountfs(xfs_mount_t *mp); | |
|
| extern void xfs_mountfs_check_barriers(xfs_mount_t *mp); | | | |
| | | | |
| extern void xfs_unmountfs(xfs_mount_t *); | | extern void xfs_unmountfs(xfs_mount_t *); | |
| extern int xfs_unmountfs_writesb(xfs_mount_t *); | | extern int xfs_unmountfs_writesb(xfs_mount_t *); | |
|
| extern int xfs_unmount_flush(xfs_mount_t *, int); | | | |
| extern int xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int64_t, in
t); | | extern int xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int64_t, in
t); | |
|
| extern int xfs_mod_incore_sb_unlocked(xfs_mount_t *, xfs_sb_field_t, | | | |
| int64_t, int); | | | |
| extern int xfs_mod_incore_sb_batch(xfs_mount_t *, xfs_mod_sb_t *, | | extern int xfs_mod_incore_sb_batch(xfs_mount_t *, xfs_mod_sb_t *, | |
| uint, int); | | uint, int); | |
|
| | | extern int xfs_mount_log_sb(xfs_mount_t *, __int64_t); | |
| extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int); | | extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int); | |
| extern int xfs_readsb(xfs_mount_t *, int); | | extern int xfs_readsb(xfs_mount_t *, int); | |
| extern void xfs_freesb(xfs_mount_t *); | | extern void xfs_freesb(xfs_mount_t *); | |
| extern int xfs_fs_writable(xfs_mount_t *); | | extern int xfs_fs_writable(xfs_mount_t *); | |
|
| extern int xfs_syncsub(xfs_mount_t *, int, int *); | | | |
| extern int xfs_sync_inodes(xfs_mount_t *, int, int *); | | | |
| extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); | | extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); | |
| | | | |
|
| extern int xfs_dmops_get(struct xfs_mount *, struct xfs_mount_args *); | | extern int xfs_dev_is_read_only(struct xfs_mount *, char *); | |
| extern void xfs_dmops_put(struct xfs_mount *); | | | |
| extern int xfs_qmops_get(struct xfs_mount *, struct xfs_mount_args *); | | | |
| extern void xfs_qmops_put(struct xfs_mount *); | | | |
| | | | |
|
| extern struct xfs_dmops xfs_dmcore_xfs; | | extern void xfs_set_low_space_thresholds(struct xfs_mount *); | |
| | | | |
| #endif /* __KERNEL__ */ | | #endif /* __KERNEL__ */ | |
| | | | |
|
| | | /* | |
| | | * perag get/put wrappers for ref counting | |
| | | */ | |
| | | struct xfs_perag *xfs_perag_get(struct xfs_mount *mp, xfs_agnumber_t agno); | |
| | | struct xfs_perag *xfs_perag_get_tag(struct xfs_mount *mp, xfs_agnumber_t ag | |
| | | no, | |
| | | int tag); | |
| | | void xfs_perag_put(struct xfs_perag *pag); | |
| | | | |
| extern void xfs_mod_sb(struct xfs_trans *, __int64_t); | | extern void xfs_mod_sb(struct xfs_trans *, __int64_t); | |
|
| extern xfs_agnumber_t xfs_initialize_perag(struct xfs_mount *, xfs_agnumbe | | extern int xfs_initialize_perag(struct xfs_mount *, xfs_agnumber_t, | |
| r_t); | | xfs_agnumber_t *); | |
| extern void xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *); | | extern void xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *); | |
| extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t)
; | | extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t)
; | |
| | | | |
| #endif /* __XFS_MOUNT_H__ */ | | #endif /* __XFS_MOUNT_H__ */ | |
| | | | |
End of changes. 41 change blocks. |
| 216 lines changed or deleted | | 69 lines changed or added | |
|
| xfs_quota.h | | xfs_quota.h | |
| | | | |
| skipping to change at line 21 | | skipping to change at line 21 | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| * GNU General Public License for more details. | | * GNU General Public License for more details. | |
| * | | * | |
| * You should have received a copy of the GNU General Public License | | * You should have received a copy of the GNU General Public License | |
| * along with this program; if not, write the Free Software Foundation, | | * along with this program; if not, write the Free Software Foundation, | |
| * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
| */ | | */ | |
| #ifndef __XFS_QUOTA_H__ | | #ifndef __XFS_QUOTA_H__ | |
| #define __XFS_QUOTA_H__ | | #define __XFS_QUOTA_H__ | |
| | | | |
|
| | | struct xfs_trans; | |
| | | | |
| /* | | /* | |
| * The ondisk form of a dquot structure. | | * The ondisk form of a dquot structure. | |
| */ | | */ | |
| #define XFS_DQUOT_MAGIC 0x4451 /* 'DQ' */ | | #define XFS_DQUOT_MAGIC 0x4451 /* 'DQ' */ | |
| #define XFS_DQUOT_VERSION (u_int8_t)0x01 /* latest version number */ | | #define XFS_DQUOT_VERSION (u_int8_t)0x01 /* latest version number */ | |
| | | | |
| /* | | /* | |
| * uid_t and gid_t are hard-coded to 32 bits in the inode. | | * uid_t and gid_t are hard-coded to 32 bits in the inode. | |
| * Hence, an 'id' in a dquot is 32 bits.. | | * Hence, an 'id' in a dquot is 32 bits.. | |
| */ | | */ | |
| | | | |
| skipping to change at line 87 | | skipping to change at line 89 | |
| xfs_disk_dquot_t dd_diskdq; /* portion that lives incore as well
*/ | | xfs_disk_dquot_t dd_diskdq; /* portion that lives incore as well
*/ | |
| char dd_fill[32]; /* filling for posterity */ | | char dd_fill[32]; /* filling for posterity */ | |
| } xfs_dqblk_t; | | } xfs_dqblk_t; | |
| | | | |
| /* | | /* | |
| * flags for q_flags field in the dquot. | | * flags for q_flags field in the dquot. | |
| */ | | */ | |
| #define XFS_DQ_USER 0x0001 /* a user quota */ | | #define XFS_DQ_USER 0x0001 /* a user quota */ | |
| #define XFS_DQ_PROJ 0x0002 /* project quota */ | | #define XFS_DQ_PROJ 0x0002 /* project quota */ | |
| #define XFS_DQ_GROUP 0x0004 /* a group quota */ | | #define XFS_DQ_GROUP 0x0004 /* a group quota */ | |
|
| #define XFS_DQ_FLOCKED 0x0008 /* flush lock taken */ | | #define XFS_DQ_DIRTY 0x0008 /* dquot is dirty */ | |
| #define XFS_DQ_DIRTY 0x0010 /* dquot is dirty */ | | #define XFS_DQ_WANT 0x0010 /* for lookup/reclaim race * | |
| #define XFS_DQ_WANT 0x0020 /* for lookup/reclaim race * | | / | |
| / | | #define XFS_DQ_INACTIVE 0x0020 /* dq off mplist & h | |
| #define XFS_DQ_INACTIVE 0x0040 /* dq off mplist & h | | ashlist */ | |
| ashlist */ | | | |
| #define XFS_DQ_MARKER 0x0080 /* sentinel */ | | | |
| | | | |
| #define XFS_DQ_ALLTYPES (XFS_DQ_USER|XFS_DQ_PROJ|XFS_DQ_GROU
P) | | #define XFS_DQ_ALLTYPES (XFS_DQ_USER|XFS_DQ_PROJ|XFS_DQ_GROU
P) | |
| | | | |
|
| | | #define XFS_DQ_FLAGS \ | |
| | | { XFS_DQ_USER, "USER" }, \ | |
| | | { XFS_DQ_PROJ, "PROJ" }, \ | |
| | | { XFS_DQ_GROUP, "GROUP" }, \ | |
| | | { XFS_DQ_DIRTY, "DIRTY" }, \ | |
| | | { XFS_DQ_WANT, "WANT" }, \ | |
| | | { XFS_DQ_INACTIVE, "INACTIVE" } | |
| | | | |
| /* | | /* | |
| * In the worst case, when both user and group quotas are on, | | * In the worst case, when both user and group quotas are on, | |
| * we can have a max of three dquots changing in a single transaction. | | * we can have a max of three dquots changing in a single transaction. | |
| */ | | */ | |
| #define XFS_DQUOT_LOGRES(mp) (sizeof(xfs_disk_dquot_t) * 3) | | #define XFS_DQUOT_LOGRES(mp) (sizeof(xfs_disk_dquot_t) * 3) | |
| | | | |
| /* | | /* | |
| * These are the structures used to lay out dquots and quotaoff | | * These are the structures used to lay out dquots and quotaoff | |
| * records on the log. Quite similar to those of inodes. | | * records on the log. Quite similar to those of inodes. | |
| */ | | */ | |
| | | | |
| skipping to change at line 188 | | skipping to change at line 196 | |
| XFS_PQUOTA_ACTIVE)) | | XFS_PQUOTA_ACTIVE)) | |
| #define XFS_IS_UQUOTA_ON(mp) ((mp)->m_qflags & XFS_UQUOTA_ACTIVE) | | #define XFS_IS_UQUOTA_ON(mp) ((mp)->m_qflags & XFS_UQUOTA_ACTIVE) | |
| #define XFS_IS_GQUOTA_ON(mp) ((mp)->m_qflags & XFS_GQUOTA_ACTIVE) | | #define XFS_IS_GQUOTA_ON(mp) ((mp)->m_qflags & XFS_GQUOTA_ACTIVE) | |
| #define XFS_IS_PQUOTA_ON(mp) ((mp)->m_qflags & XFS_PQUOTA_ACTIVE) | | #define XFS_IS_PQUOTA_ON(mp) ((mp)->m_qflags & XFS_PQUOTA_ACTIVE) | |
| | | | |
| /* | | /* | |
| * Flags to tell various functions what to do. Not all of these are meaning
ful | | * Flags to tell various functions what to do. Not all of these are meaning
ful | |
| * to a single function. None of these XFS_QMOPT_* flags are meant to have | | * to a single function. None of these XFS_QMOPT_* flags are meant to have | |
| * persistent values (ie. their values can and will change between versions
) | | * persistent values (ie. their values can and will change between versions
) | |
| */ | | */ | |
|
| #define XFS_QMOPT_DQLOCK 0x0000001 /* dqlock */ | | | |
| #define XFS_QMOPT_DQALLOC 0x0000002 /* alloc dquot ondisk if needed */ | | #define XFS_QMOPT_DQALLOC 0x0000002 /* alloc dquot ondisk if needed */ | |
| #define XFS_QMOPT_UQUOTA 0x0000004 /* user dquot requested */ | | #define XFS_QMOPT_UQUOTA 0x0000004 /* user dquot requested */ | |
| #define XFS_QMOPT_PQUOTA 0x0000008 /* project dquot requested */ | | #define XFS_QMOPT_PQUOTA 0x0000008 /* project dquot requested */ | |
| #define XFS_QMOPT_FORCE_RES 0x0000010 /* ignore quota limits */ | | #define XFS_QMOPT_FORCE_RES 0x0000010 /* ignore quota limits */ | |
| #define XFS_QMOPT_DQSUSER 0x0000020 /* don't cache super users dquot *
/ | | #define XFS_QMOPT_DQSUSER 0x0000020 /* don't cache super users dquot *
/ | |
| #define XFS_QMOPT_SBVERSION 0x0000040 /* change superblock version num *
/ | | #define XFS_QMOPT_SBVERSION 0x0000040 /* change superblock version num *
/ | |
|
| #define XFS_QMOPT_QUOTAOFF 0x0000080 /* quotas are being turned off */ | | | |
| #define XFS_QMOPT_UMOUNTING 0x0000100 /* filesys is being unmounted */ | | | |
| #define XFS_QMOPT_DOLOG 0x0000200 /* log buf changes (in quo | | | |
| tacheck) */ | | | |
| #define XFS_QMOPT_DOWARN 0x0000400 /* increase warning cnt if needed
*/ | | #define XFS_QMOPT_DOWARN 0x0000400 /* increase warning cnt if needed
*/ | |
|
| #define XFS_QMOPT_ILOCKED 0x0000800 /* inode is already locked (excl)
*/ | | | |
| #define XFS_QMOPT_DQREPAIR 0x0001000 /* repair dquot if damaged */ | | #define XFS_QMOPT_DQREPAIR 0x0001000 /* repair dquot if damaged */ | |
| #define XFS_QMOPT_GQUOTA 0x0002000 /* group dquot requested */ | | #define XFS_QMOPT_GQUOTA 0x0002000 /* group dquot requested */ | |
| #define XFS_QMOPT_ENOSPC 0x0004000 /* enospc instead of edquot (prj)
*/ | | #define XFS_QMOPT_ENOSPC 0x0004000 /* enospc instead of edquot (prj)
*/ | |
| | | | |
| /* | | /* | |
| * flags to xfs_trans_mod_dquot to indicate which field needs to be | | * flags to xfs_trans_mod_dquot to indicate which field needs to be | |
| * modified. | | * modified. | |
| */ | | */ | |
| #define XFS_QMOPT_RES_REGBLKS 0x0010000 | | #define XFS_QMOPT_RES_REGBLKS 0x0010000 | |
| #define XFS_QMOPT_RES_RTBLKS 0x0020000 | | #define XFS_QMOPT_RES_RTBLKS 0x0020000 | |
| #define XFS_QMOPT_BCOUNT 0x0040000 | | #define XFS_QMOPT_BCOUNT 0x0040000 | |
| #define XFS_QMOPT_ICOUNT 0x0080000 | | #define XFS_QMOPT_ICOUNT 0x0080000 | |
| #define XFS_QMOPT_RTBCOUNT 0x0100000 | | #define XFS_QMOPT_RTBCOUNT 0x0100000 | |
| #define XFS_QMOPT_DELBCOUNT 0x0200000 | | #define XFS_QMOPT_DELBCOUNT 0x0200000 | |
| #define XFS_QMOPT_DELRTBCOUNT 0x0400000 | | #define XFS_QMOPT_DELRTBCOUNT 0x0400000 | |
| #define XFS_QMOPT_RES_INOS 0x0800000 | | #define XFS_QMOPT_RES_INOS 0x0800000 | |
| | | | |
| /* | | /* | |
|
| * flags for dqflush and dqflush_all. | | | |
| */ | | | |
| #define XFS_QMOPT_SYNC 0x1000000 | | | |
| #define XFS_QMOPT_ASYNC 0x2000000 | | | |
| #define XFS_QMOPT_DELWRI 0x4000000 | | | |
| | | | |
| /* | | | |
| * flags for dqalloc. | | * flags for dqalloc. | |
| */ | | */ | |
|
| #define XFS_QMOPT_INHERIT 0x8000000 | | #define XFS_QMOPT_INHERIT 0x1000000 | |
| | | | |
| /* | | /* | |
| * flags to xfs_trans_mod_dquot. | | * flags to xfs_trans_mod_dquot. | |
| */ | | */ | |
| #define XFS_TRANS_DQ_RES_BLKS XFS_QMOPT_RES_REGBLKS | | #define XFS_TRANS_DQ_RES_BLKS XFS_QMOPT_RES_REGBLKS | |
| #define XFS_TRANS_DQ_RES_RTBLKS XFS_QMOPT_RES_RTBLKS | | #define XFS_TRANS_DQ_RES_RTBLKS XFS_QMOPT_RES_RTBLKS | |
| #define XFS_TRANS_DQ_RES_INOS XFS_QMOPT_RES_INOS | | #define XFS_TRANS_DQ_RES_INOS XFS_QMOPT_RES_INOS | |
| #define XFS_TRANS_DQ_BCOUNT XFS_QMOPT_BCOUNT | | #define XFS_TRANS_DQ_BCOUNT XFS_QMOPT_BCOUNT | |
| #define XFS_TRANS_DQ_DELBCOUNT XFS_QMOPT_DELBCOUNT | | #define XFS_TRANS_DQ_DELBCOUNT XFS_QMOPT_DELBCOUNT | |
| #define XFS_TRANS_DQ_ICOUNT XFS_QMOPT_ICOUNT | | #define XFS_TRANS_DQ_ICOUNT XFS_QMOPT_ICOUNT | |
| | | | |
| skipping to change at line 302 | | skipping to change at line 298 | |
| ulong qt_ino_res_used; /* inodes used from the reservatio
n */ | | ulong qt_ino_res_used; /* inodes used from the reservatio
n */ | |
| long qt_bcount_delta; /* dquot blk count changes */ | | long qt_bcount_delta; /* dquot blk count changes */ | |
| long qt_delbcnt_delta; /* delayed dquot blk count changes
*/ | | long qt_delbcnt_delta; /* delayed dquot blk count changes
*/ | |
| long qt_icount_delta; /* dquot inode count changes */ | | long qt_icount_delta; /* dquot inode count changes */ | |
| ulong qt_rtblk_res; /* # blks reserved on a dquot */ | | ulong qt_rtblk_res; /* # blks reserved on a dquot */ | |
| ulong qt_rtblk_res_used;/* # blks used from reservation */ | | ulong qt_rtblk_res_used;/* # blks used from reservation */ | |
| long qt_rtbcount_delta;/* dquot realtime blk changes */ | | long qt_rtbcount_delta;/* dquot realtime blk changes */ | |
| long qt_delrtb_delta; /* delayed RT blk count changes */ | | long qt_delrtb_delta; /* delayed RT blk count changes */ | |
| } xfs_dqtrx_t; | | } xfs_dqtrx_t; | |
| | | | |
|
| /* | | | |
| * Dquot transaction functions, used if quota is enabled. | | | |
| */ | | | |
| typedef void (*qo_dup_dqinfo_t)(struct xfs_trans *, struct xfs_trans *); | | | |
| typedef void (*qo_mod_dquot_byino_t)(struct xfs_trans *, | | | |
| struct xfs_inode *, uint, long); | | | |
| typedef void (*qo_free_dqinfo_t)(struct xfs_trans *); | | | |
| typedef void (*qo_apply_dquot_deltas_t)(struct xfs_trans *); | | | |
| typedef void (*qo_unreserve_and_mod_dquots_t)(struct xfs_trans *); | | | |
| typedef int (*qo_reserve_quota_nblks_t)( | | | |
| struct xfs_trans *, struct xfs_mount *, | | | |
| struct xfs_inode *, long, long, uint); | | | |
| typedef int (*qo_reserve_quota_bydquots_t)( | | | |
| struct xfs_trans *, struct xfs_mount *, | | | |
| struct xfs_dquot *, struct xfs_dquot *, | | | |
| long, long, uint); | | | |
| typedef struct xfs_dqtrxops { | | | |
| qo_dup_dqinfo_t qo_dup_dqinfo; | | | |
| qo_free_dqinfo_t qo_free_dqinfo; | | | |
| qo_mod_dquot_byino_t qo_mod_dquot_byino; | | | |
| qo_apply_dquot_deltas_t qo_apply_dquot_deltas; | | | |
| qo_reserve_quota_nblks_t qo_reserve_quota_nblks; | | | |
| qo_reserve_quota_bydquots_t qo_reserve_quota_bydquots; | | | |
| qo_unreserve_and_mod_dquots_t qo_unreserve_and_mod_dquots; | | | |
| } xfs_dqtrxops_t; | | | |
| | | | |
| #define XFS_DQTRXOP(mp, tp, op, args...) \ | | | |
| ((mp)->m_qm_ops->xfs_dqtrxops ? \ | | | |
| ((mp)->m_qm_ops->xfs_dqtrxops->op)(tp, ## args) : 0) | | | |
| | | | |
| #define XFS_DQTRXOP_VOID(mp, tp, op, args...) \ | | | |
| ((mp)->m_qm_ops->xfs_dqtrxops ? \ | | | |
| ((mp)->m_qm_ops->xfs_dqtrxops->op)(tp, ## args) : (void)0) | | | |
| | | | |
| #define XFS_TRANS_DUP_DQINFO(mp, otp, ntp) \ | | | |
| XFS_DQTRXOP_VOID(mp, otp, qo_dup_dqinfo, ntp) | | | |
| #define XFS_TRANS_FREE_DQINFO(mp, tp) \ | | | |
| XFS_DQTRXOP_VOID(mp, tp, qo_free_dqinfo) | | | |
| #define XFS_TRANS_MOD_DQUOT_BYINO(mp, tp, ip, field, delta) \ | | | |
| XFS_DQTRXOP_VOID(mp, tp, qo_mod_dquot_byino, ip, field, delta) | | | |
| #define XFS_TRANS_APPLY_DQUOT_DELTAS(mp, tp) \ | | | |
| XFS_DQTRXOP_VOID(mp, tp, qo_apply_dquot_deltas) | | | |
| #define XFS_TRANS_RESERVE_QUOTA_NBLKS(mp, tp, ip, nblks, ninos, fl) \ | | | |
| XFS_DQTRXOP(mp, tp, qo_reserve_quota_nblks, mp, ip, nblks, ninos, fl | | | |
| ) | | | |
| #define XFS_TRANS_RESERVE_QUOTA_BYDQUOTS(mp, tp, ud, gd, nb, ni, fl) \ | | | |
| XFS_DQTRXOP(mp, tp, qo_reserve_quota_bydquots, mp, ud, gd, nb, ni, f | | | |
| l) | | | |
| #define XFS_TRANS_UNRESERVE_AND_MOD_DQUOTS(mp, tp) \ | | | |
| XFS_DQTRXOP_VOID(mp, tp, qo_unreserve_and_mod_dquots) | | | |
| | | | |
| #define XFS_TRANS_UNRESERVE_QUOTA_NBLKS(mp, tp, ip, nblks, ninos, flags) \ | | | |
| XFS_TRANS_RESERVE_QUOTA_NBLKS(mp, tp, ip, -(nblks), -(ninos), flags) | | | |
| #define XFS_TRANS_RESERVE_QUOTA(mp, tp, ud, gd, nb, ni, f) \ | | | |
| XFS_TRANS_RESERVE_QUOTA_BYDQUOTS(mp, tp, ud, gd, nb, ni, \ | | | |
| f | XFS_QMOPT_RES_REGBLKS) | | | |
| #define XFS_TRANS_UNRESERVE_QUOTA(mp, tp, ud, gd, nb, ni, f) \ | | | |
| XFS_TRANS_RESERVE_QUOTA_BYDQUOTS(mp, tp, ud, gd, -(nb), -(ni), \ | | | |
| f | XFS_QMOPT_RES_REGBLKS) | | | |
| | | | |
| extern int xfs_qm_dqcheck(xfs_disk_dquot_t *, xfs_dqid_t, uint, uint, char
*); | | extern int xfs_qm_dqcheck(xfs_disk_dquot_t *, xfs_dqid_t, uint, uint, char
*); | |
| extern int xfs_mount_reset_sbqflags(struct xfs_mount *); | | extern int xfs_mount_reset_sbqflags(struct xfs_mount *); | |
| | | | |
|
| extern struct xfs_qmops xfs_qmcore_xfs; | | | |
| | | | |
| #endif /* __KERNEL__ */ | | #endif /* __KERNEL__ */ | |
| | | | |
|
| | | #ifdef CONFIG_XFS_QUOTA | |
| | | extern void xfs_trans_dup_dqinfo(struct xfs_trans *, struct xfs_trans *); | |
| | | extern void xfs_trans_free_dqinfo(struct xfs_trans *); | |
| | | extern void xfs_trans_mod_dquot_byino(struct xfs_trans *, struct xfs_inode | |
| | | *, | |
| | | uint, long); | |
| | | extern void xfs_trans_apply_dquot_deltas(struct xfs_trans *); | |
| | | extern void xfs_trans_unreserve_and_mod_dquots(struct xfs_trans *); | |
| | | extern int xfs_trans_reserve_quota_nblks(struct xfs_trans *, | |
| | | struct xfs_inode *, long, long, uint); | |
| | | extern int xfs_trans_reserve_quota_bydquots(struct xfs_trans *, | |
| | | struct xfs_mount *, struct xfs_dquot *, | |
| | | struct xfs_dquot *, long, long, uint); | |
| | | | |
| | | extern int xfs_qm_vop_dqalloc(struct xfs_inode *, uid_t, gid_t, prid_t, uin | |
| | | t, | |
| | | struct xfs_dquot **, struct xfs_dquot **); | |
| | | extern void xfs_qm_vop_create_dqattach(struct xfs_trans *, struct xfs_inode | |
| | | *, | |
| | | struct xfs_dquot *, struct xfs_dquot *); | |
| | | extern int xfs_qm_vop_rename_dqattach(struct xfs_inode **); | |
| | | extern struct xfs_dquot *xfs_qm_vop_chown(struct xfs_trans *, | |
| | | struct xfs_inode *, struct xfs_dquot **, struct xfs_dquot *) | |
| | | ; | |
| | | extern int xfs_qm_vop_chown_reserve(struct xfs_trans *, struct xfs_inode *, | |
| | | struct xfs_dquot *, struct xfs_dquot *, uint); | |
| | | extern int xfs_qm_dqattach(struct xfs_inode *, uint); | |
| | | extern int xfs_qm_dqattach_locked(struct xfs_inode *, uint); | |
| | | extern void xfs_qm_dqdetach(struct xfs_inode *); | |
| | | extern void xfs_qm_dqrele(struct xfs_dquot *); | |
| | | extern void xfs_qm_statvfs(struct xfs_inode *, struct kstatfs *); | |
| | | extern int xfs_qm_sync(struct xfs_mount *, int); | |
| | | extern int xfs_qm_newmount(struct xfs_mount *, uint *, uint *); | |
| | | extern void xfs_qm_mount_quotas(struct xfs_mount *); | |
| | | extern void xfs_qm_unmount(struct xfs_mount *); | |
| | | extern void xfs_qm_unmount_quotas(struct xfs_mount *); | |
| | | | |
| | | #else | |
| | | #define xfs_qm_vop_dqalloc(ip, uid, gid, prid, flags, udqp, gdqp) ({ \ | |
| | | *(udqp) = NULL; \ | |
| | | *(gdqp) = NULL; \ | |
| | | 0; \ | |
| | | }) | |
| | | #define xfs_trans_dup_dqinfo(tp, tp2) | |
| | | #define xfs_trans_free_dqinfo(tp) | |
| | | #define xfs_trans_mod_dquot_byino(tp, ip, fields, delta) | |
| | | #define xfs_trans_apply_dquot_deltas(tp) | |
| | | #define xfs_trans_unreserve_and_mod_dquots(tp) | |
| | | #define xfs_trans_reserve_quota_nblks(tp, ip, blks, inos, flg) (0) | |
| | | #define xfs_trans_reserve_quota_bydquots(tp, mp, uqp, gqp, blks, inos, flg) | |
| | | (0) | |
| | | #define xfs_qm_vop_create_dqattach(tp, ip, u, g) | |
| | | #define xfs_qm_vop_rename_dqattach(it) (0) | |
| | | #define xfs_qm_vop_chown(tp, ip, old, new) (NUL | |
| | | L) | |
| | | #define xfs_qm_vop_chown_reserve(tp, ip, u, g, fl) (0) | |
| | | #define xfs_qm_dqattach(ip, fl) | |
| | | (0) | |
| | | #define xfs_qm_dqattach_locked(ip, fl) (0) | |
| | | #define xfs_qm_dqdetach(ip) | |
| | | #define xfs_qm_dqrele(d) | |
| | | #define xfs_qm_statvfs(ip, s) | |
| | | #define xfs_qm_sync(mp, flags) (0) | |
| | | #define xfs_qm_newmount(mp, a, b) (0) | |
| | | #define xfs_qm_mount_quotas(mp) | |
| | | #define xfs_qm_unmount(mp) | |
| | | #define xfs_qm_unmount_quotas(mp) | |
| | | #endif /* CONFIG_XFS_QUOTA */ | |
| | | | |
| | | #define xfs_trans_unreserve_quota_nblks(tp, ip, nblks, ninos, flags) \ | |
| | | xfs_trans_reserve_quota_nblks(tp, ip, -(nblks), -(ninos), flags) | |
| | | #define xfs_trans_reserve_quota(tp, mp, ud, gd, nb, ni, f) \ | |
| | | xfs_trans_reserve_quota_bydquots(tp, mp, ud, gd, nb, ni, \ | |
| | | f | XFS_QMOPT_RES_REGBLKS) | |
| | | | |
| #endif /* __XFS_QUOTA_H__ */ | | #endif /* __XFS_QUOTA_H__ */ | |
| | | | |
End of changes. 11 change blocks. |
| 83 lines changed or deleted | | 91 lines changed or added | |
|
| xfs_sb.h | | xfs_sb.h | |
| | | | |
| skipping to change at line 301 | | skipping to change at line 301 | |
| #define XFS_SBF_NOFLAGS 0x00 /* no flags set */ | | #define XFS_SBF_NOFLAGS 0x00 /* no flags set */ | |
| #define XFS_SBF_READONLY 0x01 /* only read-only mounts allowed */ | | #define XFS_SBF_READONLY 0x01 /* only read-only mounts allowed */ | |
| | | | |
| /* | | /* | |
| * define max. shared version we can interoperate with | | * define max. shared version we can interoperate with | |
| */ | | */ | |
| #define XFS_SB_MAX_SHARED_VN 0 | | #define XFS_SB_MAX_SHARED_VN 0 | |
| | | | |
| #define XFS_SB_VERSION_NUM(sbp) ((sbp)->sb_versionnum & XFS_SB_VERSI
ON_NUMBITS) | | #define XFS_SB_VERSION_NUM(sbp) ((sbp)->sb_versionnum & XFS_SB_VERSI
ON_NUMBITS) | |
| | | | |
|
| #ifdef __KERNEL__ | | | |
| static inline int xfs_sb_good_version(xfs_sb_t *sbp) | | static inline int xfs_sb_good_version(xfs_sb_t *sbp) | |
| { | | { | |
|
| return (((sbp->sb_versionnum >= XFS_SB_VERSION_1) && \ | | /* We always support version 1-3 */ | |
| (sbp->sb_versionnum <= XFS_SB_VERSION_3)) || \ | | if (sbp->sb_versionnum >= XFS_SB_VERSION_1 && | |
| ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ | | sbp->sb_versionnum <= XFS_SB_VERSION_3) | |
| !((sbp->sb_versionnum & ~XFS_SB_VERSION_OKREALBITS) || \ | | return 1; | |
| ((sbp->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT) && | | | |
| \ | | /* We support version 4 if all feature bits are supported */ | |
| (sbp->sb_features2 & ~XFS_SB_VERSION2_OKREALBITS))) & | | if (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) { | |
| & \ | | if ((sbp->sb_versionnum & ~XFS_SB_VERSION_OKREALBITS) || | |
| (sbp->sb_shared_vn <= XFS_SB_MAX_SHARED_VN))); | | ((sbp->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT) && | |
| } | | (sbp->sb_features2 & ~XFS_SB_VERSION2_OKREALBITS))) | |
| | | return 0; | |
| | | | |
| | | #ifdef __KERNEL__ | |
| | | if (sbp->sb_shared_vn > XFS_SB_MAX_SHARED_VN) | |
| | | return 0; | |
| #else | | #else | |
|
| static inline int xfs_sb_good_version(xfs_sb_t *sbp) | | if ((sbp->sb_versionnum & XFS_SB_VERSION_SHAREDBIT) && | |
| { | | sbp->sb_shared_vn > XFS_SB_MAX_SHARED_VN) | |
| return (((sbp->sb_versionnum >= XFS_SB_VERSION_1) && \ | | return 0; | |
| (sbp->sb_versionnum <= XFS_SB_VERSION_3)) || \ | | #endif | |
| ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ | | | |
| !((sbp->sb_versionnum & ~XFS_SB_VERSION_OKREALBITS) || \ | | return 1; | |
| ((sbp->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT) && | | } | |
| \ | | | |
| (sbp->sb_features2 & ~XFS_SB_VERSION2_OKREALBITS))) & | | return 0; | |
| & \ | | | |
| (!(sbp->sb_versionnum & XFS_SB_VERSION_SHAREDBIT) || \ | | | |
| (sbp->sb_shared_vn <= XFS_SB_MAX_SHARED_VN)))); | | | |
| } | | } | |
|
| #endif /* __KERNEL__ */ | | | |
| | | | |
| /* | | /* | |
| * Detect a mismatched features2 field. Older kernels read/wrote | | * Detect a mismatched features2 field. Older kernels read/wrote | |
| * this into the wrong slot, so to be safe we keep them in sync. | | * this into the wrong slot, so to be safe we keep them in sync. | |
| */ | | */ | |
| static inline int xfs_sb_has_mismatched_features2(xfs_sb_t *sbp) | | static inline int xfs_sb_has_mismatched_features2(xfs_sb_t *sbp) | |
| { | | { | |
| return (sbp->sb_bad_features2 != sbp->sb_features2); | | return (sbp->sb_bad_features2 != sbp->sb_features2); | |
| } | | } | |
| | | | |
| static inline unsigned xfs_sb_version_tonew(unsigned v) | | static inline unsigned xfs_sb_version_tonew(unsigned v) | |
| { | | { | |
|
| return ((((v) == XFS_SB_VERSION_1) ? \ | | if (v == XFS_SB_VERSION_1) | |
| 0 : \ | | return XFS_SB_VERSION_4; | |
| (((v) == XFS_SB_VERSION_2) ? \ | | | |
| XFS_SB_VERSION_ATTRBIT : \ | | if (v == XFS_SB_VERSION_2) | |
| (XFS_SB_VERSION_ATTRBIT | XFS_SB_VERSION_NLINKBIT))) | | return XFS_SB_VERSION_4 | XFS_SB_VERSION_ATTRBIT; | |
| | \ | | | |
| XFS_SB_VERSION_4); | | return XFS_SB_VERSION_4 | XFS_SB_VERSION_ATTRBIT | | |
| | | XFS_SB_VERSION_NLINKBIT; | |
| } | | } | |
| | | | |
| static inline unsigned xfs_sb_version_toold(unsigned v) | | static inline unsigned xfs_sb_version_toold(unsigned v) | |
| { | | { | |
|
| return (((v) & (XFS_SB_VERSION_QUOTABIT | XFS_SB_VERSION_ALIGNBIT)) | | if (v & (XFS_SB_VERSION_QUOTABIT | XFS_SB_VERSION_ALIGNBIT)) | |
| ? \ | | return 0; | |
| 0 : \ | | if (v & XFS_SB_VERSION_NLINKBIT) | |
| (((v) & XFS_SB_VERSION_NLINKBIT) ? \ | | return XFS_SB_VERSION_3; | |
| XFS_SB_VERSION_3 : \ | | if (v & XFS_SB_VERSION_ATTRBIT) | |
| (((v) & XFS_SB_VERSION_ATTRBIT) ? \ | | return XFS_SB_VERSION_2; | |
| XFS_SB_VERSION_2 : \ | | return XFS_SB_VERSION_1; | |
| XFS_SB_VERSION_1))); | | | |
| } | | } | |
| | | | |
| static inline int xfs_sb_version_hasattr(xfs_sb_t *sbp) | | static inline int xfs_sb_version_hasattr(xfs_sb_t *sbp) | |
| { | | { | |
|
| return ((sbp)->sb_versionnum == XFS_SB_VERSION_2) || \ | | return sbp->sb_versionnum == XFS_SB_VERSION_2 || | |
| ((sbp)->sb_versionnum == XFS_SB_VERSION_3) || \ | | sbp->sb_versionnum == XFS_SB_VERSION_3 || | |
| ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ | | (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && | |
| ((sbp)->sb_versionnum & XFS_SB_VERSION_ATTRBIT)); | | (sbp->sb_versionnum & XFS_SB_VERSION_ATTRBIT)); | |
| } | | } | |
| | | | |
| static inline void xfs_sb_version_addattr(xfs_sb_t *sbp) | | static inline void xfs_sb_version_addattr(xfs_sb_t *sbp) | |
| { | | { | |
|
| (sbp)->sb_versionnum = (((sbp)->sb_versionnum == XFS_SB_VERSION_1) ? | | if (sbp->sb_versionnum == XFS_SB_VERSION_1) | |
| \ | | sbp->sb_versionnum = XFS_SB_VERSION_2; | |
| XFS_SB_VERSION_2 : \ | | else if (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) | |
| ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) ? \ | | sbp->sb_versionnum |= XFS_SB_VERSION_ATTRBIT; | |
| ((sbp)->sb_versionnum | XFS_SB_VERSION_ATTRBIT) : \ | | else | |
| (XFS_SB_VERSION_4 | XFS_SB_VERSION_ATTRBIT))); | | sbp->sb_versionnum = XFS_SB_VERSION_4 | XFS_SB_VERSION_ATTRB | |
| | | IT; | |
| } | | } | |
| | | | |
| static inline int xfs_sb_version_hasnlink(xfs_sb_t *sbp) | | static inline int xfs_sb_version_hasnlink(xfs_sb_t *sbp) | |
| { | | { | |
|
| return ((sbp)->sb_versionnum == XFS_SB_VERSION_3) || \ | | return sbp->sb_versionnum == XFS_SB_VERSION_3 || | |
| ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ | | (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && | |
| ((sbp)->sb_versionnum & XFS_SB_VERSION_NLINKBIT)); | | (sbp->sb_versionnum & XFS_SB_VERSION_NLINKBIT)); | |
| } | | } | |
| | | | |
| static inline void xfs_sb_version_addnlink(xfs_sb_t *sbp) | | static inline void xfs_sb_version_addnlink(xfs_sb_t *sbp) | |
| { | | { | |
|
| (sbp)->sb_versionnum = ((sbp)->sb_versionnum <= XFS_SB_VERSION_2 ? \ | | if (sbp->sb_versionnum <= XFS_SB_VERSION_2) | |
| XFS_SB_VERSION_3 : \ | | sbp->sb_versionnum = XFS_SB_VERSION_3; | |
| ((sbp)->sb_versionnum | XFS_SB_VERSION_NLINKBIT)); | | else | |
| | | sbp->sb_versionnum |= XFS_SB_VERSION_NLINKBIT; | |
| } | | } | |
| | | | |
| static inline int xfs_sb_version_hasquota(xfs_sb_t *sbp) | | static inline int xfs_sb_version_hasquota(xfs_sb_t *sbp) | |
| { | | { | |
|
| return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ | | return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && | |
| ((sbp)->sb_versionnum & XFS_SB_VERSION_QUOTABIT); | | (sbp->sb_versionnum & XFS_SB_VERSION_QUOTABIT); | |
| } | | } | |
| | | | |
| static inline void xfs_sb_version_addquota(xfs_sb_t *sbp) | | static inline void xfs_sb_version_addquota(xfs_sb_t *sbp) | |
| { | | { | |
|
| (sbp)->sb_versionnum = \ | | if (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) | |
| (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 ? \ | | sbp->sb_versionnum |= XFS_SB_VERSION_QUOTABIT; | |
| ((sbp)->sb_versionnum | XFS_SB_VERSION_QUOTABIT) : \ | | else | |
| (xfs_sb_version_tonew((sbp)->sb_versionnum) | \ | | sbp->sb_versionnum = xfs_sb_version_tonew(sbp->sb_versionnum | |
| XFS_SB_VERSION_QUOTABIT)); | | ) | | |
| | | XFS_SB_VERSION_QUOTABIT; | |
| } | | } | |
| | | | |
| static inline int xfs_sb_version_hasalign(xfs_sb_t *sbp) | | static inline int xfs_sb_version_hasalign(xfs_sb_t *sbp) | |
| { | | { | |
|
| return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ | | return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && | |
| ((sbp)->sb_versionnum & XFS_SB_VERSION_ALIGNBIT); | | (sbp->sb_versionnum & XFS_SB_VERSION_ALIGNBIT); | |
| } | | } | |
| | | | |
| static inline int xfs_sb_version_hasdalign(xfs_sb_t *sbp) | | static inline int xfs_sb_version_hasdalign(xfs_sb_t *sbp) | |
| { | | { | |
|
| return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ | | return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && | |
| ((sbp)->sb_versionnum & XFS_SB_VERSION_DALIGNBIT); | | (sbp->sb_versionnum & XFS_SB_VERSION_DALIGNBIT); | |
| } | | } | |
| | | | |
| static inline int xfs_sb_version_hasshared(xfs_sb_t *sbp) | | static inline int xfs_sb_version_hasshared(xfs_sb_t *sbp) | |
| { | | { | |
|
| return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ | | return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && | |
| ((sbp)->sb_versionnum & XFS_SB_VERSION_SHAREDBIT); | | (sbp->sb_versionnum & XFS_SB_VERSION_SHAREDBIT); | |
| } | | } | |
| | | | |
| static inline int xfs_sb_version_hasdirv2(xfs_sb_t *sbp) | | static inline int xfs_sb_version_hasdirv2(xfs_sb_t *sbp) | |
| { | | { | |
|
| return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ | | return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && | |
| ((sbp)->sb_versionnum & XFS_SB_VERSION_DIRV2BIT); | | (sbp->sb_versionnum & XFS_SB_VERSION_DIRV2BIT); | |
| } | | } | |
| | | | |
| static inline int xfs_sb_version_haslogv2(xfs_sb_t *sbp) | | static inline int xfs_sb_version_haslogv2(xfs_sb_t *sbp) | |
| { | | { | |
|
| return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ | | return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && | |
| ((sbp)->sb_versionnum & XFS_SB_VERSION_LOGV2BIT); | | (sbp->sb_versionnum & XFS_SB_VERSION_LOGV2BIT); | |
| } | | } | |
| | | | |
| static inline int xfs_sb_version_hasextflgbit(xfs_sb_t *sbp) | | static inline int xfs_sb_version_hasextflgbit(xfs_sb_t *sbp) | |
| { | | { | |
|
| return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ | | return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && | |
| ((sbp)->sb_versionnum & XFS_SB_VERSION_EXTFLGBIT); | | (sbp->sb_versionnum & XFS_SB_VERSION_EXTFLGBIT); | |
| } | | } | |
| | | | |
| static inline int xfs_sb_version_hassector(xfs_sb_t *sbp) | | static inline int xfs_sb_version_hassector(xfs_sb_t *sbp) | |
| { | | { | |
|
| return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ | | return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && | |
| ((sbp)->sb_versionnum & XFS_SB_VERSION_SECTORBIT); | | (sbp->sb_versionnum & XFS_SB_VERSION_SECTORBIT); | |
| } | | } | |
| | | | |
| static inline int xfs_sb_version_hasasciici(xfs_sb_t *sbp) | | static inline int xfs_sb_version_hasasciici(xfs_sb_t *sbp) | |
| { | | { | |
|
| return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ | | return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && | |
| (sbp->sb_versionnum & XFS_SB_VERSION_BORGBIT); | | (sbp->sb_versionnum & XFS_SB_VERSION_BORGBIT); | |
| } | | } | |
| | | | |
| static inline int xfs_sb_version_hasmorebits(xfs_sb_t *sbp) | | static inline int xfs_sb_version_hasmorebits(xfs_sb_t *sbp) | |
| { | | { | |
|
| return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ | | return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && | |
| ((sbp)->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT); | | (sbp->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT); | |
| } | | } | |
| | | | |
| /* | | /* | |
| * sb_features2 bit version macros. | | * sb_features2 bit version macros. | |
| * | | * | |
| * For example, for a bit defined as XFS_SB_VERSION2_FUNBIT, has a macro: | | * For example, for a bit defined as XFS_SB_VERSION2_FUNBIT, has a macro: | |
| * | | * | |
| * SB_VERSION_HASFUNBIT(xfs_sb_t *sbp) | | * SB_VERSION_HASFUNBIT(xfs_sb_t *sbp) | |
| * ((xfs_sb_version_hasmorebits(sbp) && | | * ((xfs_sb_version_hasmorebits(sbp) && | |
| * ((sbp)->sb_features2 & XFS_SB_VERSION2_FUNBIT) | | * ((sbp)->sb_features2 & XFS_SB_VERSION2_FUNBIT) | |
| */ | | */ | |
| | | | |
| static inline int xfs_sb_version_haslazysbcount(xfs_sb_t *sbp) | | static inline int xfs_sb_version_haslazysbcount(xfs_sb_t *sbp) | |
| { | | { | |
|
| return (xfs_sb_version_hasmorebits(sbp) && \ | | return xfs_sb_version_hasmorebits(sbp) && | |
| ((sbp)->sb_features2 & XFS_SB_VERSION2_LAZYSBCOUNTBIT)); | | (sbp->sb_features2 & XFS_SB_VERSION2_LAZYSBCOUNTBIT); | |
| } | | } | |
| | | | |
| static inline int xfs_sb_version_hasattr2(xfs_sb_t *sbp) | | static inline int xfs_sb_version_hasattr2(xfs_sb_t *sbp) | |
| { | | { | |
|
| return (xfs_sb_version_hasmorebits(sbp)) && \ | | return xfs_sb_version_hasmorebits(sbp) && | |
| ((sbp)->sb_features2 & XFS_SB_VERSION2_ATTR2BIT); | | (sbp->sb_features2 & XFS_SB_VERSION2_ATTR2BIT); | |
| } | | } | |
| | | | |
| static inline void xfs_sb_version_addattr2(xfs_sb_t *sbp) | | static inline void xfs_sb_version_addattr2(xfs_sb_t *sbp) | |
| { | | { | |
|
| ((sbp)->sb_versionnum = \ | | sbp->sb_versionnum |= XFS_SB_VERSION_MOREBITSBIT; | |
| ((sbp)->sb_versionnum | XFS_SB_VERSION_MOREBITSBIT), \ | | sbp->sb_features2 |= XFS_SB_VERSION2_ATTR2BIT; | |
| ((sbp)->sb_features2 = \ | | | |
| ((sbp)->sb_features2 | XFS_SB_VERSION2_ATTR2BIT))); | | | |
| } | | } | |
| | | | |
| static inline void xfs_sb_version_removeattr2(xfs_sb_t *sbp) | | static inline void xfs_sb_version_removeattr2(xfs_sb_t *sbp) | |
| { | | { | |
| sbp->sb_features2 &= ~XFS_SB_VERSION2_ATTR2BIT; | | sbp->sb_features2 &= ~XFS_SB_VERSION2_ATTR2BIT; | |
| if (!sbp->sb_features2) | | if (!sbp->sb_features2) | |
| sbp->sb_versionnum &= ~XFS_SB_VERSION_MOREBITSBIT; | | sbp->sb_versionnum &= ~XFS_SB_VERSION_MOREBITSBIT; | |
| } | | } | |
| | | | |
| static inline int xfs_sb_version_hasprojid32bit(xfs_sb_t *sbp) | | static inline int xfs_sb_version_hasprojid32bit(xfs_sb_t *sbp) | |
| | | | |
| skipping to change at line 516 | | skipping to change at line 522 | |
| /* | | /* | |
| * end of superblock version macros | | * end of superblock version macros | |
| */ | | */ | |
| | | | |
| #define XFS_SB_DADDR ((xfs_daddr_t)0) /* daddr in filesystem/ag *
/ | | #define XFS_SB_DADDR ((xfs_daddr_t)0) /* daddr in filesystem/ag *
/ | |
| #define XFS_SB_BLOCK(mp) XFS_HDR_BLOCK(mp, XFS_SB_DADDR) | | #define XFS_SB_BLOCK(mp) XFS_HDR_BLOCK(mp, XFS_SB_DADDR) | |
| #define XFS_BUF_TO_SBP(bp) ((xfs_dsb_t *)XFS_BUF_PTR(bp)) | | #define XFS_BUF_TO_SBP(bp) ((xfs_dsb_t *)XFS_BUF_PTR(bp)) | |
| | | | |
| #define XFS_HDR_BLOCK(mp,d) ((xfs_agblock_t)XFS_BB_TO_FSBT(mp,d)
) | | #define XFS_HDR_BLOCK(mp,d) ((xfs_agblock_t)XFS_BB_TO_FSBT(mp,d)
) | |
| #define XFS_DADDR_TO_FSB(mp,d) XFS_AGB_TO_FSB(mp, \ | | #define XFS_DADDR_TO_FSB(mp,d) XFS_AGB_TO_FSB(mp, \ | |
|
| XFS_DADDR_TO_AGNO(mp,d), XFS_DADDR_TO_AGBNO(mp,d)) | | xfs_daddr_to_agno(mp,d), xfs_daddr_to_agbno(mp,d)) | |
| #define XFS_FSB_TO_DADDR(mp,fsbno) XFS_AGB_TO_DADDR(mp, \ | | #define XFS_FSB_TO_DADDR(mp,fsbno) XFS_AGB_TO_DADDR(mp, \ | |
| XFS_FSB_TO_AGNO(mp,fsbno), XFS_FSB_TO_AGBNO(mp,fsbno
)) | | XFS_FSB_TO_AGNO(mp,fsbno), XFS_FSB_TO_AGBNO(mp,fsbno
)) | |
| | | | |
| /* | | /* | |
| * File system sector to basic block conversions. | | * File system sector to basic block conversions. | |
| */ | | */ | |
| #define XFS_FSS_TO_BB(mp,sec) ((sec) << (mp)->m_sectbb_log) | | #define XFS_FSS_TO_BB(mp,sec) ((sec) << (mp)->m_sectbb_log) | |
| | | | |
| /* | | /* | |
| * File system block to basic block conversions. | | * File system block to basic block conversions. | |
| | | | |
End of changes. 25 change blocks. |
| 88 lines changed or deleted | | 89 lines changed or added | |
|
| xfs_trans.h | | xfs_trans.h | |
| | | | |
| skipping to change at line 52 | | skipping to change at line 52 | |
| * Log item types. | | * Log item types. | |
| */ | | */ | |
| #define XFS_LI_EFI 0x1236 | | #define XFS_LI_EFI 0x1236 | |
| #define XFS_LI_EFD 0x1237 | | #define XFS_LI_EFD 0x1237 | |
| #define XFS_LI_IUNLINK 0x1238 | | #define XFS_LI_IUNLINK 0x1238 | |
| #define XFS_LI_INODE 0x123b /* aligned ino chunks, var-s
ize ibufs */ | | #define XFS_LI_INODE 0x123b /* aligned ino chunks, var-s
ize ibufs */ | |
| #define XFS_LI_BUF 0x123c /* v2 bufs, variable sized i
node bufs */ | | #define XFS_LI_BUF 0x123c /* v2 bufs, variable sized i
node bufs */ | |
| #define XFS_LI_DQUOT 0x123d | | #define XFS_LI_DQUOT 0x123d | |
| #define XFS_LI_QUOTAOFF 0x123e | | #define XFS_LI_QUOTAOFF 0x123e | |
| | | | |
|
| | | #define XFS_LI_TYPE_DESC \ | |
| | | { XFS_LI_EFI, "XFS_LI_EFI" }, \ | |
| | | { XFS_LI_EFD, "XFS_LI_EFD" }, \ | |
| | | { XFS_LI_IUNLINK, "XFS_LI_IUNLINK" }, \ | |
| | | { XFS_LI_INODE, "XFS_LI_INODE" }, \ | |
| | | { XFS_LI_BUF, "XFS_LI_BUF" }, \ | |
| | | { XFS_LI_DQUOT, "XFS_LI_DQUOT" }, \ | |
| | | { XFS_LI_QUOTAOFF, "XFS_LI_QUOTAOFF" } | |
| | | | |
| /* | | /* | |
| * Transaction types. Used to distinguish types of buffers. | | * Transaction types. Used to distinguish types of buffers. | |
| */ | | */ | |
| #define XFS_TRANS_SETATTR_NOT_SIZE 1 | | #define XFS_TRANS_SETATTR_NOT_SIZE 1 | |
| #define XFS_TRANS_SETATTR_SIZE 2 | | #define XFS_TRANS_SETATTR_SIZE 2 | |
| #define XFS_TRANS_INACTIVE 3 | | #define XFS_TRANS_INACTIVE 3 | |
| #define XFS_TRANS_CREATE 4 | | #define XFS_TRANS_CREATE 4 | |
| #define XFS_TRANS_CREATE_TRUNC 5 | | #define XFS_TRANS_CREATE_TRUNC 5 | |
| #define XFS_TRANS_TRUNCATE_FILE 6 | | #define XFS_TRANS_TRUNCATE_FILE 6 | |
| #define XFS_TRANS_REMOVE 7 | | #define XFS_TRANS_REMOVE 7 | |
| #define XFS_TRANS_LINK 8 | | #define XFS_TRANS_LINK 8 | |
| #define XFS_TRANS_RENAME 9 | | #define XFS_TRANS_RENAME 9 | |
| #define XFS_TRANS_MKDIR 10 | | #define XFS_TRANS_MKDIR 10 | |
| #define XFS_TRANS_RMDIR 11 | | #define XFS_TRANS_RMDIR 11 | |
| #define XFS_TRANS_SYMLINK 12 | | #define XFS_TRANS_SYMLINK 12 | |
| #define XFS_TRANS_SET_DMATTRS 13 | | #define XFS_TRANS_SET_DMATTRS 13 | |
| #define XFS_TRANS_GROWFS 14 | | #define XFS_TRANS_GROWFS 14 | |
| #define XFS_TRANS_STRAT_WRITE 15 | | #define XFS_TRANS_STRAT_WRITE 15 | |
| #define XFS_TRANS_DIOSTRAT 16 | | #define XFS_TRANS_DIOSTRAT 16 | |
|
| #define XFS_TRANS_WRITE_SYNC 17 | | /* 17 was XFS_TRANS_WRITE_SYNC */ | |
| #define XFS_TRANS_WRITEID 18 | | #define XFS_TRANS_WRITEID 18 | |
| #define XFS_TRANS_ADDAFORK 19 | | #define XFS_TRANS_ADDAFORK 19 | |
| #define XFS_TRANS_ATTRINVAL 20 | | #define XFS_TRANS_ATTRINVAL 20 | |
| #define XFS_TRANS_ATRUNCATE 21 | | #define XFS_TRANS_ATRUNCATE 21 | |
| #define XFS_TRANS_ATTR_SET 22 | | #define XFS_TRANS_ATTR_SET 22 | |
| #define XFS_TRANS_ATTR_RM 23 | | #define XFS_TRANS_ATTR_RM 23 | |
| #define XFS_TRANS_ATTR_FLAG 24 | | #define XFS_TRANS_ATTR_FLAG 24 | |
| #define XFS_TRANS_CLEAR_AGI_BUCKET 25 | | #define XFS_TRANS_CLEAR_AGI_BUCKET 25 | |
| #define XFS_TRANS_QM_SBCHANGE 26 | | #define XFS_TRANS_QM_SBCHANGE 26 | |
| /* | | /* | |
| | | | |
| skipping to change at line 100 | | skipping to change at line 109 | |
| #define XFS_TRANS_QM_DQCLUSTER 32 | | #define XFS_TRANS_QM_DQCLUSTER 32 | |
| #define XFS_TRANS_QM_QINOCREATE 33 | | #define XFS_TRANS_QM_QINOCREATE 33 | |
| #define XFS_TRANS_QM_QUOTAOFF_END 34 | | #define XFS_TRANS_QM_QUOTAOFF_END 34 | |
| #define XFS_TRANS_SB_UNIT 35 | | #define XFS_TRANS_SB_UNIT 35 | |
| #define XFS_TRANS_FSYNC_TS 36 | | #define XFS_TRANS_FSYNC_TS 36 | |
| #define XFS_TRANS_GROWFSRT_ALLOC 37 | | #define XFS_TRANS_GROWFSRT_ALLOC 37 | |
| #define XFS_TRANS_GROWFSRT_ZERO 38 | | #define XFS_TRANS_GROWFSRT_ZERO 38 | |
| #define XFS_TRANS_GROWFSRT_FREE 39 | | #define XFS_TRANS_GROWFSRT_FREE 39 | |
| #define XFS_TRANS_SWAPEXT 40 | | #define XFS_TRANS_SWAPEXT 40 | |
| #define XFS_TRANS_SB_COUNT 41 | | #define XFS_TRANS_SB_COUNT 41 | |
|
| #define XFS_TRANS_TYPE_MAX 41 | | #define XFS_TRANS_CHECKPOINT 42 | |
| | | #define XFS_TRANS_TYPE_MAX 42 | |
| /* new transaction types need to be reflected in xfs_logprint(8) */ | | /* new transaction types need to be reflected in xfs_logprint(8) */ | |
| | | | |
|
| | | #define XFS_TRANS_TYPES \ | |
| | | { XFS_TRANS_SETATTR_NOT_SIZE, "SETATTR_NOT_SIZE" }, \ | |
| | | { XFS_TRANS_SETATTR_SIZE, "SETATTR_SIZE" }, \ | |
| | | { XFS_TRANS_INACTIVE, "INACTIVE" }, \ | |
| | | { XFS_TRANS_CREATE, "CREATE" }, \ | |
| | | { XFS_TRANS_CREATE_TRUNC, "CREATE_TRUNC" }, \ | |
| | | { XFS_TRANS_TRUNCATE_FILE, "TRUNCATE_FILE" }, \ | |
| | | { XFS_TRANS_REMOVE, "REMOVE" }, \ | |
| | | { XFS_TRANS_LINK, "LINK" }, \ | |
| | | { XFS_TRANS_RENAME, "RENAME" }, \ | |
| | | { XFS_TRANS_MKDIR, "MKDIR" }, \ | |
| | | { XFS_TRANS_RMDIR, "RMDIR" }, \ | |
| | | { XFS_TRANS_SYMLINK, "SYMLINK" }, \ | |
| | | { XFS_TRANS_SET_DMATTRS, "SET_DMATTRS" }, \ | |
| | | { XFS_TRANS_GROWFS, "GROWFS" }, \ | |
| | | { XFS_TRANS_STRAT_WRITE, "STRAT_WRITE" }, \ | |
| | | { XFS_TRANS_DIOSTRAT, "DIOSTRAT" }, \ | |
| | | { XFS_TRANS_WRITEID, "WRITEID" }, \ | |
| | | { XFS_TRANS_ADDAFORK, "ADDAFORK" }, \ | |
| | | { XFS_TRANS_ATTRINVAL, "ATTRINVAL" }, \ | |
| | | { XFS_TRANS_ATRUNCATE, "ATRUNCATE" }, \ | |
| | | { XFS_TRANS_ATTR_SET, "ATTR_SET" }, \ | |
| | | { XFS_TRANS_ATTR_RM, "ATTR_RM" }, \ | |
| | | { XFS_TRANS_ATTR_FLAG, "ATTR_FLAG" }, \ | |
| | | { XFS_TRANS_CLEAR_AGI_BUCKET, "CLEAR_AGI_BUCKET" }, \ | |
| | | { XFS_TRANS_QM_SBCHANGE, "QM_SBCHANGE" }, \ | |
| | | { XFS_TRANS_QM_QUOTAOFF, "QM_QUOTAOFF" }, \ | |
| | | { XFS_TRANS_QM_DQALLOC, "QM_DQALLOC" }, \ | |
| | | { XFS_TRANS_QM_SETQLIM, "QM_SETQLIM" }, \ | |
| | | { XFS_TRANS_QM_DQCLUSTER, "QM_DQCLUSTER" }, \ | |
| | | { XFS_TRANS_QM_QINOCREATE, "QM_QINOCREATE" }, \ | |
| | | { XFS_TRANS_QM_QUOTAOFF_END, "QM_QOFF_END" }, \ | |
| | | { XFS_TRANS_SB_UNIT, "SB_UNIT" }, \ | |
| | | { XFS_TRANS_FSYNC_TS, "FSYNC_TS" }, \ | |
| | | { XFS_TRANS_GROWFSRT_ALLOC, "GROWFSRT_ALLOC" }, \ | |
| | | { XFS_TRANS_GROWFSRT_ZERO, "GROWFSRT_ZERO" }, \ | |
| | | { XFS_TRANS_GROWFSRT_FREE, "GROWFSRT_FREE" }, \ | |
| | | { XFS_TRANS_SWAPEXT, "SWAPEXT" }, \ | |
| | | { XFS_TRANS_SB_COUNT, "SB_COUNT" }, \ | |
| | | { XFS_TRANS_CHECKPOINT, "CHECKPOINT" }, \ | |
| | | { XFS_TRANS_DUMMY1, "DUMMY1" }, \ | |
| | | { XFS_TRANS_DUMMY2, "DUMMY2" }, \ | |
| | | { XLOG_UNMOUNT_REC_TYPE, "UNMOUNT" } | |
| | | | |
| /* | | /* | |
| * This structure is used to track log items associated with | | * This structure is used to track log items associated with | |
| * a transaction. It points to the log item and keeps some | | * a transaction. It points to the log item and keeps some | |
| * flags to track the state of the log item. It also tracks | | * flags to track the state of the log item. It also tracks | |
| * the amount of space needed to log the item it describes | | * the amount of space needed to log the item it describes | |
| * once we get to commit processing (see xfs_trans_commit()). | | * once we get to commit processing (see xfs_trans_commit()). | |
| */ | | */ | |
|
| typedef struct xfs_log_item_desc { | | struct xfs_log_item_desc { | |
| struct xfs_log_item *lid_item; | | struct xfs_log_item *lid_item; | |
|
| ushort lid_size; | | ushort lid_size; | |
| unsigned char lid_flags; | | unsigned char lid_flags; | |
| unsigned char lid_index; | | struct list_head lid_trans; | |
| } xfs_log_item_desc_t; | | }; | |
| | | | |
| #define XFS_LID_DIRTY 0x1 | | #define XFS_LID_DIRTY 0x1 | |
|
| #define XFS_LID_PINNED 0x2 | | | |
| #define XFS_LID_BUF_STALE 0x8 | | | |
| | | | |
| /* | | | |
| * This structure is used to maintain a chunk list of log_item_desc | | | |
| * structures. The free field is a bitmask indicating which descriptors | | | |
| * in this chunk's array are free. The unused field is the first value | | | |
| * not used since this chunk was allocated. | | | |
| */ | | | |
| #define XFS_LIC_NUM_SLOTS 15 | | | |
| typedef struct xfs_log_item_chunk { | | | |
| struct xfs_log_item_chunk *lic_next; | | | |
| ushort lic_free; | | | |
| ushort lic_unused; | | | |
| xfs_log_item_desc_t lic_descs[XFS_LIC_NUM_SLOTS]; | | | |
| } xfs_log_item_chunk_t; | | | |
| | | | |
| #define XFS_LIC_MAX_SLOT (XFS_LIC_NUM_SLOTS - 1) | | | |
| #define XFS_LIC_FREEMASK ((1 << XFS_LIC_NUM_SLOTS) - 1) | | | |
| | | | |
| /* | | | |
| * Initialize the given chunk. Set the chunk's free descriptor mask | | | |
| * to indicate that all descriptors are free. The caller gets to set | | | |
| * lic_unused to the right value (0 matches all free). The | | | |
| * lic_descs.lid_index values are set up as each desc is allocated. | | | |
| */ | | | |
| static inline void xfs_lic_init(xfs_log_item_chunk_t *cp) | | | |
| { | | | |
| cp->lic_free = XFS_LIC_FREEMASK; | | | |
| } | | | |
| | | | |
| static inline void xfs_lic_init_slot(xfs_log_item_chunk_t *cp, int slot) | | | |
| { | | | |
| cp->lic_descs[slot].lid_index = (unsigned char)(slot); | | | |
| } | | | |
| | | | |
| static inline int xfs_lic_vacancy(xfs_log_item_chunk_t *cp) | | | |
| { | | | |
| return cp->lic_free & XFS_LIC_FREEMASK; | | | |
| } | | | |
| | | | |
| static inline void xfs_lic_all_free(xfs_log_item_chunk_t *cp) | | | |
| { | | | |
| cp->lic_free = XFS_LIC_FREEMASK; | | | |
| } | | | |
| | | | |
| static inline int xfs_lic_are_all_free(xfs_log_item_chunk_t *cp) | | | |
| { | | | |
| return ((cp->lic_free & XFS_LIC_FREEMASK) == XFS_LIC_FREEMASK); | | | |
| } | | | |
| | | | |
| static inline int xfs_lic_isfree(xfs_log_item_chunk_t *cp, int slot) | | | |
| { | | | |
| return (cp->lic_free & (1 << slot)); | | | |
| } | | | |
| | | | |
| static inline void xfs_lic_claim(xfs_log_item_chunk_t *cp, int slot) | | | |
| { | | | |
| cp->lic_free &= ~(1 << slot); | | | |
| } | | | |
| | | | |
| static inline void xfs_lic_relse(xfs_log_item_chunk_t *cp, int slot) | | | |
| { | | | |
| cp->lic_free |= 1 << slot; | | | |
| } | | | |
| | | | |
| static inline xfs_log_item_desc_t * | | | |
| xfs_lic_slot(xfs_log_item_chunk_t *cp, int slot) | | | |
| { | | | |
| return &(cp->lic_descs[slot]); | | | |
| } | | | |
| | | | |
| static inline int xfs_lic_desc_to_slot(xfs_log_item_desc_t *dp) | | | |
| { | | | |
| return (uint)dp->lid_index; | | | |
| } | | | |
| | | | |
| /* | | | |
| * Calculate the address of a chunk given a descriptor pointer: | | | |
| * dp - dp->lid_index give the address of the start of the lic_descs array. | | | |
| * From this we subtract the offset of the lic_descs field in a chunk. | | | |
| * All of this yields the address of the chunk, which is | | | |
| * cast to a chunk pointer. | | | |
| */ | | | |
| static inline xfs_log_item_chunk_t * | | | |
| xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp) | | | |
| { | | | |
| return (xfs_log_item_chunk_t*) \ | | | |
| (((xfs_caddr_t)((dp) - (dp)->lid_index)) - \ | | | |
| (xfs_caddr_t)(((xfs_log_item_chunk_t*)0)->lic_descs)); | | | |
| } | | | |
| | | | |
| #define XFS_TRANS_MAGIC 0x5452414E /* 'TRAN' */ | | #define XFS_TRANS_MAGIC 0x5452414E /* 'TRAN' */ | |
| /* | | /* | |
| * Values for t_flags. | | * Values for t_flags. | |
| */ | | */ | |
| #define XFS_TRANS_DIRTY 0x01 /* something needs to be log
ged */ | | #define XFS_TRANS_DIRTY 0x01 /* something needs to be log
ged */ | |
| #define XFS_TRANS_SB_DIRTY 0x02 /* superblock is modified */ | | #define XFS_TRANS_SB_DIRTY 0x02 /* superblock is modified */ | |
| #define XFS_TRANS_PERM_LOG_RES 0x04 /* xact took a permanent log
res */ | | #define XFS_TRANS_PERM_LOG_RES 0x04 /* xact took a permanent log
res */ | |
| #define XFS_TRANS_SYNC 0x08 /* make commit synchronous *
/ | | #define XFS_TRANS_SYNC 0x08 /* make commit synchronous *
/ | |
| #define XFS_TRANS_DQ_DIRTY 0x10 /* at least one dquot in trx dirty *
/ | | #define XFS_TRANS_DQ_DIRTY 0x10 /* at least one dquot in trx dirty *
/ | |
| #define XFS_TRANS_RESERVE 0x20 /* OK to use reserved data blocks */ | | #define XFS_TRANS_RESERVE 0x20 /* OK to use reserved data blocks */ | |
| | | | |
| /* | | /* | |
| * Values for call flags parameter. | | * Values for call flags parameter. | |
| */ | | */ | |
|
| #define XFS_TRANS_NOSLEEP 0x1 | | | |
| #define XFS_TRANS_WAIT 0x2 | | | |
| #define XFS_TRANS_RELEASE_LOG_RES 0x4 | | #define XFS_TRANS_RELEASE_LOG_RES 0x4 | |
| #define XFS_TRANS_ABORT 0x8 | | #define XFS_TRANS_ABORT 0x8 | |
| | | | |
| /* | | /* | |
| * Field values for xfs_trans_mod_sb. | | * Field values for xfs_trans_mod_sb. | |
| */ | | */ | |
| #define XFS_TRANS_SB_ICOUNT 0x00000001 | | #define XFS_TRANS_SB_ICOUNT 0x00000001 | |
| #define XFS_TRANS_SB_IFREE 0x00000002 | | #define XFS_TRANS_SB_IFREE 0x00000002 | |
| #define XFS_TRANS_SB_FDBLOCKS 0x00000004 | | #define XFS_TRANS_SB_FDBLOCKS 0x00000004 | |
| #define XFS_TRANS_SB_RES_FDBLOCKS 0x00000008 | | #define XFS_TRANS_SB_RES_FDBLOCKS 0x00000008 | |
| | | | |
| skipping to change at line 248 | | skipping to change at line 209 | |
| #define XFS_TRANS_SB_DBLOCKS 0x00000040 | | #define XFS_TRANS_SB_DBLOCKS 0x00000040 | |
| #define XFS_TRANS_SB_AGCOUNT 0x00000080 | | #define XFS_TRANS_SB_AGCOUNT 0x00000080 | |
| #define XFS_TRANS_SB_IMAXPCT 0x00000100 | | #define XFS_TRANS_SB_IMAXPCT 0x00000100 | |
| #define XFS_TRANS_SB_REXTSIZE 0x00000200 | | #define XFS_TRANS_SB_REXTSIZE 0x00000200 | |
| #define XFS_TRANS_SB_RBMBLOCKS 0x00000400 | | #define XFS_TRANS_SB_RBMBLOCKS 0x00000400 | |
| #define XFS_TRANS_SB_RBLOCKS 0x00000800 | | #define XFS_TRANS_SB_RBLOCKS 0x00000800 | |
| #define XFS_TRANS_SB_REXTENTS 0x00001000 | | #define XFS_TRANS_SB_REXTENTS 0x00001000 | |
| #define XFS_TRANS_SB_REXTSLOG 0x00002000 | | #define XFS_TRANS_SB_REXTSLOG 0x00002000 | |
| | | | |
| /* | | /* | |
|
| * Various log reservation values. | | | |
| * These are based on the size of the file system block | | | |
| * because that is what most transactions manipulate. | | | |
| * Each adds in an additional 128 bytes per item logged to | | | |
| * try to account for the overhead of the transaction mechanism. | | | |
| * | | | |
| * Note: | | | |
| * Most of the reservations underestimate the number of allocation | | | |
| * groups into which they could free extents in the xfs_bmap_finish() | | | |
| * call. This is because the number in the worst case is quite high | | | |
| * and quite unusual. In order to fix this we need to change | | | |
| * xfs_bmap_finish() to free extents in only a single AG at a time. | | | |
| * This will require changes to the EFI code as well, however, so that | | | |
| * the EFI for the extents not freed is logged again in each transaction. | | | |
| * See bug 261917. | | | |
| */ | | | |
| | | | |
| /* | | | |
| * Per-extent log reservation for the allocation btree changes | | * Per-extent log reservation for the allocation btree changes | |
| * involved in freeing or allocating an extent. | | * involved in freeing or allocating an extent. | |
| * 2 trees * (2 blocks/level * max depth - 1) * block size | | * 2 trees * (2 blocks/level * max depth - 1) * block size | |
| */ | | */ | |
| #define XFS_ALLOCFREE_LOG_RES(mp,nx) \ | | #define XFS_ALLOCFREE_LOG_RES(mp,nx) \ | |
| ((nx) * (2 * XFS_FSB_TO_B((mp), 2 * XFS_AG_MAXLEVELS(mp) - 1))) | | ((nx) * (2 * XFS_FSB_TO_B((mp), 2 * XFS_AG_MAXLEVELS(mp) - 1))) | |
| #define XFS_ALLOCFREE_LOG_COUNT(mp,nx) \ | | #define XFS_ALLOCFREE_LOG_COUNT(mp,nx) \ | |
| ((nx) * (2 * (2 * XFS_AG_MAXLEVELS(mp) - 1))) | | ((nx) * (2 * (2 * XFS_AG_MAXLEVELS(mp) - 1))) | |
| | | | |
| /* | | /* | |
| | | | |
| skipping to change at line 289 | | skipping to change at line 232 | |
| * v2 directory blocks can be fragmented below the dirblksize down to the f
sb | | * v2 directory blocks can be fragmented below the dirblksize down to the f
sb | |
| * size, so account for that in the DAENTER macros. | | * size, so account for that in the DAENTER macros. | |
| */ | | */ | |
| #define XFS_DIROP_LOG_RES(mp) \ | | #define XFS_DIROP_LOG_RES(mp) \ | |
| (XFS_FSB_TO_B(mp, XFS_DAENTER_BLOCKS(mp, XFS_DATA_FORK)) + \ | | (XFS_FSB_TO_B(mp, XFS_DAENTER_BLOCKS(mp, XFS_DATA_FORK)) + \ | |
| (XFS_FSB_TO_B(mp, XFS_DAENTER_BMAPS(mp, XFS_DATA_FORK) + 1))) | | (XFS_FSB_TO_B(mp, XFS_DAENTER_BMAPS(mp, XFS_DATA_FORK) + 1))) | |
| #define XFS_DIROP_LOG_COUNT(mp) \ | | #define XFS_DIROP_LOG_COUNT(mp) \ | |
| (XFS_DAENTER_BLOCKS(mp, XFS_DATA_FORK) + \ | | (XFS_DAENTER_BLOCKS(mp, XFS_DATA_FORK) + \ | |
| XFS_DAENTER_BMAPS(mp, XFS_DATA_FORK) + 1) | | XFS_DAENTER_BMAPS(mp, XFS_DATA_FORK) + 1) | |
| | | | |
|
| /* | | | |
| * In a write transaction we can allocate a maximum of 2 | | | |
| * extents. This gives: | | | |
| * the inode getting the new extents: inode size | | | |
| * the inode\'s bmap btree: max depth * block size | | | |
| * the agfs of the ags from which the extents are allocated: 2 * sector | | | |
| * the superblock free block counter: sector size | | | |
| * the allocation btrees: 2 exts * 2 trees * (2 * max depth - 1) * block | | | |
| size | | | |
| * And the bmap_finish transaction can free bmap blocks in a join: | | | |
| * the agfs of the ags containing the blocks: 2 * sector size | | | |
| * the agfls of the ags containing the blocks: 2 * sector size | | | |
| * the super block free block counter: sector size | | | |
| * the allocation btrees: 2 exts * 2 trees * (2 * max depth - 1) * block | | | |
| size | | | |
| */ | | | |
| #define XFS_CALC_WRITE_LOG_RES(mp) \ | | | |
| (MAX( \ | | | |
| ((mp)->m_sb.sb_inodesize + \ | | | |
| XFS_FSB_TO_B((mp), XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK)) + \ | | | |
| (2 * (mp)->m_sb.sb_sectsize) + \ | | | |
| (mp)->m_sb.sb_sectsize + \ | | | |
| XFS_ALLOCFREE_LOG_RES(mp, 2) + \ | | | |
| (128 * (4 + XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) + XFS_ALLOCFREE_LO | | | |
| G_COUNT(mp, 2)))),\ | | | |
| ((2 * (mp)->m_sb.sb_sectsize) + \ | | | |
| (2 * (mp)->m_sb.sb_sectsize) + \ | | | |
| (mp)->m_sb.sb_sectsize + \ | | | |
| XFS_ALLOCFREE_LOG_RES(mp, 2) + \ | | | |
| (128 * (5 + XFS_ALLOCFREE_LOG_COUNT(mp, 2)))))) | | | |
| | | | |
| #define XFS_WRITE_LOG_RES(mp) ((mp)->m_reservations.tr_write) | | #define XFS_WRITE_LOG_RES(mp) ((mp)->m_reservations.tr_write) | |
|
| | | | |
| /* | | | |
| * In truncating a file we free up to two extents at once. We can modify: | | | |
| * the inode being truncated: inode size | | | |
| * the inode\'s bmap btree: (max depth + 1) * block size | | | |
| * And the bmap_finish transaction can free the blocks and bmap blocks: | | | |
| * the agf for each of the ags: 4 * sector size | | | |
| * the agfl for each of the ags: 4 * sector size | | | |
| * the super block to reflect the freed blocks: sector size | | | |
| * worst case split in allocation btrees per extent assuming 4 extents: | | | |
| * 4 exts * 2 trees * (2 * max depth - 1) * block size | | | |
| * the inode btree: max depth * blocksize | | | |
| * the allocation btrees: 2 trees * (max depth - 1) * block size | | | |
| */ | | | |
| #define XFS_CALC_ITRUNCATE_LOG_RES(mp) \ | | | |
| (MAX( \ | | | |
| ((mp)->m_sb.sb_inodesize + \ | | | |
| XFS_FSB_TO_B((mp), XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) + 1) + \ | | | |
| (128 * (2 + XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK)))), \ | | | |
| ((4 * (mp)->m_sb.sb_sectsize) + \ | | | |
| (4 * (mp)->m_sb.sb_sectsize) + \ | | | |
| (mp)->m_sb.sb_sectsize + \ | | | |
| XFS_ALLOCFREE_LOG_RES(mp, 4) + \ | | | |
| (128 * (9 + XFS_ALLOCFREE_LOG_COUNT(mp, 4))) + \ | | | |
| (128 * 5) + \ | | | |
| XFS_ALLOCFREE_LOG_RES(mp, 1) + \ | | | |
| (128 * (2 + XFS_IALLOC_BLOCKS(mp) + XFS_IN_MAXLEVELS(mp) + \ | | | |
| XFS_ALLOCFREE_LOG_COUNT(mp, 1)))))) | | | |
| | | | |
| #define XFS_ITRUNCATE_LOG_RES(mp) ((mp)->m_reservations.tr_itrunca
te) | | #define XFS_ITRUNCATE_LOG_RES(mp) ((mp)->m_reservations.tr_itrunca
te) | |
|
| | | | |
| /* | | | |
| * In renaming a files we can modify: | | | |
| * the four inodes involved: 4 * inode size | | | |
| * the two directory btrees: 2 * (max depth + v2) * dir block size | | | |
| * the two directory bmap btrees: 2 * max depth * block size | | | |
| * And the bmap_finish transaction can free dir and bmap blocks (two sets | | | |
| * of bmap blocks) giving: | | | |
| * the agf for the ags in which the blocks live: 3 * sector size | | | |
| * the agfl for the ags in which the blocks live: 3 * sector size | | | |
| * the superblock for the free block count: sector size | | | |
| * the allocation btrees: 3 exts * 2 trees * (2 * max depth - 1) * block | | | |
| size | | | |
| */ | | | |
| #define XFS_CALC_RENAME_LOG_RES(mp) \ | | | |
| (MAX( \ | | | |
| ((4 * (mp)->m_sb.sb_inodesize) + \ | | | |
| (2 * XFS_DIROP_LOG_RES(mp)) + \ | | | |
| (128 * (4 + 2 * XFS_DIROP_LOG_COUNT(mp)))), \ | | | |
| ((3 * (mp)->m_sb.sb_sectsize) + \ | | | |
| (3 * (mp)->m_sb.sb_sectsize) + \ | | | |
| (mp)->m_sb.sb_sectsize + \ | | | |
| XFS_ALLOCFREE_LOG_RES(mp, 3) + \ | | | |
| (128 * (7 + XFS_ALLOCFREE_LOG_COUNT(mp, 3)))))) | | | |
| | | | |
| #define XFS_RENAME_LOG_RES(mp) ((mp)->m_reservations.tr_rename) | | #define XFS_RENAME_LOG_RES(mp) ((mp)->m_reservations.tr_rename) | |
|
| | | | |
| /* | | | |
| * For creating a link to an inode: | | | |
| * the parent directory inode: inode size | | | |
| * the linked inode: inode size | | | |
| * the directory btree could split: (max depth + v2) * dir block size | | | |
| * the directory bmap btree could join or split: (max depth + v2) * bloc | | | |
| ksize | | | |
| * And the bmap_finish transaction can free some bmap blocks giving: | | | |
| * the agf for the ag in which the blocks live: sector size | | | |
| * the agfl for the ag in which the blocks live: sector size | | | |
| * the superblock for the free block count: sector size | | | |
| * the allocation btrees: 2 trees * (2 * max depth - 1) * block size | | | |
| */ | | | |
| #define XFS_CALC_LINK_LOG_RES(mp) \ | | | |
| (MAX( \ | | | |
| ((mp)->m_sb.sb_inodesize + \ | | | |
| (mp)->m_sb.sb_inodesize + \ | | | |
| XFS_DIROP_LOG_RES(mp) + \ | | | |
| (128 * (2 + XFS_DIROP_LOG_COUNT(mp)))), \ | | | |
| ((mp)->m_sb.sb_sectsize + \ | | | |
| (mp)->m_sb.sb_sectsize + \ | | | |
| (mp)->m_sb.sb_sectsize + \ | | | |
| XFS_ALLOCFREE_LOG_RES(mp, 1) + \ | | | |
| (128 * (3 + XFS_ALLOCFREE_LOG_COUNT(mp, 1)))))) | | | |
| | | | |
| #define XFS_LINK_LOG_RES(mp) ((mp)->m_reservations.tr_link) | | #define XFS_LINK_LOG_RES(mp) ((mp)->m_reservations.tr_link) | |
|
| | | | |
| /* | | | |
| * For removing a directory entry we can modify: | | | |
| * the parent directory inode: inode size | | | |
| * the removed inode: inode size | | | |
| * the directory btree could join: (max depth + v2) * dir block size | | | |
| * the directory bmap btree could join or split: (max depth + v2) * bloc | | | |
| ksize | | | |
| * And the bmap_finish transaction can free the dir and bmap blocks giving: | | | |
| * the agf for the ag in which the blocks live: 2 * sector size | | | |
| * the agfl for the ag in which the blocks live: 2 * sector size | | | |
| * the superblock for the free block count: sector size | | | |
| * the allocation btrees: 2 exts * 2 trees * (2 * max depth - 1) * block | | | |
| size | | | |
| */ | | | |
| #define XFS_CALC_REMOVE_LOG_RES(mp) \ | | | |
| (MAX( \ | | | |
| ((mp)->m_sb.sb_inodesize + \ | | | |
| (mp)->m_sb.sb_inodesize + \ | | | |
| XFS_DIROP_LOG_RES(mp) + \ | | | |
| (128 * (2 + XFS_DIROP_LOG_COUNT(mp)))), \ | | | |
| ((2 * (mp)->m_sb.sb_sectsize) + \ | | | |
| (2 * (mp)->m_sb.sb_sectsize) + \ | | | |
| (mp)->m_sb.sb_sectsize + \ | | | |
| XFS_ALLOCFREE_LOG_RES(mp, 2) + \ | | | |
| (128 * (5 + XFS_ALLOCFREE_LOG_COUNT(mp, 2)))))) | | | |
| | | | |
| #define XFS_REMOVE_LOG_RES(mp) ((mp)->m_reservations.tr_remove) | | #define XFS_REMOVE_LOG_RES(mp) ((mp)->m_reservations.tr_remove) | |
|
| | | | |
| /* | | | |
| * For symlink we can modify: | | | |
| * the parent directory inode: inode size | | | |
| * the new inode: inode size | | | |
| * the inode btree entry: 1 block | | | |
| * the directory btree: (max depth + v2) * dir block size | | | |
| * the directory inode\'s bmap btree: (max depth + v2) * block size | | | |
| * the blocks for the symlink: 1 KB | | | |
| * Or in the first xact we allocate some inodes giving: | | | |
| * the agi and agf of the ag getting the new inodes: 2 * sectorsize | | | |
| * the inode blocks allocated: XFS_IALLOC_BLOCKS * blocksize | | | |
| * the inode btree: max depth * blocksize | | | |
| * the allocation btrees: 2 trees * (2 * max depth - 1) * block size | | | |
| */ | | | |
| #define XFS_CALC_SYMLINK_LOG_RES(mp) \ | | | |
| (MAX( \ | | | |
| ((mp)->m_sb.sb_inodesize + \ | | | |
| (mp)->m_sb.sb_inodesize + \ | | | |
| XFS_FSB_TO_B(mp, 1) + \ | | | |
| XFS_DIROP_LOG_RES(mp) + \ | | | |
| 1024 + \ | | | |
| (128 * (4 + XFS_DIROP_LOG_COUNT(mp)))), \ | | | |
| (2 * (mp)->m_sb.sb_sectsize + \ | | | |
| XFS_FSB_TO_B((mp), XFS_IALLOC_BLOCKS((mp))) + \ | | | |
| XFS_FSB_TO_B((mp), XFS_IN_MAXLEVELS(mp)) + \ | | | |
| XFS_ALLOCFREE_LOG_RES(mp, 1) + \ | | | |
| (128 * (2 + XFS_IALLOC_BLOCKS(mp) + XFS_IN_MAXLEVELS(mp) + \ | | | |
| XFS_ALLOCFREE_LOG_COUNT(mp, 1)))))) | | | |
| | | | |
| #define XFS_SYMLINK_LOG_RES(mp) ((mp)->m_reservations.tr_symlink) | | #define XFS_SYMLINK_LOG_RES(mp) ((mp)->m_reservations.tr_symlink) | |
|
| | | | |
| /* | | | |
| * For create we can modify: | | | |
| * the parent directory inode: inode size | | | |
| * the new inode: inode size | | | |
| * the inode btree entry: block size | | | |
| * the superblock for the nlink flag: sector size | | | |
| * the directory btree: (max depth + v2) * dir block size | | | |
| * the directory inode\'s bmap btree: (max depth + v2) * block size | | | |
| * Or in the first xact we allocate some inodes giving: | | | |
| * the agi and agf of the ag getting the new inodes: 2 * sectorsize | | | |
| * the superblock for the nlink flag: sector size | | | |
| * the inode blocks allocated: XFS_IALLOC_BLOCKS * blocksize | | | |
| * the inode btree: max depth * blocksize | | | |
| * the allocation btrees: 2 trees * (max depth - 1) * block size | | | |
| */ | | | |
| #define XFS_CALC_CREATE_LOG_RES(mp) \ | | | |
| (MAX( \ | | | |
| ((mp)->m_sb.sb_inodesize + \ | | | |
| (mp)->m_sb.sb_inodesize + \ | | | |
| (mp)->m_sb.sb_sectsize + \ | | | |
| XFS_FSB_TO_B(mp, 1) + \ | | | |
| XFS_DIROP_LOG_RES(mp) + \ | | | |
| (128 * (3 + XFS_DIROP_LOG_COUNT(mp)))), \ | | | |
| (3 * (mp)->m_sb.sb_sectsize + \ | | | |
| XFS_FSB_TO_B((mp), XFS_IALLOC_BLOCKS((mp))) + \ | | | |
| XFS_FSB_TO_B((mp), XFS_IN_MAXLEVELS(mp)) + \ | | | |
| XFS_ALLOCFREE_LOG_RES(mp, 1) + \ | | | |
| (128 * (2 + XFS_IALLOC_BLOCKS(mp) + XFS_IN_MAXLEVELS(mp) + \ | | | |
| XFS_ALLOCFREE_LOG_COUNT(mp, 1)))))) | | | |
| | | | |
| #define XFS_CREATE_LOG_RES(mp) ((mp)->m_reservations.tr_create) | | #define XFS_CREATE_LOG_RES(mp) ((mp)->m_reservations.tr_create) | |
|
| | | | |
| /* | | | |
| * Making a new directory is the same as creating a new file. | | | |
| */ | | | |
| #define XFS_CALC_MKDIR_LOG_RES(mp) XFS_CALC_CREATE_LOG_RES(mp) | | | |
| | | | |
| #define XFS_MKDIR_LOG_RES(mp) ((mp)->m_reservations.tr_mkdir) | | #define XFS_MKDIR_LOG_RES(mp) ((mp)->m_reservations.tr_mkdir) | |
|
| | | | |
| /* | | | |
| * In freeing an inode we can modify: | | | |
| * the inode being freed: inode size | | | |
| * the super block free inode counter: sector size | | | |
| * the agi hash list and counters: sector size | | | |
| * the inode btree entry: block size | | | |
| * the on disk inode before ours in the agi hash list: inode cluster siz | | | |
| e | | | |
| * the inode btree: max depth * blocksize | | | |
| * the allocation btrees: 2 trees * (max depth - 1) * block size | | | |
| */ | | | |
| #define XFS_CALC_IFREE_LOG_RES(mp) \ | | | |
| ((mp)->m_sb.sb_inodesize + \ | | | |
| (mp)->m_sb.sb_sectsize + \ | | | |
| (mp)->m_sb.sb_sectsize + \ | | | |
| XFS_FSB_TO_B((mp), 1) + \ | | | |
| MAX((__uint16_t)XFS_FSB_TO_B((mp), 1), XFS_INODE_CLUSTER_SIZE(mp)) | | | |
| + \ | | | |
| (128 * 5) + \ | | | |
| XFS_ALLOCFREE_LOG_RES(mp, 1) + \ | | | |
| (128 * (2 + XFS_IALLOC_BLOCKS(mp) + XFS_IN_MAXLEVELS(mp) + \ | | | |
| XFS_ALLOCFREE_LOG_COUNT(mp, 1)))) | | | |
| | | | |
| #define XFS_IFREE_LOG_RES(mp) ((mp)->m_reservations.tr_ifree) | | #define XFS_IFREE_LOG_RES(mp) ((mp)->m_reservations.tr_ifree) | |
|
| | | | |
| /* | | | |
| * When only changing the inode we log the inode and possibly the superbloc | | | |
| k | | | |
| * We also add a bit of slop for the transaction stuff. | | | |
| */ | | | |
| #define XFS_CALC_ICHANGE_LOG_RES(mp) ((mp)->m_sb.sb_inodesize + \ | | | |
| (mp)->m_sb.sb_sectsize + 512) | | | |
| | | | |
| #define XFS_ICHANGE_LOG_RES(mp) ((mp)->m_reservations.tr_ichange) | | #define XFS_ICHANGE_LOG_RES(mp) ((mp)->m_reservations.tr_ichange) | |
|
| | | | |
| /* | | | |
| * Growing the data section of the filesystem. | | | |
| * superblock | | | |
| * agi and agf | | | |
| * allocation btrees | | | |
| */ | | | |
| #define XFS_CALC_GROWDATA_LOG_RES(mp) \ | | | |
| ((mp)->m_sb.sb_sectsize * 3 + \ | | | |
| XFS_ALLOCFREE_LOG_RES(mp, 1) + \ | | | |
| (128 * (3 + XFS_ALLOCFREE_LOG_COUNT(mp, 1)))) | | | |
| | | | |
| #define XFS_GROWDATA_LOG_RES(mp) ((mp)->m_reservations.tr_growdat
a) | | #define XFS_GROWDATA_LOG_RES(mp) ((mp)->m_reservations.tr_growdat
a) | |
|
| | | | |
| /* | | | |
| * Growing the rt section of the filesystem. | | | |
| * In the first set of transactions (ALLOC) we allocate space to the | | | |
| * bitmap or summary files. | | | |
| * superblock: sector size | | | |
| * agf of the ag from which the extent is allocated: sector size | | | |
| * bmap btree for bitmap/summary inode: max depth * blocksize | | | |
| * bitmap/summary inode: inode size | | | |
| * allocation btrees for 1 block alloc: 2 * (2 * maxdepth - 1) * blocks | | | |
| ize | | | |
| */ | | | |
| #define XFS_CALC_GROWRTALLOC_LOG_RES(mp) \ | | | |
| (2 * (mp)->m_sb.sb_sectsize + \ | | | |
| XFS_FSB_TO_B((mp), XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK)) + \ | | | |
| (mp)->m_sb.sb_inodesize + \ | | | |
| XFS_ALLOCFREE_LOG_RES(mp, 1) + \ | | | |
| (128 * \ | | | |
| (3 + XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) + \ | | | |
| XFS_ALLOCFREE_LOG_COUNT(mp, 1)))) | | | |
| | | | |
| #define XFS_GROWRTALLOC_LOG_RES(mp) ((mp)->m_reservations.tr_gro
wrtalloc) | | #define XFS_GROWRTALLOC_LOG_RES(mp) ((mp)->m_reservations.tr_gro
wrtalloc) | |
|
| | | | |
| /* | | | |
| * Growing the rt section of the filesystem. | | | |
| * In the second set of transactions (ZERO) we zero the new metadata blocks | | | |
| . | | | |
| * one bitmap/summary block: blocksize | | | |
| */ | | | |
| #define XFS_CALC_GROWRTZERO_LOG_RES(mp) \ | | | |
| ((mp)->m_sb.sb_blocksize + 128) | | | |
| | | | |
| #define XFS_GROWRTZERO_LOG_RES(mp) ((mp)->m_reservations.tr_gro
wrtzero) | | #define XFS_GROWRTZERO_LOG_RES(mp) ((mp)->m_reservations.tr_gro
wrtzero) | |
|
| | | | |
| /* | | | |
| * Growing the rt section of the filesystem. | | | |
| * In the third set of transactions (FREE) we update metadata without | | | |
| * allocating any new blocks. | | | |
| * superblock: sector size | | | |
| * bitmap inode: inode size | | | |
| * summary inode: inode size | | | |
| * one bitmap block: blocksize | | | |
| * summary blocks: new summary size | | | |
| */ | | | |
| #define XFS_CALC_GROWRTFREE_LOG_RES(mp) \ | | | |
| ((mp)->m_sb.sb_sectsize + \ | | | |
| 2 * (mp)->m_sb.sb_inodesize + \ | | | |
| (mp)->m_sb.sb_blocksize + \ | | | |
| (mp)->m_rsumsize + \ | | | |
| (128 * 5)) | | | |
| | | | |
| #define XFS_GROWRTFREE_LOG_RES(mp) ((mp)->m_reservations.tr_gro
wrtfree) | | #define XFS_GROWRTFREE_LOG_RES(mp) ((mp)->m_reservations.tr_gro
wrtfree) | |
|
| | | | |
| /* | | | |
| * Logging the inode modification timestamp on a synchronous write. | | | |
| * inode | | | |
| */ | | | |
| #define XFS_CALC_SWRITE_LOG_RES(mp) \ | | | |
| ((mp)->m_sb.sb_inodesize + 128) | | | |
| | | | |
| #define XFS_SWRITE_LOG_RES(mp) ((mp)->m_reservations.tr_swrite) | | #define XFS_SWRITE_LOG_RES(mp) ((mp)->m_reservations.tr_swrite) | |
|
| | | | |
| /* | | /* | |
| * Logging the inode timestamps on an fsync -- same as SWRITE | | * Logging the inode timestamps on an fsync -- same as SWRITE | |
| * as long as SWRITE logs the entire inode core | | * as long as SWRITE logs the entire inode core | |
| */ | | */ | |
| #define XFS_FSYNC_TS_LOG_RES(mp) ((mp)->m_reservations.tr_swrite) | | #define XFS_FSYNC_TS_LOG_RES(mp) ((mp)->m_reservations.tr_swrite) | |
|
| | | | |
| /* | | | |
| * Logging the inode mode bits when writing a setuid/setgid file | | | |
| * inode | | | |
| */ | | | |
| #define XFS_CALC_WRITEID_LOG_RES(mp) \ | | | |
| ((mp)->m_sb.sb_inodesize + 128) | | | |
| | | | |
| #define XFS_WRITEID_LOG_RES(mp) ((mp)->m_reservations.tr_swrite) | | #define XFS_WRITEID_LOG_RES(mp) ((mp)->m_reservations.tr_swrite) | |
|
| | | | |
| /* | | | |
| * Converting the inode from non-attributed to attributed. | | | |
| * the inode being converted: inode size | | | |
| * agf block and superblock (for block allocation) | | | |
| * the new block (directory sized) | | | |
| * bmap blocks for the new directory block | | | |
| * allocation btrees | | | |
| */ | | | |
| #define XFS_CALC_ADDAFORK_LOG_RES(mp) \ | | | |
| ((mp)->m_sb.sb_inodesize + \ | | | |
| (mp)->m_sb.sb_sectsize * 2 + \ | | | |
| (mp)->m_dirblksize + \ | | | |
| XFS_FSB_TO_B(mp, (XFS_DAENTER_BMAP1B(mp, XFS_DATA_FORK) + 1)) + \ | | | |
| XFS_ALLOCFREE_LOG_RES(mp, 1) + \ | | | |
| (128 * (4 + (XFS_DAENTER_BMAP1B(mp, XFS_DATA_FORK) + 1) + \ | | | |
| XFS_ALLOCFREE_LOG_COUNT(mp, 1)))) | | | |
| | | | |
| #define XFS_ADDAFORK_LOG_RES(mp) ((mp)->m_reservations.tr_add
afork) | | #define XFS_ADDAFORK_LOG_RES(mp) ((mp)->m_reservations.tr_add
afork) | |
|
| | | | |
| /* | | | |
| * Removing the attribute fork of a file | | | |
| * the inode being truncated: inode size | | | |
| * the inode\'s bmap btree: max depth * block size | | | |
| * And the bmap_finish transaction can free the blocks and bmap blocks: | | | |
| * the agf for each of the ags: 4 * sector size | | | |
| * the agfl for each of the ags: 4 * sector size | | | |
| * the super block to reflect the freed blocks: sector size | | | |
| * worst case split in allocation btrees per extent assuming 4 extents: | | | |
| * 4 exts * 2 trees * (2 * max depth - 1) * block size | | | |
| */ | | | |
| #define XFS_CALC_ATTRINVAL_LOG_RES(mp) \ | | | |
| (MAX( \ | | | |
| ((mp)->m_sb.sb_inodesize + \ | | | |
| XFS_FSB_TO_B((mp), XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK)) + \ | | | |
| (128 * (1 + XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK)))), \ | | | |
| ((4 * (mp)->m_sb.sb_sectsize) + \ | | | |
| (4 * (mp)->m_sb.sb_sectsize) + \ | | | |
| (mp)->m_sb.sb_sectsize + \ | | | |
| XFS_ALLOCFREE_LOG_RES(mp, 4) + \ | | | |
| (128 * (9 + XFS_ALLOCFREE_LOG_COUNT(mp, 4)))))) | | | |
| | | | |
| #define XFS_ATTRINVAL_LOG_RES(mp) ((mp)->m_reservations.tr_att
rinval) | | #define XFS_ATTRINVAL_LOG_RES(mp) ((mp)->m_reservations.tr_att
rinval) | |
|
| | | | |
| /* | | | |
| * Setting an attribute. | | | |
| * the inode getting the attribute | | | |
| * the superblock for allocations | | | |
| * the agfs extents are allocated from | | | |
| * the attribute btree * max depth | | | |
| * the inode allocation btree | | | |
| * Since attribute transaction space is dependent on the size of the attrib | | | |
| ute, | | | |
| * the calculation is done partially at mount time and partially at runtime | | | |
| . | | | |
| */ | | | |
| #define XFS_CALC_ATTRSET_LOG_RES(mp) \ | | | |
| ((mp)->m_sb.sb_inodesize + \ | | | |
| (mp)->m_sb.sb_sectsize + \ | | | |
| XFS_FSB_TO_B((mp), XFS_DA_NODE_MAXDEPTH) + \ | | | |
| (128 * (2 + XFS_DA_NODE_MAXDEPTH))) | | | |
| | | | |
| #define XFS_ATTRSET_LOG_RES(mp, ext) \ | | #define XFS_ATTRSET_LOG_RES(mp, ext) \ | |
| ((mp)->m_reservations.tr_attrset + \ | | ((mp)->m_reservations.tr_attrset + \ | |
| (ext * (mp)->m_sb.sb_sectsize) + \ | | (ext * (mp)->m_sb.sb_sectsize) + \ | |
| (ext * XFS_FSB_TO_B((mp), XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK))) + \ | | (ext * XFS_FSB_TO_B((mp), XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK))) + \ | |
| (128 * (ext + (ext * XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK))))) | | (128 * (ext + (ext * XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK))))) | |
|
| | | | |
| /* | | | |
| * Removing an attribute. | | | |
| * the inode: inode size | | | |
| * the attribute btree could join: max depth * block size | | | |
| * the inode bmap btree could join or split: max depth * block size | | | |
| * And the bmap_finish transaction can free the attr blocks freed giving: | | | |
| * the agf for the ag in which the blocks live: 2 * sector size | | | |
| * the agfl for the ag in which the blocks live: 2 * sector size | | | |
| * the superblock for the free block count: sector size | | | |
| * the allocation btrees: 2 exts * 2 trees * (2 * max depth - 1) * block | | | |
| size | | | |
| */ | | | |
| #define XFS_CALC_ATTRRM_LOG_RES(mp) \ | | | |
| (MAX( \ | | | |
| ((mp)->m_sb.sb_inodesize + \ | | | |
| XFS_FSB_TO_B((mp), XFS_DA_NODE_MAXDEPTH) + \ | | | |
| XFS_FSB_TO_B((mp), XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK)) + \ | | | |
| (128 * (1 + XFS_DA_NODE_MAXDEPTH + XFS_BM_MAXLEVELS(mp, XFS_DATA_F | | | |
| ORK)))), \ | | | |
| ((2 * (mp)->m_sb.sb_sectsize) + \ | | | |
| (2 * (mp)->m_sb.sb_sectsize) + \ | | | |
| (mp)->m_sb.sb_sectsize + \ | | | |
| XFS_ALLOCFREE_LOG_RES(mp, 2) + \ | | | |
| (128 * (5 + XFS_ALLOCFREE_LOG_COUNT(mp, 2)))))) | | | |
| | | | |
| #define XFS_ATTRRM_LOG_RES(mp) ((mp)->m_reservations.tr_attrrm) | | #define XFS_ATTRRM_LOG_RES(mp) ((mp)->m_reservations.tr_attrrm) | |
|
| | | | |
| /* | | | |
| * Clearing a bad agino number in an agi hash bucket. | | | |
| */ | | | |
| #define XFS_CALC_CLEAR_AGI_BUCKET_LOG_RES(mp) \ | | | |
| ((mp)->m_sb.sb_sectsize + 128) | | | |
| | | | |
| #define XFS_CLEAR_AGI_BUCKET_LOG_RES(mp) ((mp)->m_reservations.tr_c
learagi) | | #define XFS_CLEAR_AGI_BUCKET_LOG_RES(mp) ((mp)->m_reservations.tr_c
learagi) | |
| | | | |
| /* | | /* | |
| * Various log count values. | | * Various log count values. | |
| */ | | */ | |
| #define XFS_DEFAULT_LOG_COUNT 1 | | #define XFS_DEFAULT_LOG_COUNT 1 | |
| #define XFS_DEFAULT_PERM_LOG_COUNT 2 | | #define XFS_DEFAULT_PERM_LOG_COUNT 2 | |
| #define XFS_ITRUNCATE_LOG_COUNT 2 | | #define XFS_ITRUNCATE_LOG_COUNT 2 | |
| #define XFS_INACTIVE_LOG_COUNT 2 | | #define XFS_INACTIVE_LOG_COUNT 2 | |
| #define XFS_CREATE_LOG_COUNT 2 | | #define XFS_CREATE_LOG_COUNT 2 | |
| | | | |
| skipping to change at line 744 | | skipping to change at line 294 | |
| * reference count values. This determine how hard the buffer | | * reference count values. This determine how hard the buffer | |
| * cache tries to hold onto the buffer. | | * cache tries to hold onto the buffer. | |
| */ | | */ | |
| #define XFS_AGF_REF 4 | | #define XFS_AGF_REF 4 | |
| #define XFS_AGI_REF 4 | | #define XFS_AGI_REF 4 | |
| #define XFS_AGFL_REF 3 | | #define XFS_AGFL_REF 3 | |
| #define XFS_INO_BTREE_REF 3 | | #define XFS_INO_BTREE_REF 3 | |
| #define XFS_ALLOC_BTREE_REF 2 | | #define XFS_ALLOC_BTREE_REF 2 | |
| #define XFS_BMAP_BTREE_REF 2 | | #define XFS_BMAP_BTREE_REF 2 | |
| #define XFS_DIR_BTREE_REF 2 | | #define XFS_DIR_BTREE_REF 2 | |
|
| | | #define XFS_INO_REF 2 | |
| #define XFS_ATTR_BTREE_REF 1 | | #define XFS_ATTR_BTREE_REF 1 | |
|
| #define XFS_INO_REF 1 | | | |
| #define XFS_DQUOT_REF 1 | | #define XFS_DQUOT_REF 1 | |
| | | | |
| #ifdef __KERNEL__ | | #ifdef __KERNEL__ | |
| | | | |
| struct xfs_buf; | | struct xfs_buf; | |
| struct xfs_buftarg; | | struct xfs_buftarg; | |
| struct xfs_efd_log_item; | | struct xfs_efd_log_item; | |
| struct xfs_efi_log_item; | | struct xfs_efi_log_item; | |
| struct xfs_inode; | | struct xfs_inode; | |
| struct xfs_item_ops; | | struct xfs_item_ops; | |
| struct xfs_log_iovec; | | struct xfs_log_iovec; | |
| struct xfs_log_item_desc; | | struct xfs_log_item_desc; | |
| struct xfs_mount; | | struct xfs_mount; | |
| struct xfs_trans; | | struct xfs_trans; | |
| struct xfs_dquot_acct; | | struct xfs_dquot_acct; | |
|
| | | struct xfs_busy_extent; | |
| | | | |
| typedef struct xfs_log_item { | | typedef struct xfs_log_item { | |
| struct list_head li_ail; /* AIL pointers */ | | struct list_head li_ail; /* AIL pointers */ | |
| xfs_lsn_t li_lsn; /* last on-disk lsn
*/ | | xfs_lsn_t li_lsn; /* last on-disk lsn
*/ | |
| struct xfs_log_item_desc *li_desc; /* ptr to current de
sc*/ | | struct xfs_log_item_desc *li_desc; /* ptr to current de
sc*/ | |
| struct xfs_mount *li_mountp; /* ptr to fs mount *
/ | | struct xfs_mount *li_mountp; /* ptr to fs mount *
/ | |
|
| | | struct xfs_ail *li_ailp; /* ptr to AIL */ | |
| uint li_type; /* item type */ | | uint li_type; /* item type */ | |
| uint li_flags; /* misc flags */ | | uint li_flags; /* misc flags */ | |
| struct xfs_log_item *li_bio_list; /* buffer item list
*/ | | struct xfs_log_item *li_bio_list; /* buffer item list
*/ | |
| void (*li_cb)(struct xfs_buf *, | | void (*li_cb)(struct xfs_buf *, | |
| struct xfs_log_item *); | | struct xfs_log_item *); | |
| /* buffer item iodon
e */ | | /* buffer item iodon
e */ | |
| /* callback func */ | | /* callback func */ | |
| struct xfs_item_ops *li_ops; /* function list */ | | struct xfs_item_ops *li_ops; /* function list */ | |
|
| | | | |
| | | /* delayed logging */ | |
| | | struct list_head li_cil; /* CIL pointers */ | |
| | | struct xfs_log_vec *li_lv; /* active log vector | |
| | | */ | |
| | | xfs_lsn_t li_seq; /* CIL commit seq */ | |
| } xfs_log_item_t; | | } xfs_log_item_t; | |
| | | | |
| #define XFS_LI_IN_AIL 0x1 | | #define XFS_LI_IN_AIL 0x1 | |
| #define XFS_LI_ABORTED 0x2 | | #define XFS_LI_ABORTED 0x2 | |
| | | | |
|
| | | #define XFS_LI_FLAGS \ | |
| | | { XFS_LI_IN_AIL, "IN_AIL" }, \ | |
| | | { XFS_LI_ABORTED, "ABORTED" } | |
| | | | |
| typedef struct xfs_item_ops { | | typedef struct xfs_item_ops { | |
| uint (*iop_size)(xfs_log_item_t *); | | uint (*iop_size)(xfs_log_item_t *); | |
| void (*iop_format)(xfs_log_item_t *, struct xfs_log_iovec *); | | void (*iop_format)(xfs_log_item_t *, struct xfs_log_iovec *); | |
| void (*iop_pin)(xfs_log_item_t *); | | void (*iop_pin)(xfs_log_item_t *); | |
|
| void (*iop_unpin)(xfs_log_item_t *, int); | | void (*iop_unpin)(xfs_log_item_t *, int remove); | |
| void (*iop_unpin_remove)(xfs_log_item_t *, struct xfs_trans *); | | | |
| uint (*iop_trylock)(xfs_log_item_t *); | | uint (*iop_trylock)(xfs_log_item_t *); | |
| void (*iop_unlock)(xfs_log_item_t *); | | void (*iop_unlock)(xfs_log_item_t *); | |
| xfs_lsn_t (*iop_committed)(xfs_log_item_t *, xfs_lsn_t); | | xfs_lsn_t (*iop_committed)(xfs_log_item_t *, xfs_lsn_t); | |
| void (*iop_push)(xfs_log_item_t *); | | void (*iop_push)(xfs_log_item_t *); | |
| void (*iop_pushbuf)(xfs_log_item_t *); | | void (*iop_pushbuf)(xfs_log_item_t *); | |
| void (*iop_committing)(xfs_log_item_t *, xfs_lsn_t); | | void (*iop_committing)(xfs_log_item_t *, xfs_lsn_t); | |
| } xfs_item_ops_t; | | } xfs_item_ops_t; | |
| | | | |
| #define IOP_SIZE(ip) (*(ip)->li_ops->iop_size)(ip) | | #define IOP_SIZE(ip) (*(ip)->li_ops->iop_size)(ip) | |
| #define IOP_FORMAT(ip,vp) (*(ip)->li_ops->iop_format)(ip, vp) | | #define IOP_FORMAT(ip,vp) (*(ip)->li_ops->iop_format)(ip, vp) | |
| #define IOP_PIN(ip) (*(ip)->li_ops->iop_pin)(ip) | | #define IOP_PIN(ip) (*(ip)->li_ops->iop_pin)(ip) | |
|
| #define IOP_UNPIN(ip, flags) (*(ip)->li_ops->iop_unpin)(ip, flags) | | #define IOP_UNPIN(ip, remove) (*(ip)->li_ops->iop_unpin)(ip, remove) | |
| #define IOP_UNPIN_REMOVE(ip,tp) (*(ip)->li_ops->iop_unpin_remove)(ip, tp) | | | |
| #define IOP_TRYLOCK(ip) (*(ip)->li_ops->iop_trylock)(ip) | | #define IOP_TRYLOCK(ip) (*(ip)->li_ops->iop_trylock)(ip) | |
| #define IOP_UNLOCK(ip) (*(ip)->li_ops->iop_unlock)(ip) | | #define IOP_UNLOCK(ip) (*(ip)->li_ops->iop_unlock)(ip) | |
| #define IOP_COMMITTED(ip, lsn) (*(ip)->li_ops->iop_committed)(ip, lsn) | | #define IOP_COMMITTED(ip, lsn) (*(ip)->li_ops->iop_committed)(ip, lsn) | |
| #define IOP_PUSH(ip) (*(ip)->li_ops->iop_push)(ip) | | #define IOP_PUSH(ip) (*(ip)->li_ops->iop_push)(ip) | |
| #define IOP_PUSHBUF(ip) (*(ip)->li_ops->iop_pushbuf)(ip) | | #define IOP_PUSHBUF(ip) (*(ip)->li_ops->iop_pushbuf)(ip) | |
| #define IOP_COMMITTING(ip, lsn) (*(ip)->li_ops->iop_committing)(ip, lsn) | | #define IOP_COMMITTING(ip, lsn) (*(ip)->li_ops->iop_committing)(ip, lsn) | |
| | | | |
| /* | | /* | |
| * Return values for the IOP_TRYLOCK() routines. | | * Return values for the IOP_TRYLOCK() routines. | |
| */ | | */ | |
| #define XFS_ITEM_SUCCESS 0 | | #define XFS_ITEM_SUCCESS 0 | |
| #define XFS_ITEM_PINNED 1 | | #define XFS_ITEM_PINNED 1 | |
| #define XFS_ITEM_LOCKED 2 | | #define XFS_ITEM_LOCKED 2 | |
|
| #define XFS_ITEM_FLUSHING 3 | | #define XFS_ITEM_PUSHBUF 3 | |
| #define XFS_ITEM_PUSHBUF 4 | | | |
| | | | |
| /* | | | |
| * This structure is used to maintain a list of block ranges that have been | | | |
| * freed in the transaction. The ranges are listed in the perag[] busy lis | | | |
| t | | | |
| * between when they're freed and the transaction is committed to disk. | | | |
| */ | | | |
| | | | |
| typedef struct xfs_log_busy_slot { | | | |
| xfs_agnumber_t lbc_ag; | | | |
| ushort lbc_idx; /* index in perag.busy[] */ | | | |
| } xfs_log_busy_slot_t; | | | |
| | | | |
| #define XFS_LBC_NUM_SLOTS 31 | | | |
| typedef struct xfs_log_busy_chunk { | | | |
| struct xfs_log_busy_chunk *lbc_next; | | | |
| uint lbc_free; /* free slots bitmas | | | |
| k */ | | | |
| ushort lbc_unused; /* first unused */ | | | |
| xfs_log_busy_slot_t lbc_busy[XFS_LBC_NUM_SLOTS]; | | | |
| } xfs_log_busy_chunk_t; | | | |
| | | | |
| #define XFS_LBC_MAX_SLOT (XFS_LBC_NUM_SLOTS - 1) | | | |
| #define XFS_LBC_FREEMASK ((1U << XFS_LBC_NUM_SLOTS) - 1) | | | |
| | | | |
| #define XFS_LBC_INIT(cp) ((cp)->lbc_free = XFS_LBC_FREEMASK) | | | |
| #define XFS_LBC_CLAIM(cp, slot) ((cp)->lbc_free &= ~(1 << (slot))) | | | |
| #define XFS_LBC_SLOT(cp, slot) (&((cp)->lbc_busy[(slot)])) | | | |
| #define XFS_LBC_VACANCY(cp) (((cp)->lbc_free) & XFS_LBC_FREEMASK | | | |
| ) | | | |
| #define XFS_LBC_ISFREE(cp, slot) ((cp)->lbc_free & (1 << (slot))) | | | |
| | | | |
| /* | | /* | |
| * This is the type of function which can be given to xfs_trans_callback() | | * This is the type of function which can be given to xfs_trans_callback() | |
| * to be called upon the transaction's commit to disk. | | * to be called upon the transaction's commit to disk. | |
| */ | | */ | |
| typedef void (*xfs_trans_callback_t)(struct xfs_trans *, void *); | | typedef void (*xfs_trans_callback_t)(struct xfs_trans *, void *); | |
| | | | |
| /* | | /* | |
| * This is the structure maintained for every active transaction. | | * This is the structure maintained for every active transaction. | |
| */ | | */ | |
| typedef struct xfs_trans { | | typedef struct xfs_trans { | |
| unsigned int t_magic; /* magic number */ | | unsigned int t_magic; /* magic number */ | |
| xfs_log_callback_t t_logcb; /* log callback struct */ | | xfs_log_callback_t t_logcb; /* log callback struct */ | |
| unsigned int t_type; /* transaction type */ | | unsigned int t_type; /* transaction type */ | |
| unsigned int t_log_res; /* amt of log space resvd */ | | unsigned int t_log_res; /* amt of log space resvd */ | |
| unsigned int t_log_count; /* count for perm log res */ | | unsigned int t_log_count; /* count for perm log res */ | |
| unsigned int t_blk_res; /* # of blocks resvd */ | | unsigned int t_blk_res; /* # of blocks resvd */ | |
| unsigned int t_blk_res_used; /* # of resvd blocks used */ | | unsigned int t_blk_res_used; /* # of resvd blocks used */ | |
| unsigned int t_rtx_res; /* # of rt extents resvd */ | | unsigned int t_rtx_res; /* # of rt extents resvd */ | |
| unsigned int t_rtx_res_used; /* # of resvd rt extents use
d */ | | unsigned int t_rtx_res_used; /* # of resvd rt extents use
d */ | |
|
| xfs_log_ticket_t t_ticket; /* log mgr ticket */ | | struct xlog_ticket *t_ticket; /* log mgr ticket */ | |
| xfs_lsn_t t_lsn; /* log seq num of start of | | xfs_lsn_t t_lsn; /* log seq num of start of | |
| * transaction. */ | | * transaction. */ | |
| xfs_lsn_t t_commit_lsn; /* log seq num of end of | | xfs_lsn_t t_commit_lsn; /* log seq num of end of | |
| * transaction. */ | | * transaction. */ | |
| struct xfs_mount *t_mountp; /* ptr to fs mount struct */ | | struct xfs_mount *t_mountp; /* ptr to fs mount struct */ | |
| struct xfs_dquot_acct *t_dqinfo; /* acctg info for dquots */ | | struct xfs_dquot_acct *t_dqinfo; /* acctg info for dquots */ | |
|
| xfs_trans_callback_t t_callback; /* transaction callback */ | | | |
| void *t_callarg; /* callback arg */ | | | |
| unsigned int t_flags; /* misc flags */ | | unsigned int t_flags; /* misc flags */ | |
| int64_t t_icount_delta; /* superblock icount change
*/ | | int64_t t_icount_delta; /* superblock icount change
*/ | |
| int64_t t_ifree_delta; /* superblock ifree change *
/ | | int64_t t_ifree_delta; /* superblock ifree change *
/ | |
| int64_t t_fdblocks_delta; /* superblock fdblocks chg
*/ | | int64_t t_fdblocks_delta; /* superblock fdblocks chg
*/ | |
| int64_t t_res_fdblocks_delta; /* on-disk only chg */ | | int64_t t_res_fdblocks_delta; /* on-disk only chg */ | |
| int64_t t_frextents_delta;/* superblock freextents c
hg*/ | | int64_t t_frextents_delta;/* superblock freextents c
hg*/ | |
| int64_t t_res_frextents_delta; /* on-disk only chg *
/ | | int64_t t_res_frextents_delta; /* on-disk only chg *
/ | |
| #ifdef DEBUG | | #ifdef DEBUG | |
| int64_t t_ag_freeblks_delta; /* debugging counter */ | | int64_t t_ag_freeblks_delta; /* debugging counter */ | |
| int64_t t_ag_flist_delta; /* debugging counter */ | | int64_t t_ag_flist_delta; /* debugging counter */ | |
| int64_t t_ag_btree_delta; /* debugging counter */ | | int64_t t_ag_btree_delta; /* debugging counter */ | |
| #endif | | #endif | |
| int64_t t_dblocks_delta;/* superblock dblocks change
*/ | | int64_t t_dblocks_delta;/* superblock dblocks change
*/ | |
| int64_t t_agcount_delta;/* superblock agcount change
*/ | | int64_t t_agcount_delta;/* superblock agcount change
*/ | |
| int64_t t_imaxpct_delta;/* superblock imaxpct change
*/ | | int64_t t_imaxpct_delta;/* superblock imaxpct change
*/ | |
| int64_t t_rextsize_delta;/* superblock rextsize chg
*/ | | int64_t t_rextsize_delta;/* superblock rextsize chg
*/ | |
| int64_t t_rbmblocks_delta;/* superblock rbmblocks ch
g */ | | int64_t t_rbmblocks_delta;/* superblock rbmblocks ch
g */ | |
| int64_t t_rblocks_delta;/* superblock rblocks change
*/ | | int64_t t_rblocks_delta;/* superblock rblocks change
*/ | |
| int64_t t_rextents_delta;/* superblocks rextents chg
*/ | | int64_t t_rextents_delta;/* superblocks rextents chg
*/ | |
| int64_t t_rextslog_delta;/* superblocks rextslog chg
*/ | | int64_t t_rextslog_delta;/* superblocks rextslog chg
*/ | |
|
| unsigned int t_items_free; /* log item descs free */ | | struct list_head t_items; /* log item descriptors */ | |
| xfs_log_item_chunk_t t_items; /* first log item desc chunk | | | |
| */ | | | |
| xfs_trans_header_t t_header; /* header for in-log trans *
/ | | xfs_trans_header_t t_header; /* header for in-log trans *
/ | |
|
| unsigned int t_busy_free; /* busy descs free */ | | struct list_head t_busy; /* list of busy extents */ | |
| xfs_log_busy_chunk_t t_busy; /* busy/async free blocks */ | | | |
| unsigned long t_pflags; /* saved process flags state
*/ | | unsigned long t_pflags; /* saved process flags state
*/ | |
| } xfs_trans_t; | | } xfs_trans_t; | |
| | | | |
| /* | | /* | |
| * XFS transaction mechanism exported interfaces that are | | * XFS transaction mechanism exported interfaces that are | |
| * actually macros. | | * actually macros. | |
| */ | | */ | |
| #define xfs_trans_get_log_res(tp) ((tp)->t_log_res) | | #define xfs_trans_get_log_res(tp) ((tp)->t_log_res) | |
| #define xfs_trans_get_log_count(tp) ((tp)->t_log_count) | | #define xfs_trans_get_log_count(tp) ((tp)->t_log_count) | |
| #define xfs_trans_get_block_res(tp) ((tp)->t_blk_res) | | #define xfs_trans_get_block_res(tp) ((tp)->t_blk_res) | |
| | | | |
| skipping to change at line 922 | | skipping to change at line 448 | |
| #else | | #else | |
| #define xfs_trans_agblocks_delta(tp, d) | | #define xfs_trans_agblocks_delta(tp, d) | |
| #define xfs_trans_agflist_delta(tp, d) | | #define xfs_trans_agflist_delta(tp, d) | |
| #define xfs_trans_agbtree_delta(tp, d) | | #define xfs_trans_agbtree_delta(tp, d) | |
| #endif | | #endif | |
| | | | |
| /* | | /* | |
| * XFS transaction mechanism exported interfaces. | | * XFS transaction mechanism exported interfaces. | |
| */ | | */ | |
| xfs_trans_t *xfs_trans_alloc(struct xfs_mount *, uint); | | xfs_trans_t *xfs_trans_alloc(struct xfs_mount *, uint); | |
|
| xfs_trans_t *_xfs_trans_alloc(struct xfs_mount *, uint); | | xfs_trans_t *_xfs_trans_alloc(struct xfs_mount *, uint, uint); | |
| xfs_trans_t *xfs_trans_dup(xfs_trans_t *); | | xfs_trans_t *xfs_trans_dup(xfs_trans_t *); | |
| int xfs_trans_reserve(xfs_trans_t *, uint, uint, uint, | | int xfs_trans_reserve(xfs_trans_t *, uint, uint, uint, | |
| uint, uint); | | uint, uint); | |
| void xfs_trans_mod_sb(xfs_trans_t *, uint, int64_t); | | void xfs_trans_mod_sb(xfs_trans_t *, uint, int64_t); | |
| struct xfs_buf *xfs_trans_get_buf(xfs_trans_t *, struct xfs_buftarg *, xfs_
daddr_t, | | struct xfs_buf *xfs_trans_get_buf(xfs_trans_t *, struct xfs_buftarg *, xfs_
daddr_t, | |
| int, uint); | | int, uint); | |
| int xfs_trans_read_buf(struct xfs_mount *, xfs_trans_t *, | | int xfs_trans_read_buf(struct xfs_mount *, xfs_trans_t *, | |
| struct xfs_buftarg *, xfs_daddr_t, int, u
int, | | struct xfs_buftarg *, xfs_daddr_t, int, u
int, | |
| struct xfs_buf **); | | struct xfs_buf **); | |
| struct xfs_buf *xfs_trans_getsb(xfs_trans_t *, struct xfs_mount *, int); | | struct xfs_buf *xfs_trans_getsb(xfs_trans_t *, struct xfs_mount *, int); | |
| | | | |
| skipping to change at line 945 | | skipping to change at line 471 | |
| void xfs_trans_bjoin(xfs_trans_t *, struct xfs_buf *); | | void xfs_trans_bjoin(xfs_trans_t *, struct xfs_buf *); | |
| void xfs_trans_bhold(xfs_trans_t *, struct xfs_buf *); | | void xfs_trans_bhold(xfs_trans_t *, struct xfs_buf *); | |
| void xfs_trans_bhold_release(xfs_trans_t *, struct xfs_buf *); | | void xfs_trans_bhold_release(xfs_trans_t *, struct xfs_buf *); | |
| void xfs_trans_binval(xfs_trans_t *, struct xfs_buf *); | | void xfs_trans_binval(xfs_trans_t *, struct xfs_buf *); | |
| void xfs_trans_inode_buf(xfs_trans_t *, struct xfs_buf *); | | void xfs_trans_inode_buf(xfs_trans_t *, struct xfs_buf *); | |
| void xfs_trans_stale_inode_buf(xfs_trans_t *, struct xfs_buf *); | | void xfs_trans_stale_inode_buf(xfs_trans_t *, struct xfs_buf *); | |
| void xfs_trans_dquot_buf(xfs_trans_t *, struct xfs_buf *, uint); | | void xfs_trans_dquot_buf(xfs_trans_t *, struct xfs_buf *, uint); | |
| void xfs_trans_inode_alloc_buf(xfs_trans_t *, struct xfs_buf *); | | void xfs_trans_inode_alloc_buf(xfs_trans_t *, struct xfs_buf *); | |
| int xfs_trans_iget(struct xfs_mount *, xfs_trans_t *, | | int xfs_trans_iget(struct xfs_mount *, xfs_trans_t *, | |
| xfs_ino_t , uint, uint, struct xfs_inode **); | | xfs_ino_t , uint, uint, struct xfs_inode **); | |
|
| void xfs_trans_ijoin(xfs_trans_t *, struct xfs_inode *, uint); | | void xfs_trans_ichgtime(struct xfs_trans *, struct xfs_inode *, i | |
| void xfs_trans_ihold(xfs_trans_t *, struct xfs_inode *); | | nt); | |
| | | void xfs_trans_ijoin_ref(struct xfs_trans *, struct xfs_inode *, | |
| | | uint); | |
| | | void xfs_trans_ijoin(struct xfs_trans *, struct xfs_inode *); | |
| void xfs_trans_log_buf(xfs_trans_t *, struct xfs_buf *, uint, uin
t); | | void xfs_trans_log_buf(xfs_trans_t *, struct xfs_buf *, uint, uin
t); | |
| void xfs_trans_log_inode(xfs_trans_t *, struct xfs_inode *, uint)
; | | void xfs_trans_log_inode(xfs_trans_t *, struct xfs_inode *, uint)
; | |
| struct xfs_efi_log_item *xfs_trans_get_efi(xfs_trans_t *, uint); | | struct xfs_efi_log_item *xfs_trans_get_efi(xfs_trans_t *, uint); | |
| void xfs_efi_release(struct xfs_efi_log_item *, uint); | | void xfs_efi_release(struct xfs_efi_log_item *, uint); | |
| void xfs_trans_log_efi_extent(xfs_trans_t *, | | void xfs_trans_log_efi_extent(xfs_trans_t *, | |
| struct xfs_efi_log_item *, | | struct xfs_efi_log_item *, | |
| xfs_fsblock_t, | | xfs_fsblock_t, | |
| xfs_extlen_t); | | xfs_extlen_t); | |
| struct xfs_efd_log_item *xfs_trans_get_efd(xfs_trans_t *, | | struct xfs_efd_log_item *xfs_trans_get_efd(xfs_trans_t *, | |
| struct xfs_efi_log_item *, | | struct xfs_efi_log_item *, | |
| | | | |
| skipping to change at line 969 | | skipping to change at line 496 | |
| struct xfs_efd_log_item *, | | struct xfs_efd_log_item *, | |
| xfs_fsblock_t, | | xfs_fsblock_t, | |
| xfs_extlen_t); | | xfs_extlen_t); | |
| int _xfs_trans_commit(xfs_trans_t *, | | int _xfs_trans_commit(xfs_trans_t *, | |
| uint flags, | | uint flags, | |
| int *); | | int *); | |
| #define xfs_trans_commit(tp, flags) _xfs_trans_commit(tp, flags, NULL) | | #define xfs_trans_commit(tp, flags) _xfs_trans_commit(tp, flags, NULL) | |
| void xfs_trans_cancel(xfs_trans_t *, int); | | void xfs_trans_cancel(xfs_trans_t *, int); | |
| int xfs_trans_ail_init(struct xfs_mount *); | | int xfs_trans_ail_init(struct xfs_mount *); | |
| void xfs_trans_ail_destroy(struct xfs_mount *); | | void xfs_trans_ail_destroy(struct xfs_mount *); | |
|
| void xfs_trans_push_ail(struct xfs_mount *, xfs_lsn_t); | | | |
| xfs_lsn_t xfs_trans_tail_ail(struct xfs_mount *); | | | |
| void xfs_trans_unlocked_item(struct xfs_mount *, | | | |
| xfs_log_item_t *); | | | |
| xfs_log_busy_slot_t *xfs_trans_add_busy(xfs_trans_t *tp, | | | |
| xfs_agnumber_t ag, | | | |
| xfs_extlen_t idx); | | | |
| | | | |
| extern kmem_zone_t *xfs_trans_zone; | | extern kmem_zone_t *xfs_trans_zone; | |
|
| | | extern kmem_zone_t *xfs_log_item_desc_zone; | |
| | | | |
| #endif /* __KERNEL__ */ | | #endif /* __KERNEL__ */ | |
| | | | |
| void xfs_trans_init(struct xfs_mount *); | | void xfs_trans_init(struct xfs_mount *); | |
| int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *); | | int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *); | |
| | | | |
| #endif /* __XFS_TRANS_H__ */ | | #endif /* __XFS_TRANS_H__ */ | |
| | | | |
End of changes. 48 change blocks. |
| 583 lines changed or deleted | | 87 lines changed or added | |
|