diff options
author | Barry Naujok <bnaujok@sgi.com> | 2008-10-30 02:05:38 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@sgi.com> | 2008-10-30 02:05:38 -0400 |
commit | 847fff5ca881670ca8ec617afeb943950f0c804b (patch) | |
tree | cd03cf7a3422842978332a22de51c91827821841 /fs/xfs/xfs_inode.h | |
parent | 24ee0e49c9cce23acb1758728cb09e8d2b53bd33 (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.h | 246 |
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 | ||
21 | struct xfs_dinode; | 21 | struct xfs_dinode; |
22 | struct xfs_dinode_core; | 22 | struct xfs_dinode_core; |
23 | 23 | struct 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__ | ||
107 | struct bhv_desc; | ||
108 | struct cred; | ||
109 | struct ktrace; | ||
110 | struct xfs_buf; | ||
111 | struct xfs_bmap_free; | ||
112 | struct xfs_bmbt_irec; | ||
113 | struct xfs_bmbt_block; | ||
114 | struct xfs_inode; | ||
115 | struct xfs_inode_log_item; | ||
116 | struct xfs_mount; | ||
117 | struct xfs_trans; | ||
118 | struct xfs_dquot; | ||
119 | |||
120 | #if defined(XFS_ILOCK_TRACE) | ||
121 | #define XFS_ILOCK_KTRACE_SIZE 32 | ||
122 | extern ktrace_t *xfs_ilock_trace_buf; | ||
123 | extern 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 | |||
128 | typedef 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 | |||
210 | struct bhv_desc; | ||
211 | struct cred; | ||
212 | struct ktrace; | ||
213 | struct xfs_buf; | ||
214 | struct xfs_bmap_free; | ||
215 | struct xfs_bmbt_irec; | ||
216 | struct xfs_bmbt_block; | ||
217 | struct xfs_inode_log_item; | ||
218 | struct xfs_mount; | ||
219 | struct xfs_trans; | ||
220 | struct xfs_dquot; | ||
221 | |||
222 | #if defined(XFS_ILOCK_TRACE) | ||
223 | #define XFS_ILOCK_KTRACE_SIZE 32 | ||
224 | extern ktrace_t *xfs_ilock_trace_buf; | ||
225 | extern 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 | |||
230 | typedef 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 | |||
194 | typedef struct { | 236 | typedef 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 | */ |
378 | static 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) | 383 | static 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__ | 388 | static 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 | */ |
493 | int xfs_itobp(struct xfs_mount *, struct xfs_trans *, | ||
494 | xfs_inode_t *, struct xfs_dinode **, struct xfs_buf **, | ||
495 | xfs_daddr_t, uint, uint); | ||
496 | int xfs_iread(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, | 511 | int 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); |
498 | int xfs_iread_extents(struct xfs_trans *, xfs_inode_t *, int); | ||
499 | int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, | 513 | int 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 **); |
502 | void xfs_dinode_from_disk(struct xfs_icdinode *, | ||
503 | struct xfs_dinode_core *); | ||
504 | void xfs_dinode_to_disk(struct xfs_dinode_core *, | ||
505 | struct xfs_icdinode *); | ||
506 | 516 | ||
507 | uint xfs_ip2xflags(struct xfs_inode *); | 517 | uint xfs_ip2xflags(struct xfs_inode *); |
508 | uint xfs_dic2xflags(struct xfs_dinode *); | 518 | uint xfs_dic2xflags(struct xfs_dinode *); |
@@ -514,15 +524,11 @@ int xfs_itruncate_finish(struct xfs_trans **, xfs_inode_t *, | |||
514 | int xfs_iunlink(struct xfs_trans *, xfs_inode_t *); | 524 | int xfs_iunlink(struct xfs_trans *, xfs_inode_t *); |
515 | 525 | ||
516 | struct xfs_inode * xfs_inode_alloc(struct xfs_mount *, xfs_ino_t); | 526 | struct xfs_inode * xfs_inode_alloc(struct xfs_mount *, xfs_ino_t); |
517 | void xfs_idestroy_fork(xfs_inode_t *, int); | ||
518 | void xfs_idestroy(xfs_inode_t *); | 527 | void xfs_idestroy(xfs_inode_t *); |
519 | void xfs_idata_realloc(xfs_inode_t *, int, int); | ||
520 | void xfs_iextract(xfs_inode_t *); | 528 | void xfs_iextract(xfs_inode_t *); |
521 | void xfs_iext_realloc(xfs_inode_t *, int, int); | 529 | void xfs_iext_realloc(xfs_inode_t *, int, int); |
522 | void xfs_iroot_realloc(xfs_inode_t *, int, int); | ||
523 | void xfs_ipin(xfs_inode_t *); | 530 | void xfs_ipin(xfs_inode_t *); |
524 | void xfs_iunpin(xfs_inode_t *); | 531 | void xfs_iunpin(xfs_inode_t *); |
525 | int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); | ||
526 | int xfs_iflush(xfs_inode_t *, uint); | 532 | int xfs_iflush(xfs_inode_t *, uint); |
527 | void xfs_iflush_all(struct xfs_mount *); | 533 | void xfs_iflush_all(struct xfs_mount *); |
528 | void xfs_ichgtime(xfs_inode_t *, int); | 534 | void xfs_ichgtime(xfs_inode_t *, int); |
@@ -533,6 +539,21 @@ void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint); | |||
533 | void xfs_synchronize_atime(xfs_inode_t *); | 539 | void xfs_synchronize_atime(xfs_inode_t *); |
534 | void xfs_mark_inode_dirty_sync(xfs_inode_t *); | 540 | void xfs_mark_inode_dirty_sync(xfs_inode_t *); |
535 | 541 | ||
542 | #endif /* __KERNEL__ */ | ||
543 | |||
544 | int xfs_itobp(struct xfs_mount *, struct xfs_trans *, | ||
545 | struct xfs_inode *, struct xfs_dinode **, | ||
546 | struct xfs_buf **, xfs_daddr_t, uint, uint); | ||
547 | void xfs_dinode_from_disk(struct xfs_icdinode *, | ||
548 | struct xfs_dinode_core *); | ||
549 | void xfs_dinode_to_disk(struct xfs_dinode_core *, | ||
550 | struct xfs_icdinode *); | ||
551 | void xfs_idestroy_fork(struct xfs_inode *, int); | ||
552 | void xfs_idata_realloc(struct xfs_inode *, int, int); | ||
553 | void xfs_iroot_realloc(struct xfs_inode *, int, int); | ||
554 | int xfs_iread_extents(struct xfs_trans *, struct xfs_inode *, int); | ||
555 | int xfs_iextents_copy(struct xfs_inode *, xfs_bmbt_rec_t *, int); | ||
556 | |||
536 | xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t); | 557 | xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t); |
537 | void xfs_iext_insert(xfs_ifork_t *, xfs_extnum_t, xfs_extnum_t, | 558 | void 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 |
565 | void xfs_isize_check(struct xfs_mount *, xfs_inode_t *, xfs_fsize_t); | 586 | void 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; | |||
577 | extern struct kmem_zone *xfs_inode_zone; | 599 | extern struct kmem_zone *xfs_inode_zone; |
578 | extern struct kmem_zone *xfs_ili_zone; | 600 | extern 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 | */ | ||
585 | static inline void xfs_iflock(xfs_inode_t *ip) | ||
586 | { | ||
587 | wait_for_completion(&ip->i_flush); | ||
588 | } | ||
589 | |||
590 | static inline int xfs_iflock_nowait(xfs_inode_t *ip) | ||
591 | { | ||
592 | return try_wait_for_completion(&ip->i_flush); | ||
593 | } | ||
594 | |||
595 | static 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__ */ |