hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/fs/xfs/xfs_inode.h
....@@ -37,26 +37,33 @@
3737 struct xfs_ifork *i_cowfp; /* copy on write extents */
3838 struct xfs_ifork i_df; /* data fork */
3939
40
- /* operations vectors */
41
- const struct xfs_dir_ops *d_ops; /* directory ops vector */
42
-
4340 /* Transaction and locking information. */
4441 struct xfs_inode_log_item *i_itemp; /* logging information */
4542 mrlock_t i_lock; /* inode lock */
4643 mrlock_t i_mmaplock; /* inode mmap IO lock */
4744 atomic_t i_pincount; /* inode pin count */
45
+
46
+ /*
47
+ * Bitsets of inode metadata that have been checked and/or are sick.
48
+ * Callers must hold i_flags_lock before accessing this field.
49
+ */
50
+ uint16_t i_checked;
51
+ uint16_t i_sick;
52
+
4853 spinlock_t i_flags_lock; /* inode i_flags lock */
4954 /* Miscellaneous state. */
5055 unsigned long i_flags; /* see defined flags below */
51
- unsigned int i_delayed_blks; /* count of delay alloc blks */
56
+ uint64_t i_delayed_blks; /* count of delay alloc blks */
5257
5358 struct xfs_icdinode i_d; /* most of ondisk inode */
5459
55
- xfs_extnum_t i_cnextents; /* # of extents in cow fork */
56
- unsigned int i_cformat; /* format of cow fork */
57
-
5860 /* VFS inode */
5961 struct inode i_vnode; /* embedded VFS inode */
62
+
63
+ /* pending io completions */
64
+ spinlock_t i_ioend_lock;
65
+ struct work_struct i_ioend_work;
66
+ struct list_head i_ioend_list;
6067 } xfs_inode_t;
6168
6269 /* Convert from vfs inode to xfs inode */
....@@ -164,30 +171,11 @@
164171 return ret;
165172 }
166173
167
-/*
168
- * Project quota id helpers (previously projid was 16bit only
169
- * and using two 16bit values to hold new 32bit projid was chosen
170
- * to retain compatibility with "old" filesystems).
171
- */
172
-static inline prid_t
173
-xfs_get_projid(struct xfs_inode *ip)
174
-{
175
- return (prid_t)ip->i_d.di_projid_hi << 16 | ip->i_d.di_projid_lo;
176
-}
177
-
178
-static inline void
179
-xfs_set_projid(struct xfs_inode *ip,
180
- prid_t projid)
181
-{
182
- ip->i_d.di_projid_hi = (uint16_t) (projid >> 16);
183
- ip->i_d.di_projid_lo = (uint16_t) (projid & 0xffff);
184
-}
185
-
186174 static inline prid_t
187175 xfs_get_initial_prid(struct xfs_inode *dp)
188176 {
189177 if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT)
190
- return xfs_get_projid(dp);
178
+ return dp->i_d.di_projid;
191179
192180 return XFS_PROJID_DEFAULT;
193181 }
....@@ -206,6 +194,18 @@
206194 return ip->i_cowfp && ip->i_cowfp->if_bytes;
207195 }
208196
197
+static inline bool xfs_inode_has_bigtime(struct xfs_inode *ip)
198
+{
199
+ return ip->i_d.di_flags2 & XFS_DIFLAG2_BIGTIME;
200
+}
201
+
202
+/*
203
+ * Return the buftarg used for data allocations on a given inode.
204
+ */
205
+#define xfs_inode_buftarg(ip) \
206
+ (XFS_IS_REALTIME_INODE(ip) ? \
207
+ (ip)->i_mount->m_rtdev_targp : (ip)->i_mount->m_ddev_targp)
208
+
209209 /*
210210 * In-core inode flags.
211211 */
....@@ -216,12 +216,10 @@
216216 #define XFS_INEW (1 << __XFS_INEW_BIT)
217217 #define XFS_ITRUNCATED (1 << 5) /* truncated down so flush-on-close */
218218 #define XFS_IDIRTY_RELEASE (1 << 6) /* dirty release already seen */
219
-#define __XFS_IFLOCK_BIT 7 /* inode is being flushed right now */
220
-#define XFS_IFLOCK (1 << __XFS_IFLOCK_BIT)
219
+#define XFS_IFLUSHING (1 << 7) /* inode is being flushed */
221220 #define __XFS_IPINNED_BIT 8 /* wakeup key for zero pin count */
222221 #define XFS_IPINNED (1 << __XFS_IPINNED_BIT)
223
-#define XFS_IDONTCACHE (1 << 9) /* don't cache the inode long term */
224
-#define XFS_IEOFBLOCKS (1 << 10)/* has the preallocblocks tag set */
222
+#define XFS_IEOFBLOCKS (1 << 9) /* has the preallocblocks tag set */
225223 /*
226224 * If this unlinked inode is in the middle of recovery, don't let drop_inode
227225 * truncate and free the inode. This can happen if we iget the inode during
....@@ -238,36 +236,6 @@
238236 #define XFS_IRECLAIM_RESET_FLAGS \
239237 (XFS_IRECLAIMABLE | XFS_IRECLAIM | \
240238 XFS_IDIRTY_RELEASE | XFS_ITRUNCATED)
241
-
242
-/*
243
- * Synchronize processes attempting to flush the in-core inode back to disk.
244
- */
245
-
246
-static inline int xfs_isiflocked(struct xfs_inode *ip)
247
-{
248
- return xfs_iflags_test(ip, XFS_IFLOCK);
249
-}
250
-
251
-extern void __xfs_iflock(struct xfs_inode *ip);
252
-
253
-static inline int xfs_iflock_nowait(struct xfs_inode *ip)
254
-{
255
- return !xfs_iflags_test_and_set(ip, XFS_IFLOCK);
256
-}
257
-
258
-static inline void xfs_iflock(struct xfs_inode *ip)
259
-{
260
- if (!xfs_iflock_nowait(ip))
261
- __xfs_iflock(ip);
262
-}
263
-
264
-static inline void xfs_ifunlock(struct xfs_inode *ip)
265
-{
266
- ASSERT(xfs_isiflocked(ip));
267
- xfs_iflags_clear(ip, XFS_IFLOCK);
268
- smp_mb();
269
- wake_up_bit(&ip->i_flags, __XFS_IFLOCK_BIT);
270
-}
271239
272240 /*
273241 * Flags for inode locking.
....@@ -428,10 +396,11 @@
428396 struct xfs_inode *, int, xfs_fsize_t, int);
429397 void xfs_iext_realloc(xfs_inode_t *, int, int);
430398
399
+int xfs_log_force_inode(struct xfs_inode *ip);
431400 void xfs_iunpin_wait(xfs_inode_t *);
432401 #define xfs_ipincount(ip) ((unsigned int) atomic_read(&ip->i_pincount))
433402
434
-int xfs_iflush(struct xfs_inode *, struct xfs_buf **);
403
+int xfs_iflush_cluster(struct xfs_buf *);
435404 void xfs_lock_two_inodes(struct xfs_inode *ip0, uint ip0_mode,
436405 struct xfs_inode *ip1, uint ip1_mode);
437406
....@@ -468,6 +437,7 @@
468437 /* from xfs_iops.c */
469438 extern void xfs_setup_inode(struct xfs_inode *ip);
470439 extern void xfs_setup_iops(struct xfs_inode *ip);
440
+extern void xfs_diflags_to_iflags(struct xfs_inode *ip, bool init);
471441
472442 /*
473443 * When setting up a newly allocated inode, we need to call
....@@ -498,6 +468,12 @@
498468 /* The default CoW extent size hint. */
499469 #define XFS_DEFAULT_COWEXTSZ_HINT 32
500470
501
-bool xfs_inode_verify_forks(struct xfs_inode *ip);
471
+int xfs_iunlink_init(struct xfs_perag *pag);
472
+void xfs_iunlink_destroy(struct xfs_perag *pag);
473
+
474
+void xfs_end_io(struct work_struct *work);
475
+
476
+int xfs_ilock2_io_mmap(struct xfs_inode *ip1, struct xfs_inode *ip2);
477
+void xfs_iunlock2_io_mmap(struct xfs_inode *ip1, struct xfs_inode *ip2);
502478
503479 #endif /* __XFS_INODE_H__ */