Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4ce30f3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (40 commits)
  ext4: Make fsync sync new parent directories in no-journal mode
  ext4: Drop whitespace at end of lines
  ext4: Fix compat EXT4_IOC_ADD_GROUP
  ext4: Conditionally define compat ioctl numbers
  tracing: Convert more ext4 events to DEFINE_EVENT
  ext4: Add new tracepoints to track mballoc's buddy bitmap loads
  ext4: Add a missing trace hook
  ext4: restart ext4_ext_remove_space() after transaction restart
  ext4: Clear the EXT4_EOFBLOCKS_FL flag only when warranted
  ext4: Avoid crashing on NULL ptr dereference on a filesystem error
  ext4: Use bitops to read/modify i_flags in struct ext4_inode_info
  ext4: Convert calls of ext4_error() to EXT4_ERROR_INODE()
  ext4: Convert callers of ext4_get_blocks() to use ext4_map_blocks()
  ext4: Add new abstraction ext4_map_blocks() underneath ext4_get_blocks()
  ext4: Use our own write_cache_pages()
  ext4: Show journal_checksum option
  ext4: Fix for ext4_mb_collect_stats()
  ext4: check for a good block group before loading buddy pages
  ext4: Prevent creation of files larger than RLIMIT_FSIZE using fallocate
  ext4: Remove extraneous newlines in ext4_msg() calls
  ...

