aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode.h
diff options
context:
space:
mode:
authorBarry Naujok <bnaujok@sgi.com>2008-10-30 02:05:38 -0400
committerLachlan McIlroy <lachlan@sgi.com>2008-10-30 02:05:38 -0400
commit847fff5ca881670ca8ec617afeb943950f0c804b (patch)
treecd03cf7a3422842978332a22de51c91827821841 /fs/xfs/xfs_inode.h
parent24ee0e49c9cce23acb1758728cb09e8d2b53bd33 (diff)
[XFS] Sync up kernel and user-space headers
SGI-PV: 986558 SGI-Modid: xfs-linux-melb:xfs-kern:32231a Signed-off-by: Barry Naujok <bnaujok@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_inode.h')
-rw-r--r--fs/xfs/xfs_inode.h246
1 files changed, 123 insertions, 123 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 2a69a7dee228..a8f1e6833aa6 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -20,7 +20,7 @@
20 20
21struct xfs_dinode; 21struct xfs_dinode;
22struct xfs_dinode_core; 22struct xfs_dinode_core;
23 23struct xfs_inode;
24 24
25/* 25/*
26 * Fork identifiers. 26 * Fork identifiers.
@@ -84,54 +84,6 @@ typedef struct xfs_ifork {
84} xfs_ifork_t; 84} xfs_ifork_t;
85 85
86/* 86/*
87 * Flags for xfs_ichgtime().
88 */
89#define XFS_ICHGTIME_MOD 0x1 /* data fork modification timestamp */
90#define XFS_ICHGTIME_CHG 0x2 /* inode field change timestamp */
91
92/*
93 * Per-fork incore inode flags.
94 */
95#define XFS_IFINLINE 0x01 /* Inline data is read in */
96#define XFS_IFEXTENTS 0x02 /* All extent pointers are read in */
97#define XFS_IFBROOT 0x04 /* i_broot points to the bmap b-tree root */
98#define XFS_IFEXTIREC 0x08 /* Indirection array of extent blocks */
99
100/*
101 * Flags for xfs_itobp(), xfs_imap() and xfs_dilocate().
102 */
103#define XFS_IMAP_LOOKUP 0x1
104#define XFS_IMAP_BULKSTAT 0x2
105
106#ifdef __KERNEL__
107struct bhv_desc;
108struct cred;
109struct ktrace;
110struct xfs_buf;
111struct xfs_bmap_free;
112struct xfs_bmbt_irec;
113struct xfs_bmbt_block;
114struct xfs_inode;
115struct xfs_inode_log_item;
116struct xfs_mount;
117struct xfs_trans;
118struct xfs_dquot;
119
120#if defined(XFS_ILOCK_TRACE)
121#define XFS_ILOCK_KTRACE_SIZE 32
122extern ktrace_t *xfs_ilock_trace_buf;
123extern void xfs_ilock_trace(struct xfs_inode *, int, unsigned int, inst_t *);
124#else
125#define xfs_ilock_trace(i,n,f,ra)
126#endif
127
128typedef struct dm_attrs_s {
129 __uint32_t da_dmevmask; /* DMIG event mask */
130 __uint16_t da_dmstate; /* DMIG state info */
131 __uint16_t da_pad; /* DMIG extra padding */
132} dm_attrs_t;
133
134/*
135 * This is the xfs in-core inode structure. 87 * This is the xfs in-core inode structure.
136 * Most of the on-disk inode is embedded in the i_d field. 88 * Most of the on-disk inode is embedded in the i_d field.
137 * 89 *
@@ -191,6 +143,96 @@ typedef struct xfs_icdinode {
191 __uint32_t di_gen; /* generation number */ 143 __uint32_t di_gen; /* generation number */
192} xfs_icdinode_t; 144} xfs_icdinode_t;
193 145
146/*
147 * Flags for xfs_ichgtime().
148 */
149#define XFS_ICHGTIME_MOD 0x1 /* data fork modification timestamp */
150#define XFS_ICHGTIME_CHG 0x2 /* inode field change timestamp */
151
152/*
153 * Per-fork incore inode flags.
154 */
155#define XFS_IFINLINE 0x01 /* Inline data is read in */
156#define XFS_IFEXTENTS 0x02 /* All extent pointers are read in */
157#define XFS_IFBROOT 0x04 /* i_broot points to the bmap b-tree root */
158#define XFS_IFEXTIREC 0x08 /* Indirection array of extent blocks */
159
160/*
161 * Flags for xfs_itobp(), xfs_imap() and xfs_dilocate().
162 */
163#define XFS_IMAP_LOOKUP 0x1
164#define XFS_IMAP_BULKSTAT 0x2
165
166/*
167 * Fork handling.
168 */
169
170#define XFS_IFORK_Q(ip) ((ip)->i_d.di_forkoff != 0)
171#define XFS_IFORK_BOFF(ip) ((int)((ip)->i_d.di_forkoff << 3))
172
173#define XFS_IFORK_PTR(ip,w) \
174 ((w) == XFS_DATA_FORK ? \
175 &(ip)->i_df : \
176 (ip)->i_afp)
177#define XFS_IFORK_DSIZE(ip) \
178 (XFS_IFORK_Q(ip) ? \
179 XFS_IFORK_BOFF(ip) : \
180 XFS_LITINO((ip)->i_mount))
181#define XFS_IFORK_ASIZE(ip) \
182 (XFS_IFORK_Q(ip) ? \
183 XFS_LITINO((ip)->i_mount) - XFS_IFORK_BOFF(ip) : \
184 0)
185#define XFS_IFORK_SIZE(ip,w) \
186 ((w) == XFS_DATA_FORK ? \
187 XFS_IFORK_DSIZE(ip) : \
188 XFS_IFORK_ASIZE(ip))
189#define XFS_IFORK_FORMAT(ip,w) \
190 ((w) == XFS_DATA_FORK ? \
191 (ip)->i_d.di_format : \
192 (ip)->i_d.di_aformat)
193#define XFS_IFORK_FMT_SET(ip,w,n) \
194 ((w) == XFS_DATA_FORK ? \
195 ((ip)->i_d.di_format = (n)) : \
196 ((ip)->i_d.di_aformat = (n)))
197#define XFS_IFORK_NEXTENTS(ip,w) \
198 ((w) == XFS_DATA_FORK ? \
199 (ip)->i_d.di_nextents : \
200 (ip)->i_d.di_anextents)
201#define XFS_IFORK_NEXT_SET(ip,w,n) \
202 ((w) == XFS_DATA_FORK ? \
203 ((ip)->i_d.di_nextents = (n)) : \
204 ((ip)->i_d.di_anextents = (n)))
205
206
207
208#ifdef __KERNEL__
209
210struct bhv_desc;
211struct cred;
212struct ktrace;
213struct xfs_buf;
214struct xfs_bmap_free;
215struct xfs_bmbt_irec;
216struct xfs_bmbt_block;
217struct xfs_inode_log_item;
218struct xfs_mount;
219struct xfs_trans;
220struct xfs_dquot;
221
222#if defined(XFS_ILOCK_TRACE)
223#define XFS_ILOCK_KTRACE_SIZE 32
224extern ktrace_t *xfs_ilock_trace_buf;
225extern void xfs_ilock_trace(struct xfs_inode *, int, unsigned int, inst_t *);
226#else
227#define xfs_ilock_trace(i,n,f,ra)
228#endif
229
230typedef struct dm_attrs_s {
231 __uint32_t da_dmevmask; /* DMIG event mask */
232 __uint16_t da_dmstate; /* DMIG state info */
233 __uint16_t da_pad; /* DMIG extra padding */
234} dm_attrs_t;
235
194typedef struct { 236typedef struct {
195 struct xfs_inode *ip_mnext; /* next inode in mount list */ 237 struct xfs_inode *ip_mnext; /* next inode in mount list */
196 struct xfs_inode *ip_mprev; /* ptr to prev inode */ 238 struct xfs_inode *ip_mprev; /* ptr to prev inode */
@@ -327,50 +369,26 @@ xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags)
327 spin_unlock(&ip->i_flags_lock); 369 spin_unlock(&ip->i_flags_lock);
328 return ret; 370 return ret;
329} 371}
330#endif /* __KERNEL__ */
331
332 372
333/* 373/*
334 * Fork handling. 374 * Manage the i_flush queue embedded in the inode. This completion
375 * queue synchronizes processes attempting to flush the in-core
376 * inode back to disk.
335 */ 377 */
378static inline void xfs_iflock(xfs_inode_t *ip)
379{
380 wait_for_completion(&ip->i_flush);
381}
336 382
337#define XFS_IFORK_Q(ip) ((ip)->i_d.di_forkoff != 0) 383static inline int xfs_iflock_nowait(xfs_inode_t *ip)
338#define XFS_IFORK_BOFF(ip) ((int)((ip)->i_d.di_forkoff << 3)) 384{
339 385 return try_wait_for_completion(&ip->i_flush);
340#define XFS_IFORK_PTR(ip,w) \ 386}
341 ((w) == XFS_DATA_FORK ? \
342 &(ip)->i_df : \
343 (ip)->i_afp)
344#define XFS_IFORK_DSIZE(ip) \
345 (XFS_IFORK_Q(ip) ? \
346 XFS_IFORK_BOFF(ip) : \
347 XFS_LITINO((ip)->i_mount))
348#define XFS_IFORK_ASIZE(ip) \
349 (XFS_IFORK_Q(ip) ? \
350 XFS_LITINO((ip)->i_mount) - XFS_IFORK_BOFF(ip) : \
351 0)
352#define XFS_IFORK_SIZE(ip,w) \
353 ((w) == XFS_DATA_FORK ? \
354 XFS_IFORK_DSIZE(ip) : \
355 XFS_IFORK_ASIZE(ip))
356#define XFS_IFORK_FORMAT(ip,w) \
357 ((w) == XFS_DATA_FORK ? \
358 (ip)->i_d.di_format : \
359 (ip)->i_d.di_aformat)
360#define XFS_IFORK_FMT_SET(ip,w,n) \
361 ((w) == XFS_DATA_FORK ? \
362 ((ip)->i_d.di_format = (n)) : \
363 ((ip)->i_d.di_aformat = (n)))
364#define XFS_IFORK_NEXTENTS(ip,w) \
365 ((w) == XFS_DATA_FORK ? \
366 (ip)->i_d.di_nextents : \
367 (ip)->i_d.di_anextents)
368#define XFS_IFORK_NEXT_SET(ip,w,n) \
369 ((w) == XFS_DATA_FORK ? \
370 ((ip)->i_d.di_nextents = (n)) : \
371 ((ip)->i_d.di_anextents = (n)))
372 387
373#ifdef __KERNEL__ 388static inline void xfs_ifunlock(xfs_inode_t *ip)
389{
390 complete(&ip->i_flush);
391}
374 392
375/* 393/*
376 * In-core inode flags. 394 * In-core inode flags.
@@ -490,19 +508,11 @@ int xfs_finish_reclaim_all(struct xfs_mount *, int);
490/* 508/*
491 * xfs_inode.c prototypes. 509 * xfs_inode.c prototypes.
492 */ 510 */
493int xfs_itobp(struct xfs_mount *, struct xfs_trans *,
494 xfs_inode_t *, struct xfs_dinode **, struct xfs_buf **,
495 xfs_daddr_t, uint, uint);
496int xfs_iread(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, 511int xfs_iread(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
497 xfs_inode_t **, xfs_daddr_t, uint); 512 xfs_inode_t **, xfs_daddr_t, uint);
498int xfs_iread_extents(struct xfs_trans *, xfs_inode_t *, int);
499int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, 513int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t,
500 xfs_nlink_t, xfs_dev_t, struct cred *, xfs_prid_t, 514 xfs_nlink_t, xfs_dev_t, struct cred *, xfs_prid_t,
501 int, struct xfs_buf **, boolean_t *, xfs_inode_t **); 515 int, struct xfs_buf **, boolean_t *, xfs_inode_t **);
502void xfs_dinode_from_disk(struct xfs_icdinode *,
503 struct xfs_dinode_core *);
504void xfs_dinode_to_disk(struct xfs_dinode_core *,
505 struct xfs_icdinode *);
506 516
507uint xfs_ip2xflags(struct xfs_inode *); 517uint xfs_ip2xflags(struct xfs_inode *);
508uint xfs_dic2xflags(struct xfs_dinode *); 518uint xfs_dic2xflags(struct xfs_dinode *);
@@ -514,15 +524,11 @@ int xfs_itruncate_finish(struct xfs_trans **, xfs_inode_t *,
514int xfs_iunlink(struct xfs_trans *, xfs_inode_t *); 524int xfs_iunlink(struct xfs_trans *, xfs_inode_t *);
515 525
516struct xfs_inode * xfs_inode_alloc(struct xfs_mount *, xfs_ino_t); 526struct xfs_inode * xfs_inode_alloc(struct xfs_mount *, xfs_ino_t);
517void xfs_idestroy_fork(xfs_inode_t *, int);
518void xfs_idestroy(xfs_inode_t *); 527void xfs_idestroy(xfs_inode_t *);
519void xfs_idata_realloc(xfs_inode_t *, int, int);
520void xfs_iextract(xfs_inode_t *); 528void xfs_iextract(xfs_inode_t *);
521void xfs_iext_realloc(xfs_inode_t *, int, int); 529void xfs_iext_realloc(xfs_inode_t *, int, int);
522void xfs_iroot_realloc(xfs_inode_t *, int, int);
523void xfs_ipin(xfs_inode_t *); 530void xfs_ipin(xfs_inode_t *);
524void xfs_iunpin(xfs_inode_t *); 531void xfs_iunpin(xfs_inode_t *);
525int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int);
526int xfs_iflush(xfs_inode_t *, uint); 532int xfs_iflush(xfs_inode_t *, uint);
527void xfs_iflush_all(struct xfs_mount *); 533void xfs_iflush_all(struct xfs_mount *);
528void xfs_ichgtime(xfs_inode_t *, int); 534void xfs_ichgtime(xfs_inode_t *, int);
@@ -533,6 +539,21 @@ void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint);
533void xfs_synchronize_atime(xfs_inode_t *); 539void xfs_synchronize_atime(xfs_inode_t *);
534void xfs_mark_inode_dirty_sync(xfs_inode_t *); 540void xfs_mark_inode_dirty_sync(xfs_inode_t *);
535 541
542#endif /* __KERNEL__ */
543
544int xfs_itobp(struct xfs_mount *, struct xfs_trans *,
545 struct xfs_inode *, struct xfs_dinode **,
546 struct xfs_buf **, xfs_daddr_t, uint, uint);
547void xfs_dinode_from_disk(struct xfs_icdinode *,
548 struct xfs_dinode_core *);
549void xfs_dinode_to_disk(struct xfs_dinode_core *,
550 struct xfs_icdinode *);
551void xfs_idestroy_fork(struct xfs_inode *, int);
552void xfs_idata_realloc(struct xfs_inode *, int, int);
553void xfs_iroot_realloc(struct xfs_inode *, int, int);
554int xfs_iread_extents(struct xfs_trans *, struct xfs_inode *, int);
555int xfs_iextents_copy(struct xfs_inode *, xfs_bmbt_rec_t *, int);
556
536xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t); 557xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t);
537void xfs_iext_insert(xfs_ifork_t *, xfs_extnum_t, xfs_extnum_t, 558void xfs_iext_insert(xfs_ifork_t *, xfs_extnum_t, xfs_extnum_t,
538 xfs_bmbt_irec_t *); 559 xfs_bmbt_irec_t *);
@@ -562,7 +583,8 @@ void xfs_iext_irec_update_extoffs(xfs_ifork_t *, int, int);
562#define xfs_ipincount(ip) ((unsigned int) atomic_read(&ip->i_pincount)) 583#define xfs_ipincount(ip) ((unsigned int) atomic_read(&ip->i_pincount))
563 584
564#ifdef DEBUG 585#ifdef DEBUG
565void xfs_isize_check(struct xfs_mount *, xfs_inode_t *, xfs_fsize_t); 586void xfs_isize_check(struct xfs_mount *, struct xfs_inode *,
587 xfs_fsize_t);
566#else /* DEBUG */ 588#else /* DEBUG */
567#define xfs_isize_check(mp, ip, isize) 589#define xfs_isize_check(mp, ip, isize)
568#endif /* DEBUG */ 590#endif /* DEBUG */
@@ -577,26 +599,4 @@ extern struct kmem_zone *xfs_ifork_zone;
577extern struct kmem_zone *xfs_inode_zone; 599extern struct kmem_zone *xfs_inode_zone;
578extern struct kmem_zone *xfs_ili_zone; 600extern struct kmem_zone *xfs_ili_zone;
579 601
580/*
581 * Manage the i_flush queue embedded in the inode. This completion
582 * queue synchronizes processes attempting to flush the in-core
583 * inode back to disk.
584 */
585static inline void xfs_iflock(xfs_inode_t *ip)
586{
587 wait_for_completion(&ip->i_flush);
588}
589
590static inline int xfs_iflock_nowait(xfs_inode_t *ip)
591{
592 return try_wait_for_completion(&ip->i_flush);
593}
594
595static inline void xfs_ifunlock(xfs_inode_t *ip)
596{
597 complete(&ip->i_flush);
598}
599
600#endif /* __KERNEL__ */
601
602#endif /* __XFS_INODE_H__ */ 602#endif /* __XFS_INODE_H__ */