Commit e984fd48 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  Define/reserve new ext4 superblock fields
  When ext4_ext_insert_extent() fails to insert new blocks
  ext4: Extent overlap bugfix
  Remove unnecessary exported symbols.
  EXT4: Fix whitespace
parents 184b812f 436bd75e
...@@ -30,15 +30,15 @@ ...@@ -30,15 +30,15 @@
void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr, void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr,
unsigned long *blockgrpp, ext4_grpblk_t *offsetp) unsigned long *blockgrpp, ext4_grpblk_t *offsetp)
{ {
struct ext4_super_block *es = EXT4_SB(sb)->s_es; struct ext4_super_block *es = EXT4_SB(sb)->s_es;
ext4_grpblk_t offset; ext4_grpblk_t offset;
blocknr = blocknr - le32_to_cpu(es->s_first_data_block); blocknr = blocknr - le32_to_cpu(es->s_first_data_block);
offset = do_div(blocknr, EXT4_BLOCKS_PER_GROUP(sb)); offset = do_div(blocknr, EXT4_BLOCKS_PER_GROUP(sb));
if (offsetp) if (offsetp)
*offsetp = offset; *offsetp = offset;
if (blockgrpp) if (blockgrpp)
*blockgrpp = blocknr; *blockgrpp = blocknr;
} }
......
This diff is collapsed.
...@@ -255,8 +255,8 @@ static int verify_chain(Indirect *from, Indirect *to) ...@@ -255,8 +255,8 @@ static int verify_chain(Indirect *from, Indirect *to)
* @inode: inode in question (we are only interested in its superblock) * @inode: inode in question (we are only interested in its superblock)
* @i_block: block number to be parsed * @i_block: block number to be parsed
* @offsets: array to store the offsets in * @offsets: array to store the offsets in
* @boundary: set this non-zero if the referred-to block is likely to be * @boundary: set this non-zero if the referred-to block is likely to be
* followed (on disk) by an indirect block. * followed (on disk) by an indirect block.
* *
* To store the locations of file's data ext4 uses a data structure common * To store the locations of file's data ext4 uses a data structure common
* for UNIX filesystems - tree of pointers anchored in the inode, with * for UNIX filesystems - tree of pointers anchored in the inode, with
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
*/ */
#define NAMEI_RA_CHUNKS 2 #define NAMEI_RA_CHUNKS 2
#define NAMEI_RA_BLOCKS 4 #define NAMEI_RA_BLOCKS 4
#define NAMEI_RA_SIZE (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS) #define NAMEI_RA_SIZE (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
#define NAMEI_RA_INDEX(c,b) (((c) * NAMEI_RA_BLOCKS) + (b)) #define NAMEI_RA_INDEX(c,b) (((c) * NAMEI_RA_BLOCKS) + (b))
static struct buffer_head *ext4_append(handle_t *handle, static struct buffer_head *ext4_append(handle_t *handle,
...@@ -241,7 +241,7 @@ static inline unsigned dx_node_limit (struct inode *dir) ...@@ -241,7 +241,7 @@ static inline unsigned dx_node_limit (struct inode *dir)
static void dx_show_index (char * label, struct dx_entry *entries) static void dx_show_index (char * label, struct dx_entry *entries)
{ {
int i, n = dx_get_count (entries); int i, n = dx_get_count (entries);
printk("%s index ", label); printk("%s index ", label);
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
printk("%x->%u ", i? dx_get_hash(entries + i) : printk("%x->%u ", i? dx_get_hash(entries + i) :
0, dx_get_block(entries + i)); 0, dx_get_block(entries + i));
......
...@@ -1985,7 +1985,7 @@ static journal_t *ext4_get_dev_journal(struct super_block *sb, ...@@ -1985,7 +1985,7 @@ static journal_t *ext4_get_dev_journal(struct super_block *sb,
if (bd_claim(bdev, sb)) { if (bd_claim(bdev, sb)) {
printk(KERN_ERR printk(KERN_ERR
"EXT4: failed to claim external journal device.\n"); "EXT4: failed to claim external journal device.\n");
blkdev_put(bdev); blkdev_put(bdev);
return NULL; return NULL;
} }
......
...@@ -32,9 +32,9 @@ ...@@ -32,9 +32,9 @@
/* /*
* Define EXT4_RESERVATION to reserve data blocks for expanding files * Define EXT4_RESERVATION to reserve data blocks for expanding files
*/ */
#define EXT4_DEFAULT_RESERVE_BLOCKS 8 #define EXT4_DEFAULT_RESERVE_BLOCKS 8
/*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */ /*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */
#define EXT4_MAX_RESERVE_BLOCKS 1027 #define EXT4_MAX_RESERVE_BLOCKS 1027
#define EXT4_RESERVE_WINDOW_NOT_ALLOCATED 0 #define EXT4_RESERVE_WINDOW_NOT_ALLOCATED 0
/* /*
* Always enable hashed directories * Always enable hashed directories
...@@ -204,12 +204,12 @@ struct ext4_group_desc ...@@ -204,12 +204,12 @@ struct ext4_group_desc
/* Used to pass group descriptor data when online resize is done */ /* Used to pass group descriptor data when online resize is done */
struct ext4_new_group_input { struct ext4_new_group_input {
__u32 group; /* Group number for this data */ __u32 group; /* Group number for this data */
__u64 block_bitmap; /* Absolute block number of block bitmap */ __u64 block_bitmap; /* Absolute block number of block bitmap */
__u64 inode_bitmap; /* Absolute block number of inode bitmap */ __u64 inode_bitmap; /* Absolute block number of inode bitmap */
__u64 inode_table; /* Absolute block number of inode table start */ __u64 inode_table; /* Absolute block number of inode table start */
__u32 blocks_count; /* Total number of blocks in this group */ __u32 blocks_count; /* Total number of blocks in this group */
__u16 reserved_blocks; /* Number of reserved blocks in this group */ __u16 reserved_blocks; /* Number of reserved blocks in this group */
__u16 unused; __u16 unused;
}; };
...@@ -310,7 +310,7 @@ struct ext4_inode { ...@@ -310,7 +310,7 @@ struct ext4_inode {
__u8 l_i_frag; /* Fragment number */ __u8 l_i_frag; /* Fragment number */
__u8 l_i_fsize; /* Fragment size */ __u8 l_i_fsize; /* Fragment size */
__le16 l_i_file_acl_high; __le16 l_i_file_acl_high;
__le16 l_i_uid_high; /* these 2 fields */ __le16 l_i_uid_high; /* these 2 fields */
__le16 l_i_gid_high; /* were reserved2[0] */ __le16 l_i_gid_high; /* were reserved2[0] */
__u32 l_i_reserved2; __u32 l_i_reserved2;
} linux2; } linux2;
...@@ -513,7 +513,14 @@ struct ext4_super_block { ...@@ -513,7 +513,14 @@ struct ext4_super_block {
/*150*/ __le32 s_blocks_count_hi; /* Blocks count */ /*150*/ __le32 s_blocks_count_hi; /* Blocks count */
__le32 s_r_blocks_count_hi; /* Reserved blocks count */ __le32 s_r_blocks_count_hi; /* Reserved blocks count */
__le32 s_free_blocks_count_hi; /* Free blocks count */ __le32 s_free_blocks_count_hi; /* Free blocks count */
__u32 s_reserved[169]; /* Padding to the end of the block */ __u16 s_min_extra_isize; /* All inodes have at least # bytes */
__u16 s_want_extra_isize; /* New inodes should reserve # bytes */
__u32 s_flags; /* Miscellaneous flags */
__u16 s_raid_stride; /* RAID stride */
__u16 s_mmp_interval; /* # seconds to wait in MMP checking */
__u64 s_mmp_block; /* Block for multi-mount protection */
__u32 s_raid_stripe_width; /* blocks on all data disks (N*stride)*/
__u32 s_reserved[163]; /* Padding to the end of the block */
}; };
#ifdef __KERNEL__ #ifdef __KERNEL__
...@@ -780,9 +787,9 @@ void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr, ...@@ -780,9 +787,9 @@ void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr,
* Ok, these declarations are also in <linux/kernel.h> but none of the * Ok, these declarations are also in <linux/kernel.h> but none of the
* ext4 source programs needs to include it so they are duplicated here. * ext4 source programs needs to include it so they are duplicated here.
*/ */
# define NORET_TYPE /**/ # define NORET_TYPE /**/
# define ATTRIB_NORET __attribute__((noreturn)) # define ATTRIB_NORET __attribute__((noreturn))
# define NORET_AND noreturn, # define NORET_AND noreturn,
/* balloc.c */ /* balloc.c */
extern unsigned int ext4_block_group(struct super_block *sb, extern unsigned int ext4_block_group(struct super_block *sb,
......
...@@ -151,8 +151,8 @@ typedef int (*ext_prepare_callback)(struct inode *, struct ext4_ext_path *, ...@@ -151,8 +151,8 @@ typedef int (*ext_prepare_callback)(struct inode *, struct ext4_ext_path *,
((struct ext4_extent_idx *) (((char *) (__hdr__)) + \ ((struct ext4_extent_idx *) (((char *) (__hdr__)) + \
sizeof(struct ext4_extent_header))) sizeof(struct ext4_extent_header)))
#define EXT_HAS_FREE_INDEX(__path__) \ #define EXT_HAS_FREE_INDEX(__path__) \
(le16_to_cpu((__path__)->p_hdr->eh_entries) \ (le16_to_cpu((__path__)->p_hdr->eh_entries) \
< le16_to_cpu((__path__)->p_hdr->eh_max)) < le16_to_cpu((__path__)->p_hdr->eh_max))
#define EXT_LAST_EXTENT(__hdr__) \ #define EXT_LAST_EXTENT(__hdr__) \
(EXT_FIRST_EXTENT((__hdr__)) + le16_to_cpu((__hdr__)->eh_entries) - 1) (EXT_FIRST_EXTENT((__hdr__)) + le16_to_cpu((__hdr__)->eh_entries) - 1)
#define EXT_LAST_INDEX(__hdr__) \ #define EXT_LAST_INDEX(__hdr__) \
...@@ -190,6 +190,7 @@ ext4_ext_invalidate_cache(struct inode *inode) ...@@ -190,6 +190,7 @@ ext4_ext_invalidate_cache(struct inode *inode)
extern int ext4_extent_tree_init(handle_t *, struct inode *); extern int ext4_extent_tree_init(handle_t *, struct inode *);
extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *); extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *);
extern unsigned int ext4_ext_check_overlap(struct inode *, struct ext4_extent *, struct ext4_ext_path *);
extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *); extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *);
extern int ext4_ext_walk_space(struct inode *, unsigned long, unsigned long, ext_prepare_callback, void *); extern int ext4_ext_walk_space(struct inode *, unsigned long, unsigned long, ext_prepare_callback, void *);
extern struct ext4_ext_path * ext4_ext_find_extent(struct inode *, int, struct ext4_ext_path *); extern struct ext4_ext_path * ext4_ext_find_extent(struct inode *, int, struct ext4_ext_path *);
......
...@@ -41,14 +41,14 @@ struct ext4_reserve_window_node { ...@@ -41,14 +41,14 @@ struct ext4_reserve_window_node {
struct ext4_block_alloc_info { struct ext4_block_alloc_info {
/* information about reservation window */ /* information about reservation window */
struct ext4_reserve_window_node rsv_window_node; struct ext4_reserve_window_node rsv_window_node;
/* /*
* was i_next_alloc_block in ext4_inode_info * was i_next_alloc_block in ext4_inode_info
* is the logical (file-relative) number of the * is the logical (file-relative) number of the
* most-recently-allocated block in this file. * most-recently-allocated block in this file.
* We use this for detecting linearly ascending allocation requests. * We use this for detecting linearly ascending allocation requests.
*/ */
__u32 last_alloc_logical_block; __u32 last_alloc_logical_block;
/* /*
* Was i_next_alloc_goal in ext4_inode_info * Was i_next_alloc_goal in ext4_inode_info
* is the *physical* companion to i_next_alloc_block. * is the *physical* companion to i_next_alloc_block.
...@@ -56,7 +56,7 @@ struct ext4_block_alloc_info { ...@@ -56,7 +56,7 @@ struct ext4_block_alloc_info {
* allocated to this file. This give us the goal (target) for the next * allocated to this file. This give us the goal (target) for the next
* allocation when we detect linearly ascending requests. * allocation when we detect linearly ascending requests.
*/ */
ext4_fsblk_t last_alloc_physical_block; ext4_fsblk_t last_alloc_physical_block;
}; };
#define rsv_start rsv_window._rsv_start #define rsv_start rsv_window._rsv_start
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment