| .. | .. |
|---|
| 52 | 52 | /* |
|---|
| 53 | 53 | * Was i_next_alloc_goal in ext2_inode_info |
|---|
| 54 | 54 | * 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 |
|---|
| 57 | 57 | * allocation when we detect linearly ascending requests. |
|---|
| 58 | 58 | */ |
|---|
| 59 | 59 | ext2_fsblk_t last_alloc_physical_block; |
|---|
| .. | .. |
|---|
| 374 | 374 | /* |
|---|
| 375 | 375 | * Mount flags |
|---|
| 376 | 376 | */ |
|---|
| 377 | | -#define EXT2_MOUNT_CHECK 0x000001 /* Do mount-time checks */ |
|---|
| 378 | 377 | #define EXT2_MOUNT_OLDALLOC 0x000002 /* Don't use the new Orlov allocator */ |
|---|
| 379 | 378 | #define EXT2_MOUNT_GRPID 0x000004 /* Create files with directory's group */ |
|---|
| 380 | 379 | #define EXT2_MOUNT_DEBUG 0x000008 /* Some debugging messages */ |
|---|
| .. | .. |
|---|
| 390 | 389 | #define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */ |
|---|
| 391 | 390 | #define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */ |
|---|
| 392 | 391 | #define EXT2_MOUNT_RESERVATION 0x080000 /* Preallocation */ |
|---|
| 393 | | -#ifdef CONFIG_FS_DAX |
|---|
| 394 | 392 | #define EXT2_MOUNT_DAX 0x100000 /* Direct Access */ |
|---|
| 395 | | -#else |
|---|
| 396 | | -#define EXT2_MOUNT_DAX 0 |
|---|
| 397 | | -#endif |
|---|
| 398 | 393 | |
|---|
| 399 | 394 | |
|---|
| 400 | 395 | #define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt |
|---|
| .. | .. |
|---|
| 608 | 603 | }; |
|---|
| 609 | 604 | |
|---|
| 610 | 605 | /* |
|---|
| 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 | | -/* |
|---|
| 627 | 606 | * EXT2_DIR_PAD defines the directory entries boundaries |
|---|
| 628 | 607 | * |
|---|
| 629 | 608 | * NOTE: It must be a multiple of 4 |
|---|
| .. | .. |
|---|
| 758 | 737 | |
|---|
| 759 | 738 | /* dir.c */ |
|---|
| 760 | 739 | 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); |
|---|
| 762 | 742 | extern int ext2_make_empty(struct inode *, struct inode *); |
|---|
| 763 | 743 | extern struct ext2_dir_entry_2 * ext2_find_entry (struct inode *,const struct qstr *, struct page **); |
|---|
| 764 | 744 | extern int ext2_delete_entry (struct ext2_dir_entry_2 *, struct page *); |
|---|
| .. | .. |
|---|
| 778 | 758 | extern void ext2_evict_inode(struct inode *); |
|---|
| 779 | 759 | extern int ext2_get_block(struct inode *, sector_t, struct buffer_head *, int); |
|---|
| 780 | 760 | extern int ext2_setattr (struct dentry *, struct iattr *); |
|---|
| 761 | +extern int ext2_getattr (const struct path *, struct kstat *, u32, unsigned int); |
|---|
| 781 | 762 | extern void ext2_set_inode_flags(struct inode *inode); |
|---|
| 782 | 763 | extern int ext2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, |
|---|
| 783 | 764 | u64 start, u64 len); |
|---|
| .. | .. |
|---|
| 832 | 813 | le32_to_cpu(EXT2_SB(sb)->s_es->s_first_data_block); |
|---|
| 833 | 814 | } |
|---|
| 834 | 815 | |
|---|
| 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 | + |
|---|
| 835 | 828 | #define ext2_set_bit __test_and_set_bit_le |
|---|
| 836 | 829 | #define ext2_clear_bit __test_and_clear_bit_le |
|---|
| 837 | 830 | #define ext2_test_bit test_bit_le |
|---|