forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/fs/ext2/ext2.h
....@@ -52,8 +52,8 @@
5252 /*
5353 * Was i_next_alloc_goal in ext2_inode_info
5454 * is the *physical* companion to i_next_alloc_block.
55
- * it the the physical block number of the block which was most-recentl
56
- * allocated to this file. This give us the goal (target) for the next
55
+ * it is the physical block number of the block which was most-recently
56
+ * allocated to this file. This gives us the goal (target) for the next
5757 * allocation when we detect linearly ascending requests.
5858 */
5959 ext2_fsblk_t last_alloc_physical_block;
....@@ -374,7 +374,6 @@
374374 /*
375375 * Mount flags
376376 */
377
-#define EXT2_MOUNT_CHECK 0x000001 /* Do mount-time checks */
378377 #define EXT2_MOUNT_OLDALLOC 0x000002 /* Don't use the new Orlov allocator */
379378 #define EXT2_MOUNT_GRPID 0x000004 /* Create files with directory's group */
380379 #define EXT2_MOUNT_DEBUG 0x000008 /* Some debugging messages */
....@@ -390,11 +389,7 @@
390389 #define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */
391390 #define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */
392391 #define EXT2_MOUNT_RESERVATION 0x080000 /* Preallocation */
393
-#ifdef CONFIG_FS_DAX
394392 #define EXT2_MOUNT_DAX 0x100000 /* Direct Access */
395
-#else
396
-#define EXT2_MOUNT_DAX 0
397
-#endif
398393
399394
400395 #define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt
....@@ -608,22 +603,6 @@
608603 };
609604
610605 /*
611
- * Ext2 directory file types. Only the low 3 bits are used. The
612
- * other bits are reserved for now.
613
- */
614
-enum {
615
- EXT2_FT_UNKNOWN = 0,
616
- EXT2_FT_REG_FILE = 1,
617
- EXT2_FT_DIR = 2,
618
- EXT2_FT_CHRDEV = 3,
619
- EXT2_FT_BLKDEV = 4,
620
- EXT2_FT_FIFO = 5,
621
- EXT2_FT_SOCK = 6,
622
- EXT2_FT_SYMLINK = 7,
623
- EXT2_FT_MAX
624
-};
625
-
626
-/*
627606 * EXT2_DIR_PAD defines the directory entries boundaries
628607 *
629608 * NOTE: It must be a multiple of 4
....@@ -758,7 +737,8 @@
758737
759738 /* dir.c */
760739 extern int ext2_add_link (struct dentry *, struct inode *);
761
-extern ino_t ext2_inode_by_name(struct inode *, const struct qstr *);
740
+extern int ext2_inode_by_name(struct inode *dir,
741
+ const struct qstr *child, ino_t *ino);
762742 extern int ext2_make_empty(struct inode *, struct inode *);
763743 extern struct ext2_dir_entry_2 * ext2_find_entry (struct inode *,const struct qstr *, struct page **);
764744 extern int ext2_delete_entry (struct ext2_dir_entry_2 *, struct page *);
....@@ -778,6 +758,7 @@
778758 extern void ext2_evict_inode(struct inode *);
779759 extern int ext2_get_block(struct inode *, sector_t, struct buffer_head *, int);
780760 extern int ext2_setattr (struct dentry *, struct iattr *);
761
+extern int ext2_getattr (const struct path *, struct kstat *, u32, unsigned int);
781762 extern void ext2_set_inode_flags(struct inode *inode);
782763 extern int ext2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
783764 u64 start, u64 len);
....@@ -832,6 +813,18 @@
832813 le32_to_cpu(EXT2_SB(sb)->s_es->s_first_data_block);
833814 }
834815
816
+static inline ext2_fsblk_t
817
+ext2_group_last_block_no(struct super_block *sb, unsigned long group_no)
818
+{
819
+ struct ext2_sb_info *sbi = EXT2_SB(sb);
820
+
821
+ if (group_no == sbi->s_groups_count - 1)
822
+ return le32_to_cpu(sbi->s_es->s_blocks_count) - 1;
823
+ else
824
+ return ext2_group_first_block_no(sb, group_no) +
825
+ EXT2_BLOCKS_PER_GROUP(sb) - 1;
826
+}
827
+
835828 #define ext2_set_bit __test_and_set_bit_le
836829 #define ext2_clear_bit __test_and_clear_bit_le
837830 #define ext2_test_bit test_bit_le