Fixed up trivial conflict in fs/ext4/fsync.c
parents b899ebeb 14ece102
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -591,14 +591,15 @@ ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode,
	ret = ext4_mb_new_blocks(handle, &ar, errp);
	ret = ext4_mb_new_blocks(handle, &ar, errp);
	if (count)
	if (count)
		*count = ar.len;
		*count = ar.len;

	/*
	/*
	 * Account for the allocated meta blocks
	 * Account for the allocated meta blocks.  We will never
	 * fail EDQUOT for metdata, but we do account for it.
	 */
	 */
	if (!(*errp) && EXT4_I(inode)->i_delalloc_reserved_flag) {
	if (!(*errp) && EXT4_I(inode)->i_delalloc_reserved_flag) {
		spin_lock(&EXT4_I(inode)->i_block_reservation_lock);
		spin_lock(&EXT4_I(inode)->i_block_reservation_lock);
		EXT4_I(inode)->i_allocated_meta_blocks += ar.len;
		EXT4_I(inode)->i_allocated_meta_blocks += ar.len;
		spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
		spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
		dquot_alloc_block_nofail(inode, ar.len);
	}
	}
	return ret;
	return ret;
}
}
+12 −14
Original line number Original line Diff line number Diff line
@@ -83,11 +83,10 @@ int ext4_check_dir_entry(const char *function, struct inode *dir,
		error_msg = "inode out of bounds";
		error_msg = "inode out of bounds";


	if (error_msg != NULL)
	if (error_msg != NULL)
		__ext4_error(dir->i_sb, function,
		ext4_error_inode(function, dir,
			"bad entry in directory #%lu: %s - block=%llu"
			"bad entry in directory: %s - block=%llu"
			"offset=%u(%u), inode=%u, rec_len=%d, name_len=%d",
			"offset=%u(%u), inode=%u, rec_len=%d, name_len=%d",
			dir->i_ino, error_msg, 
			error_msg, (unsigned long long) bh->b_blocknr,
			(unsigned long long) bh->b_blocknr,     
			(unsigned) (offset%bh->b_size), offset,
			(unsigned) (offset%bh->b_size), offset,
			le32_to_cpu(de->inode),
			le32_to_cpu(de->inode),
			rlen, de->name_len);
			rlen, de->name_len);
@@ -111,7 +110,7 @@ static int ext4_readdir(struct file *filp,


	if (EXT4_HAS_COMPAT_FEATURE(inode->i_sb,
	if (EXT4_HAS_COMPAT_FEATURE(inode->i_sb,
				    EXT4_FEATURE_COMPAT_DIR_INDEX) &&
				    EXT4_FEATURE_COMPAT_DIR_INDEX) &&
	    ((EXT4_I(inode)->i_flags & EXT4_INDEX_FL) ||
	    ((ext4_test_inode_flag(inode, EXT4_INODE_INDEX)) ||
	     ((inode->i_size >> sb->s_blocksize_bits) == 1))) {
	     ((inode->i_size >> sb->s_blocksize_bits) == 1))) {
		err = ext4_dx_readdir(filp, dirent, filldir);
		err = ext4_dx_readdir(filp, dirent, filldir);
		if (err != ERR_BAD_DX_DIR) {
		if (err != ERR_BAD_DX_DIR) {
@@ -122,20 +121,20 @@ static int ext4_readdir(struct file *filp,
		 * We don't set the inode dirty flag since it's not
		 * We don't set the inode dirty flag since it's not
		 * critical that it get flushed back to the disk.
		 * critical that it get flushed back to the disk.
		 */
		 */
		EXT4_I(filp->f_path.dentry->d_inode)->i_flags &= ~EXT4_INDEX_FL;
		ext4_clear_inode_flag(filp->f_path.dentry->d_inode, EXT4_INODE_INDEX);
	}
	}
	stored = 0;
	stored = 0;
	offset = filp->f_pos & (sb->s_blocksize - 1);
	offset = filp->f_pos & (sb->s_blocksize - 1);


	while (!error && !stored && filp->f_pos < inode->i_size) {
	while (!error && !stored && filp->f_pos < inode->i_size) {
		ext4_lblk_t blk = filp->f_pos >> EXT4_BLOCK_SIZE_BITS(sb);
		struct ext4_map_blocks map;
		struct buffer_head map_bh;
		struct buffer_head *bh = NULL;
		struct buffer_head *bh = NULL;


		map_bh.b_state = 0;
		map.m_lblk = filp->f_pos >> EXT4_BLOCK_SIZE_BITS(sb);
		err = ext4_get_blocks(NULL, inode, blk, 1, &map_bh, 0);
		map.m_len = 1;
		err = ext4_map_blocks(NULL, inode, &map, 0);
		if (err > 0) {
		if (err > 0) {
			pgoff_t index = map_bh.b_blocknr >>
			pgoff_t index = map.m_pblk >>
					(PAGE_CACHE_SHIFT - inode->i_blkbits);
					(PAGE_CACHE_SHIFT - inode->i_blkbits);
			if (!ra_has_index(&filp->f_ra, index))
			if (!ra_has_index(&filp->f_ra, index))
				page_cache_sync_readahead(
				page_cache_sync_readahead(
@@ -143,7 +142,7 @@ static int ext4_readdir(struct file *filp,
					&filp->f_ra, filp,
					&filp->f_ra, filp,
					index, 1);
					index, 1);
			filp->f_ra.prev_pos = (loff_t)index << PAGE_CACHE_SHIFT;
			filp->f_ra.prev_pos = (loff_t)index << PAGE_CACHE_SHIFT;
			bh = ext4_bread(NULL, inode, blk, 0, &err);
			bh = ext4_bread(NULL, inode, map.m_lblk, 0, &err);
		}
		}


		/*
		/*
@@ -152,9 +151,8 @@ static int ext4_readdir(struct file *filp,
		 */
		 */
		if (!bh) {
		if (!bh) {
			if (!dir_has_error) {
			if (!dir_has_error) {
				ext4_error(sb, "directory #%lu "
				EXT4_ERROR_INODE(inode, "directory "
					   "contains a hole at offset %Lu",
					   "contains a hole at offset %Lu",
					   inode->i_ino,
					   (unsigned long long) filp->f_pos);
					   (unsigned long long) filp->f_pos);
				dir_has_error = 1;
				dir_has_error = 1;
			}
			}
+145 −22
Original line number Original line Diff line number Diff line
@@ -29,6 +29,9 @@
#include <linux/wait.h>
#include <linux/wait.h>
#include <linux/blockgroup_lock.h>
#include <linux/blockgroup_lock.h>
#include <linux/percpu_counter.h>
#include <linux/percpu_counter.h>
#ifdef __KERNEL__
#include <linux/compat.h>
#endif


/*
/*
 * The fourth extended filesystem constants/structures
 * The fourth extended filesystem constants/structures
@@ -54,10 +57,10 @@
#endif
#endif


#define EXT4_ERROR_INODE(inode, fmt, a...) \
#define EXT4_ERROR_INODE(inode, fmt, a...) \
	ext4_error_inode(__func__, (inode), (fmt), ## a);
	ext4_error_inode(__func__, (inode), (fmt), ## a)


#define EXT4_ERROR_FILE(file, fmt, a...)	\
#define EXT4_ERROR_FILE(file, fmt, a...)	\
	ext4_error_file(__func__, (file), (fmt), ## a);
	ext4_error_file(__func__, (file), (fmt), ## a)


/* data type for block offset of block group */
/* data type for block offset of block group */
typedef int ext4_grpblk_t;
typedef int ext4_grpblk_t;
@@ -125,6 +128,29 @@ struct ext4_allocation_request {
	unsigned int flags;
	unsigned int flags;
};
};


/*
 * Logical to physical block mapping, used by ext4_map_blocks()
 *
 * This structure is used to pass requests into ext4_map_blocks() as
 * well as to store the information returned by ext4_map_blocks().  It
 * takes less room on the stack than a struct buffer_head.
 */
#define EXT4_MAP_NEW		(1 << BH_New)
#define EXT4_MAP_MAPPED		(1 << BH_Mapped)
#define EXT4_MAP_UNWRITTEN	(1 << BH_Unwritten)
#define EXT4_MAP_BOUNDARY	(1 << BH_Boundary)
#define EXT4_MAP_UNINIT		(1 << BH_Uninit)
#define EXT4_MAP_FLAGS		(EXT4_MAP_NEW | EXT4_MAP_MAPPED |\
				 EXT4_MAP_UNWRITTEN | EXT4_MAP_BOUNDARY |\
				 EXT4_MAP_UNINIT)

struct ext4_map_blocks {
	ext4_fsblk_t m_pblk;
	ext4_lblk_t m_lblk;
	unsigned int m_len;
	unsigned int m_flags;
};

/*
/*
 * For delayed allocation tracking
 * For delayed allocation tracking
 */
 */
@@ -321,6 +347,83 @@ static inline __u32 ext4_mask_flags(umode_t mode, __u32 flags)
		return flags & EXT4_OTHER_FLMASK;
		return flags & EXT4_OTHER_FLMASK;
}
}


/*
 * Inode flags used for atomic set/get
 */
enum {
	EXT4_INODE_SECRM	= 0,	/* Secure deletion */
	EXT4_INODE_UNRM		= 1,	/* Undelete */
	EXT4_INODE_COMPR	= 2,	/* Compress file */
	EXT4_INODE_SYNC		= 3,	/* Synchronous updates */
	EXT4_INODE_IMMUTABLE	= 4,	/* Immutable file */
	EXT4_INODE_APPEND	= 5,	/* writes to file may only append */
	EXT4_INODE_NODUMP	= 6,	/* do not dump file */
	EXT4_INODE_NOATIME	= 7,	/* do not update atime */
/* Reserved for compression usage... */
	EXT4_INODE_DIRTY	= 8,
	EXT4_INODE_COMPRBLK	= 9,	/* One or more compressed clusters */
	EXT4_INODE_NOCOMPR	= 10,	/* Don't compress */
	EXT4_INODE_ECOMPR	= 11,	/* Compression error */
/* End compression flags --- maybe not all used */
	EXT4_INODE_INDEX	= 12,	/* hash-indexed directory */
	EXT4_INODE_IMAGIC	= 13,	/* AFS directory */
	EXT4_INODE_JOURNAL_DATA	= 14,	/* file data should be journaled */
	EXT4_INODE_NOTAIL	= 15,	/* file tail should not be merged */
	EXT4_INODE_DIRSYNC	= 16,	/* dirsync behaviour (directories only) */
	EXT4_INODE_TOPDIR	= 17,	/* Top of directory hierarchies*/
	EXT4_INODE_HUGE_FILE	= 18,	/* Set to each huge file */
	EXT4_INODE_EXTENTS	= 19,	/* Inode uses extents */
	EXT4_INODE_EA_INODE	= 21,	/* Inode used for large EA */
	EXT4_INODE_EOFBLOCKS	= 22,	/* Blocks allocated beyond EOF */
	EXT4_INODE_RESERVED	= 31,	/* reserved for ext4 lib */
};

#define TEST_FLAG_VALUE(FLAG) (EXT4_##FLAG##_FL == (1 << EXT4_INODE_##FLAG))
#define CHECK_FLAG_VALUE(FLAG) if (!TEST_FLAG_VALUE(FLAG)) { \
	printk(KERN_EMERG "EXT4 flag fail: " #FLAG ": %d %d\n", \
		EXT4_##FLAG##_FL, EXT4_INODE_##FLAG); BUG_ON(1); }

/*
 * Since it's pretty easy to mix up bit numbers and hex values, and we
 * can't do a compile-time test for ENUM values, we use a run-time
 * test to make sure that EXT4_XXX_FL is consistent with respect to
 * EXT4_INODE_XXX.  If all is well the printk and BUG_ON will all drop
 * out so it won't cost any extra space in the compiled kernel image.
 * But it's important that these values are the same, since we are
 * using EXT4_INODE_XXX to test for the flag values, but EXT4_XX_FL
 * must be consistent with the values of FS_XXX_FL defined in
 * include/linux/fs.h and the on-disk values found in ext2, ext3, and
 * ext4 filesystems, and of course the values defined in e2fsprogs.
 *
 * It's not paranoia if the Murphy's Law really *is* out to get you.  :-)
 */
static inline void ext4_check_flag_values(void)
{
	CHECK_FLAG_VALUE(SECRM);
	CHECK_FLAG_VALUE(UNRM);
	CHECK_FLAG_VALUE(COMPR);
	CHECK_FLAG_VALUE(SYNC);
	CHECK_FLAG_VALUE(IMMUTABLE);
	CHECK_FLAG_VALUE(APPEND);
	CHECK_FLAG_VALUE(NODUMP);
	CHECK_FLAG_VALUE(NOATIME);
	CHECK_FLAG_VALUE(DIRTY);
	CHECK_FLAG_VALUE(COMPRBLK);
	CHECK_FLAG_VALUE(NOCOMPR);
	CHECK_FLAG_VALUE(ECOMPR);
	CHECK_FLAG_VALUE(INDEX);
	CHECK_FLAG_VALUE(IMAGIC);
	CHECK_FLAG_VALUE(JOURNAL_DATA);
	CHECK_FLAG_VALUE(NOTAIL);
	CHECK_FLAG_VALUE(DIRSYNC);
	CHECK_FLAG_VALUE(TOPDIR);
	CHECK_FLAG_VALUE(HUGE_FILE);
	CHECK_FLAG_VALUE(EXTENTS);
	CHECK_FLAG_VALUE(EA_INODE);
	CHECK_FLAG_VALUE(EOFBLOCKS);
	CHECK_FLAG_VALUE(RESERVED);
}

/* 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 */
@@ -332,6 +435,18 @@ struct ext4_new_group_input {
	__u16 unused;
	__u16 unused;
};
};


#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
struct compat_ext4_new_group_input {
	u32 group;
	compat_u64 block_bitmap;
	compat_u64 inode_bitmap;
	compat_u64 inode_table;
	u32 blocks_count;
	u16 reserved_blocks;
	u16 unused;
};
#endif

/* The struct ext4_new_group_input in kernel space, with free_blocks_count */
/* The struct ext4_new_group_input in kernel space, with free_blocks_count */
struct ext4_new_group_data {
struct ext4_new_group_data {
	__u32 group;
	__u32 group;
@@ -398,6 +513,7 @@ struct ext4_new_group_data {
#define EXT4_IOC_ALLOC_DA_BLKS		_IO('f', 12)
#define EXT4_IOC_ALLOC_DA_BLKS		_IO('f', 12)
#define EXT4_IOC_MOVE_EXT		_IOWR('f', 15, struct move_extent)
#define EXT4_IOC_MOVE_EXT		_IOWR('f', 15, struct move_extent)


#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
/*
/*
 * ioctl commands in 32 bit emulation
 * ioctl commands in 32 bit emulation
 */
 */
@@ -408,11 +524,13 @@ struct ext4_new_group_data {
#define EXT4_IOC32_GETRSVSZ		_IOR('f', 5, int)
#define EXT4_IOC32_GETRSVSZ		_IOR('f', 5, int)
#define EXT4_IOC32_SETRSVSZ		_IOW('f', 6, int)
#define EXT4_IOC32_SETRSVSZ		_IOW('f', 6, int)
#define EXT4_IOC32_GROUP_EXTEND		_IOW('f', 7, unsigned int)
#define EXT4_IOC32_GROUP_EXTEND		_IOW('f', 7, unsigned int)
#define EXT4_IOC32_GROUP_ADD		_IOW('f', 8, struct compat_ext4_new_group_input)
#ifdef CONFIG_JBD2_DEBUG
#ifdef CONFIG_JBD2_DEBUG
#define EXT4_IOC32_WAIT_FOR_READONLY	_IOR('f', 99, int)
#define EXT4_IOC32_WAIT_FOR_READONLY	_IOR('f', 99, int)
#endif
#endif
#define EXT4_IOC32_GETVERSION_OLD	FS_IOC32_GETVERSION
#define EXT4_IOC32_GETVERSION_OLD	FS_IOC32_GETVERSION
#define EXT4_IOC32_SETVERSION_OLD	FS_IOC32_SETVERSION
#define EXT4_IOC32_SETVERSION_OLD	FS_IOC32_SETVERSION
#endif




/*
/*
@@ -616,9 +734,8 @@ struct ext4_ext_cache {
 */
 */
struct ext4_inode_info {
struct ext4_inode_info {
	__le32	i_data[15];	/* unconverted */
	__le32	i_data[15];	/* unconverted */
	__u32	i_flags;
	ext4_fsblk_t	i_file_acl;
	__u32	i_dtime;
	__u32	i_dtime;
	ext4_fsblk_t	i_file_acl;


	/*
	/*
	 * i_block_group is the number of the block group which contains
	 * i_block_group is the number of the block group which contains
@@ -629,6 +746,7 @@ struct ext4_inode_info {
	 */
	 */
	ext4_group_t	i_block_group;
	ext4_group_t	i_block_group;
	unsigned long	i_state_flags;		/* Dynamic state flags */
	unsigned long	i_state_flags;		/* Dynamic state flags */
	unsigned long	i_flags;


	ext4_lblk_t		i_dir_start_lookup;
	ext4_lblk_t		i_dir_start_lookup;
#ifdef CONFIG_EXT4_FS_XATTR
#ifdef CONFIG_EXT4_FS_XATTR
@@ -1062,22 +1180,25 @@ enum {
	EXT4_STATE_DA_ALLOC_CLOSE,	/* Alloc DA blks on close */
	EXT4_STATE_DA_ALLOC_CLOSE,	/* Alloc DA blks on close */
	EXT4_STATE_EXT_MIGRATE,		/* Inode is migrating */
	EXT4_STATE_EXT_MIGRATE,		/* Inode is migrating */
	EXT4_STATE_DIO_UNWRITTEN,	/* need convert on dio done*/
	EXT4_STATE_DIO_UNWRITTEN,	/* need convert on dio done*/
	EXT4_STATE_NEWENTRY,		/* File just added to dir */
};
};


static inline int ext4_test_inode_state(struct inode *inode, int bit)
#define EXT4_INODE_BIT_FNS(name, field)					\
{
static inline int ext4_test_inode_##name(struct inode *inode, int bit)	\
	return test_bit(bit, &EXT4_I(inode)->i_state_flags);
{									\
	return test_bit(bit, &EXT4_I(inode)->i_##field);		\
}									\
static inline void ext4_set_inode_##name(struct inode *inode, int bit)	\
{									\
	set_bit(bit, &EXT4_I(inode)->i_##field);			\
}									\
static inline void ext4_clear_inode_##name(struct inode *inode, int bit) \
{									\
	clear_bit(bit, &EXT4_I(inode)->i_##field);			\
}
}


static inline void ext4_set_inode_state(struct inode *inode, int bit)
EXT4_INODE_BIT_FNS(flag, flags)
{
EXT4_INODE_BIT_FNS(state, state_flags)
	set_bit(bit, &EXT4_I(inode)->i_state_flags);
}

static inline void ext4_clear_inode_state(struct inode *inode, int bit)
{
	clear_bit(bit, &EXT4_I(inode)->i_state_flags);
}
#else
#else
/* Assume that user mode programs are passing in an ext4fs superblock, not
/* Assume that user mode programs are passing in an ext4fs superblock, not
 * a kernel struct super_block.  This will allow us to call the feature-test
 * a kernel struct super_block.  This will allow us to call the feature-test
@@ -1264,7 +1385,7 @@ struct ext4_dir_entry_2 {


#define is_dx(dir) (EXT4_HAS_COMPAT_FEATURE(dir->i_sb, \
#define is_dx(dir) (EXT4_HAS_COMPAT_FEATURE(dir->i_sb, \
				      EXT4_FEATURE_COMPAT_DIR_INDEX) && \
				      EXT4_FEATURE_COMPAT_DIR_INDEX) && \
		      (EXT4_I(dir)->i_flags & EXT4_INDEX_FL))
		    ext4_test_inode_flag((dir), EXT4_INODE_INDEX))
#define EXT4_DIR_LINK_MAX(dir) (!is_dx(dir) && (dir)->i_nlink >= EXT4_LINK_MAX)
#define EXT4_DIR_LINK_MAX(dir) (!is_dx(dir) && (dir)->i_nlink >= EXT4_LINK_MAX)
#define EXT4_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2 || (dir)->i_nlink == 1)
#define EXT4_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2 || (dir)->i_nlink == 1)


@@ -1678,6 +1799,7 @@ struct ext4_group_info {
	ext4_grpblk_t	bb_first_free;	/* first free block */
	ext4_grpblk_t	bb_first_free;	/* first free block */
	ext4_grpblk_t	bb_free;	/* total free blocks */
	ext4_grpblk_t	bb_free;	/* total free blocks */
	ext4_grpblk_t	bb_fragments;	/* nr of freespace fragments */
	ext4_grpblk_t	bb_fragments;	/* nr of freespace fragments */
	ext4_grpblk_t	bb_largest_free_order;/* order of largest frag in BG */
	struct          list_head bb_prealloc_list;
	struct          list_head bb_prealloc_list;
#ifdef DOUBLE_CHECK
#ifdef DOUBLE_CHECK
	void            *bb_bitmap;
	void            *bb_bitmap;
@@ -1772,9 +1894,8 @@ extern int ext4_ext_tree_init(handle_t *handle, struct inode *);
extern int ext4_ext_writepage_trans_blocks(struct inode *, int);
extern int ext4_ext_writepage_trans_blocks(struct inode *, int);
extern int ext4_ext_index_trans_blocks(struct inode *inode, int nrblocks,
extern int ext4_ext_index_trans_blocks(struct inode *inode, int nrblocks,
				       int chunk);
				       int chunk);
extern int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
extern int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
			       ext4_lblk_t iblock, unsigned int max_blocks,
			       struct ext4_map_blocks *map, int flags);
			       struct buffer_head *bh_result, int flags);
extern void ext4_ext_truncate(struct inode *);
extern void ext4_ext_truncate(struct inode *);
extern void ext4_ext_init(struct super_block *);
extern void ext4_ext_init(struct super_block *);
extern void ext4_ext_release(struct super_block *);
extern void ext4_ext_release(struct super_block *);
@@ -1782,6 +1903,8 @@ extern long ext4_fallocate(struct inode *inode, int mode, loff_t offset,
			  loff_t len);
			  loff_t len);
extern int ext4_convert_unwritten_extents(struct inode *inode, loff_t offset,
extern int ext4_convert_unwritten_extents(struct inode *inode, loff_t offset,
			  ssize_t len);
			  ssize_t len);
extern int ext4_map_blocks(handle_t *handle, struct inode *inode,
			   struct ext4_map_blocks *map, int flags);
extern int ext4_get_blocks(handle_t *handle, struct inode *inode,
extern int ext4_get_blocks(handle_t *handle, struct inode *inode,
			   sector_t block, unsigned int max_blocks,
			   sector_t block, unsigned int max_blocks,
			   struct buffer_head *bh, int flags);
			   struct buffer_head *bh, int flags);
+4 −4
Original line number Original line Diff line number Diff line
@@ -273,7 +273,7 @@ static inline int ext4_should_journal_data(struct inode *inode)
		return 1;
		return 1;
	if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)
	if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)
		return 1;
		return 1;
	if (EXT4_I(inode)->i_flags & EXT4_JOURNAL_DATA_FL)
	if (ext4_test_inode_flag(inode, EXT4_INODE_JOURNAL_DATA))
		return 1;
		return 1;
	return 0;
	return 0;
}
}
@@ -284,7 +284,7 @@ static inline int ext4_should_order_data(struct inode *inode)
		return 0;
		return 0;
	if (!S_ISREG(inode->i_mode))
	if (!S_ISREG(inode->i_mode))
		return 0;
		return 0;
	if (EXT4_I(inode)->i_flags & EXT4_JOURNAL_DATA_FL)
	if (ext4_test_inode_flag(inode, EXT4_INODE_JOURNAL_DATA))
		return 0;
		return 0;
	if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA)
	if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA)
		return 1;
		return 1;
@@ -297,7 +297,7 @@ static inline int ext4_should_writeback_data(struct inode *inode)
		return 0;
		return 0;
	if (EXT4_JOURNAL(inode) == NULL)
	if (EXT4_JOURNAL(inode) == NULL)
		return 1;
		return 1;
	if (EXT4_I(inode)->i_flags & EXT4_JOURNAL_DATA_FL)
	if (ext4_test_inode_flag(inode, EXT4_INODE_JOURNAL_DATA))
		return 0;
		return 0;
	if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA)
	if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA)
		return 1;
		return 1;
@@ -321,7 +321,7 @@ static inline int ext4_should_dioread_nolock(struct inode *inode)
		return 0;
		return 0;
	if (!S_ISREG(inode->i_mode))
	if (!S_ISREG(inode->i_mode))
		return 0;
		return 0;
	if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL))
	if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
		return 0;
		return 0;
	if (ext4_should_journal_data(inode))
	if (ext4_should_journal_data(inode))
		return 0;
		return 0;
+228 −189

File changed.

Preview size limit exceeded, changes collapsed.

Loading