aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_inode.h')
-rw-r--r--fs/xfs/xfs_inode.h98
1 files changed, 40 insertions, 58 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index e5aff929cc65..bfcd72cbaeea 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -132,45 +132,6 @@ typedef struct dm_attrs_s {
132 __uint16_t da_pad; /* DMIG extra padding */ 132 __uint16_t da_pad; /* DMIG extra padding */
133} dm_attrs_t; 133} dm_attrs_t;
134 134
135typedef struct xfs_iocore {
136 void *io_obj; /* pointer to container
137 * inode or dcxvn structure */
138 struct xfs_mount *io_mount; /* fs mount struct ptr */
139#ifdef DEBUG
140 mrlock_t *io_lock; /* inode IO lock */
141 mrlock_t *io_iolock; /* inode IO lock */
142#endif
143
144 /* I/O state */
145 xfs_fsize_t io_new_size; /* sz when write completes */
146
147 /* Miscellaneous state. */
148 unsigned int io_flags; /* IO related flags */
149
150 /* DMAPI state */
151 dm_attrs_t io_dmattrs;
152
153} xfs_iocore_t;
154
155#define io_dmevmask io_dmattrs.da_dmevmask
156#define io_dmstate io_dmattrs.da_dmstate
157
158#define XFS_IO_INODE(io) ((xfs_inode_t *) ((io)->io_obj))
159#define XFS_IO_DCXVN(io) ((dcxvn_t *) ((io)->io_obj))
160
161/*
162 * Flags in the flags field
163 */
164
165#define XFS_IOCORE_RT 0x1
166
167/*
168 * xfs_iocore prototypes
169 */
170
171extern void xfs_iocore_inode_init(struct xfs_inode *);
172extern void xfs_iocore_inode_reinit(struct xfs_inode *);
173
174/* 135/*
175 * This is the xfs inode cluster structure. This structure is used by 136 * This is the xfs inode cluster structure. This structure is used by
176 * xfs_iflush to find inodes that share a cluster and can be flushed to disk at 137 * xfs_iflush to find inodes that share a cluster and can be flushed to disk at
@@ -181,7 +142,7 @@ typedef struct xfs_icluster {
181 xfs_daddr_t icl_blkno; /* starting block number of 142 xfs_daddr_t icl_blkno; /* starting block number of
182 * the cluster */ 143 * the cluster */
183 struct xfs_buf *icl_buf; /* the inode buffer */ 144 struct xfs_buf *icl_buf; /* the inode buffer */
184 lock_t icl_lock; /* inode list lock */ 145 spinlock_t icl_lock; /* inode list lock */
185} xfs_icluster_t; 146} xfs_icluster_t;
186 147
187/* 148/*
@@ -283,9 +244,6 @@ typedef struct xfs_inode {
283 struct xfs_inode **i_refcache; /* ptr to entry in ref cache */ 244 struct xfs_inode **i_refcache; /* ptr to entry in ref cache */
284 struct xfs_inode *i_release; /* inode to unref */ 245 struct xfs_inode *i_release; /* inode to unref */
285#endif 246#endif
286 /* I/O state */
287 xfs_iocore_t i_iocore; /* I/O core */
288
289 /* Miscellaneous state. */ 247 /* Miscellaneous state. */
290 unsigned short i_flags; /* see defined flags below */ 248 unsigned short i_flags; /* see defined flags below */
291 unsigned char i_update_core; /* timestamps/size is dirty */ 249 unsigned char i_update_core; /* timestamps/size is dirty */
@@ -298,9 +256,10 @@ typedef struct xfs_inode {
298 struct hlist_node i_cnode; /* cluster link node */ 256 struct hlist_node i_cnode; /* cluster link node */
299 257
300 xfs_fsize_t i_size; /* in-memory size */ 258 xfs_fsize_t i_size; /* in-memory size */
259 xfs_fsize_t i_new_size; /* size when write completes */
301 atomic_t i_iocount; /* outstanding I/O count */ 260 atomic_t i_iocount; /* outstanding I/O count */
302 /* Trace buffers per inode. */ 261 /* Trace buffers per inode. */
303#ifdef XFS_VNODE_TRACE 262#ifdef XFS_INODE_TRACE
304 struct ktrace *i_trace; /* general inode trace */ 263 struct ktrace *i_trace; /* general inode trace */
305#endif 264#endif
306#ifdef XFS_BMAP_TRACE 265#ifdef XFS_BMAP_TRACE
@@ -382,17 +341,42 @@ xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags)
382/* 341/*
383 * Fork handling. 342 * Fork handling.
384 */ 343 */
385#define XFS_IFORK_PTR(ip,w) \
386 ((w) == XFS_DATA_FORK ? &(ip)->i_df : (ip)->i_afp)
387#define XFS_IFORK_Q(ip) XFS_CFORK_Q(&(ip)->i_d)
388#define XFS_IFORK_DSIZE(ip) XFS_CFORK_DSIZE(&ip->i_d, ip->i_mount)
389#define XFS_IFORK_ASIZE(ip) XFS_CFORK_ASIZE(&ip->i_d, ip->i_mount)
390#define XFS_IFORK_SIZE(ip,w) XFS_CFORK_SIZE(&ip->i_d, ip->i_mount, w)
391#define XFS_IFORK_FORMAT(ip,w) XFS_CFORK_FORMAT(&ip->i_d, w)
392#define XFS_IFORK_FMT_SET(ip,w,n) XFS_CFORK_FMT_SET(&ip->i_d, w, n)
393#define XFS_IFORK_NEXTENTS(ip,w) XFS_CFORK_NEXTENTS(&ip->i_d, w)
394#define XFS_IFORK_NEXT_SET(ip,w,n) XFS_CFORK_NEXT_SET(&ip->i_d, w, n)
395 344
345#define XFS_IFORK_Q(ip) ((ip)->i_d.di_forkoff != 0)
346#define XFS_IFORK_BOFF(ip) ((int)((ip)->i_d.di_forkoff << 3))
347
348#define XFS_IFORK_PTR(ip,w) \
349 ((w) == XFS_DATA_FORK ? \
350 &(ip)->i_df : \
351 (ip)->i_afp)
352#define XFS_IFORK_DSIZE(ip) \
353 (XFS_IFORK_Q(ip) ? \
354 XFS_IFORK_BOFF(ip) : \
355 XFS_LITINO((ip)->i_mount))
356#define XFS_IFORK_ASIZE(ip) \
357 (XFS_IFORK_Q(ip) ? \
358 XFS_LITINO((ip)->i_mount) - XFS_IFORK_BOFF(ip) : \
359 0)
360#define XFS_IFORK_SIZE(ip,w) \
361 ((w) == XFS_DATA_FORK ? \
362 XFS_IFORK_DSIZE(ip) : \
363 XFS_IFORK_ASIZE(ip))
364#define XFS_IFORK_FORMAT(ip,w) \
365 ((w) == XFS_DATA_FORK ? \
366 (ip)->i_d.di_format : \
367 (ip)->i_d.di_aformat)
368#define XFS_IFORK_FMT_SET(ip,w,n) \
369 ((w) == XFS_DATA_FORK ? \
370 ((ip)->i_d.di_format = (n)) : \
371 ((ip)->i_d.di_aformat = (n)))
372#define XFS_IFORK_NEXTENTS(ip,w) \
373 ((w) == XFS_DATA_FORK ? \
374 (ip)->i_d.di_nextents : \
375 (ip)->i_d.di_anextents)
376#define XFS_IFORK_NEXT_SET(ip,w,n) \
377 ((w) == XFS_DATA_FORK ? \
378 ((ip)->i_d.di_nextents = (n)) : \
379 ((ip)->i_d.di_anextents = (n)))
396 380
397#ifdef __KERNEL__ 381#ifdef __KERNEL__
398 382
@@ -509,7 +493,6 @@ void xfs_ihash_init(struct xfs_mount *);
509void xfs_ihash_free(struct xfs_mount *); 493void xfs_ihash_free(struct xfs_mount *);
510xfs_inode_t *xfs_inode_incore(struct xfs_mount *, xfs_ino_t, 494xfs_inode_t *xfs_inode_incore(struct xfs_mount *, xfs_ino_t,
511 struct xfs_trans *); 495 struct xfs_trans *);
512void xfs_inode_lock_init(xfs_inode_t *, bhv_vnode_t *);
513int xfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, 496int xfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
514 uint, uint, xfs_inode_t **, xfs_daddr_t); 497 uint, uint, xfs_inode_t **, xfs_daddr_t);
515void xfs_iput(xfs_inode_t *, uint); 498void xfs_iput(xfs_inode_t *, uint);
@@ -545,7 +528,7 @@ void xfs_dinode_to_disk(struct xfs_dinode_core *,
545 struct xfs_icdinode *); 528 struct xfs_icdinode *);
546 529
547uint xfs_ip2xflags(struct xfs_inode *); 530uint xfs_ip2xflags(struct xfs_inode *);
548uint xfs_dic2xflags(struct xfs_dinode_core *); 531uint xfs_dic2xflags(struct xfs_dinode *);
549int xfs_ifree(struct xfs_trans *, xfs_inode_t *, 532int xfs_ifree(struct xfs_trans *, xfs_inode_t *,
550 struct xfs_bmap_free *); 533 struct xfs_bmap_free *);
551int xfs_itruncate_start(xfs_inode_t *, uint, xfs_fsize_t); 534int xfs_itruncate_start(xfs_inode_t *, uint, xfs_fsize_t);
@@ -567,13 +550,12 @@ void xfs_iunpin(xfs_inode_t *);
567int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); 550int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int);
568int xfs_iflush(xfs_inode_t *, uint); 551int xfs_iflush(xfs_inode_t *, uint);
569void xfs_iflush_all(struct xfs_mount *); 552void xfs_iflush_all(struct xfs_mount *);
570int xfs_iaccess(xfs_inode_t *, mode_t, cred_t *);
571uint xfs_iroundup(uint);
572void xfs_ichgtime(xfs_inode_t *, int); 553void xfs_ichgtime(xfs_inode_t *, int);
573xfs_fsize_t xfs_file_last_byte(xfs_inode_t *); 554xfs_fsize_t xfs_file_last_byte(xfs_inode_t *);
574void xfs_lock_inodes(xfs_inode_t **, int, int, uint); 555void xfs_lock_inodes(xfs_inode_t **, int, int, uint);
575 556
576void xfs_synchronize_atime(xfs_inode_t *); 557void xfs_synchronize_atime(xfs_inode_t *);
558void xfs_mark_inode_dirty_sync(xfs_inode_t *);
577 559
578xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t); 560xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t);
579void xfs_iext_insert(xfs_ifork_t *, xfs_extnum_t, xfs_extnum_t, 561void xfs_iext_insert(xfs_ifork_t *, xfs_extnum_t, xfs_extnum_t,