hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/fs/ext4/ext4.h
....@@ -553,7 +553,7 @@
553553 *
554554 * It's not paranoia if the Murphy's Law really *is* out to get you. :-)
555555 */
556
-#define TEST_FLAG_VALUE(FLAG) (EXT4_##FLAG##_FL == (1 << EXT4_INODE_##FLAG))
556
+#define TEST_FLAG_VALUE(FLAG) (EXT4_##FLAG##_FL == (1U << EXT4_INODE_##FLAG))
557557 #define CHECK_FLAG_VALUE(FLAG) BUILD_BUG_ON(!TEST_FLAG_VALUE(FLAG))
558558
559559 static inline void ext4_check_flag_values(void)
....@@ -980,11 +980,13 @@
980980 * where the second inode has larger inode number
981981 * than the first
982982 * I_DATA_SEM_QUOTA - Used for quota inodes only
983
+ * I_DATA_SEM_EA - Used for ea_inodes only
983984 */
984985 enum {
985986 I_DATA_SEM_NORMAL = 0,
986987 I_DATA_SEM_OTHER,
987988 I_DATA_SEM_QUOTA,
989
+ I_DATA_SEM_EA
988990 };
989991
990992
....@@ -1535,12 +1537,15 @@
15351537 atomic_t s_bal_success; /* we found long enough chunks */
15361538 atomic_t s_bal_allocated; /* in blocks */
15371539 atomic_t s_bal_ex_scanned; /* total extents scanned */
1540
+ atomic_t s_bal_groups_scanned; /* number of groups scanned */
15381541 atomic_t s_bal_goals; /* goal hits */
15391542 atomic_t s_bal_breaks; /* too long searches */
15401543 atomic_t s_bal_2orders; /* 2^order hits */
1541
- spinlock_t s_bal_lock;
1542
- unsigned long s_mb_buddies_generated;
1543
- unsigned long long s_mb_generation_time;
1544
+ atomic64_t s_bal_cX_groups_considered[4];
1545
+ atomic64_t s_bal_cX_hits[4];
1546
+ atomic64_t s_bal_cX_failed[4]; /* cX loop didn't find blocks */
1547
+ atomic_t s_mb_buddies_generated; /* number of buddies generated */
1548
+ atomic64_t s_mb_generation_time;
15441549 atomic_t s_mb_lost_chunks;
15451550 atomic_t s_mb_preallocated;
15461551 atomic_t s_mb_discarded;
....@@ -1575,7 +1580,7 @@
15751580 struct task_struct *s_mmp_tsk;
15761581
15771582 /* record the last minlen when FITRIM is called. */
1578
- atomic_t s_last_trim_minblks;
1583
+ unsigned long s_last_trim_minblks;
15791584
15801585 /* Reference to checksum algorithm driver via cryptoapi */
15811586 struct crypto_shash *s_chksum_driver;
....@@ -2591,6 +2596,8 @@
25912596 extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb,
25922597 ext4_group_t block_group,
25932598 struct buffer_head ** bh);
2599
+extern struct ext4_group_info *ext4_get_group_info(struct super_block *sb,
2600
+ ext4_group_t group);
25942601 extern int ext4_should_retry_alloc(struct super_block *sb, int *retries);
25952602
25962603 extern struct buffer_head *ext4_read_block_bitmap_nowait(struct super_block *sb,
....@@ -2830,6 +2837,7 @@
28302837 extern const struct seq_operations ext4_mb_seq_groups_ops;
28312838 extern long ext4_mb_stats;
28322839 extern long ext4_mb_max_to_scan;
2840
+extern int ext4_seq_mb_stats_show(struct seq_file *seq, void *offset);
28332841 extern int ext4_mb_init(struct super_block *);
28342842 extern int ext4_mb_release(struct super_block *);
28352843 extern ext4_fsblk_t ext4_mb_new_blocks(handle_t *,
....@@ -2887,7 +2895,9 @@
28872895 typedef enum {
28882896 EXT4_IGET_NORMAL = 0,
28892897 EXT4_IGET_SPECIAL = 0x0001, /* OK to iget a system inode */
2890
- EXT4_IGET_HANDLE = 0x0002 /* Inode # is from a handle */
2898
+ EXT4_IGET_HANDLE = 0x0002, /* Inode # is from a handle */
2899
+ EXT4_IGET_BAD = 0x0004, /* Allow to iget a bad inode */
2900
+ EXT4_IGET_EA_INODE = 0x0008 /* Inode should contain an EA value */
28912901 } ext4_iget_flags;
28922902
28932903 extern struct inode *__ext4_iget(struct super_block *sb, unsigned long ino,
....@@ -3003,6 +3013,8 @@
30033013 extern void ext4_mark_group_bitmap_corrupted(struct super_block *sb,
30043014 ext4_group_t block_group,
30053015 unsigned int flags);
3016
+extern unsigned int ext4_num_base_meta_blocks(struct super_block *sb,
3017
+ ext4_group_t block_group);
30063018
30073019 extern __printf(6, 7)
30083020 void __ext4_error(struct super_block *, const char *, unsigned int, int, __u64,
....@@ -3237,19 +3249,6 @@
32373249 {
32383250 raw_inode->i_size_lo = cpu_to_le32(i_size);
32393251 raw_inode->i_size_high = cpu_to_le32(i_size >> 32);
3240
-}
3241
-
3242
-static inline
3243
-struct ext4_group_info *ext4_get_group_info(struct super_block *sb,
3244
- ext4_group_t group)
3245
-{
3246
- struct ext4_group_info **grp_info;
3247
- long indexv, indexh;
3248
- BUG_ON(group >= EXT4_SB(sb)->s_groups_count);
3249
- indexv = group >> (EXT4_DESC_PER_BLOCK_BITS(sb));
3250
- indexh = group & ((EXT4_DESC_PER_BLOCK(sb)) - 1);
3251
- grp_info = sbi_array_rcu_deref(EXT4_SB(sb), s_group_info, indexv);
3252
- return grp_info[indexh];
32533252 }
32543253
32553254 /*
....@@ -3524,8 +3523,8 @@
35243523 unsigned int blocksize);
35253524 extern int ext4_handle_dirty_dirblock(handle_t *handle, struct inode *inode,
35263525 struct buffer_head *bh);
3527
-extern int __ext4_unlink(handle_t *handle, struct inode *dir, const struct qstr *d_name,
3528
- struct inode *inode);
3526
+extern int __ext4_unlink(struct inode *dir, const struct qstr *d_name,
3527
+ struct inode *inode, struct dentry *dentry);
35293528 extern int __ext4_link(struct inode *dir, struct inode *inode,
35303529 struct dentry *dentry);
35313530
....@@ -3574,6 +3573,9 @@
35743573 unsigned int count);
35753574 extern int ext4_check_blockref(const char *, unsigned int,
35763575 struct inode *, __le32 *, unsigned int);
3576
+extern int ext4_sb_block_valid(struct super_block *sb, struct inode *inode,
3577
+ ext4_fsblk_t start_blk, unsigned int count);
3578
+
35773579
35783580 /* extents.c */
35793581 struct ext4_ext_path;