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

Commit 9f44fdc5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: Fix time encoding with extra epoch bits
  ext4: Add a stub for mpage_da_data in the trace header
  jbd2: Use tracepoints for history file
  ext4: Use tracepoints for mb_history trace file
  ext4, jbd2: Drop unneeded printks at mount and unmount time
  ext4: Handle nested ext4_journal_start/stop calls without a journal
  ext4: Make sure ext4_dirty_inode() updates the inode in no journal mode
  ext4: Avoid updating the inode table bh twice in no journal mode
  ext4: EXT4_IOC_MOVE_EXT: Check for different original and donor inodes first
  ext4: async direct IO for holes and fallocate support
  ext4: Use end_io callback to avoid direct I/O fallback to buffered I/O
  ext4: Split uninitialized extents for direct I/O
  ext4: release reserved quota when block reservation for delalloc retry
  ext4: Adjust ext4_da_writepages() to write out larger contiguous chunks
  ext4: Fix hueristic which avoids group preallocation for closed files
  ext4: Use ext4_msg() for ext4_da_writepage() errors
  ext4: Update documentation about quota mount options
parents 4c8f1cb2 c1fccc06
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -282,9 +282,16 @@ stripe=n Number of filesystem blocks that mballoc will try
			to use for allocation size and alignment. For RAID5/6
			systems this should be the number of data
			disks *  RAID chunk size in file system blocks.
delalloc	(*)	Deferring block allocation until write-out time.
nodelalloc		Disable delayed allocation. Blocks are allocation
			when data is copied from user to page cache.

delalloc	(*)	Defer block allocation until just before ext4
			writes out the block(s) in question.  This
			allows ext4 to better allocation decisions
			more efficiently.
nodelalloc		Disable delayed allocation.  Blocks are allocated
			when the data is copied from userspace to the
			page cache, either via the write(2) system call
			or when an mmap'ed page which was previously
			unallocated is written for the first time.

max_batch_time=usec	Maximum amount of time ext4 should wait for
			additional filesystem operations to be batch
+0 −1
Original line number Diff line number Diff line
@@ -1113,7 +1113,6 @@ Table 1-12: Files in /proc/fs/ext4/<devname>
..............................................................................
 File            Content                                        
 mb_groups       details of multiblock allocator buddy cache of free blocks
 mb_history      multiblock allocation history
..............................................................................


+41 −13
Original line number Diff line number Diff line
@@ -65,6 +65,12 @@ typedef __u32 ext4_lblk_t;
/* data type for block group number */
typedef unsigned int ext4_group_t;

/*
 * Flags used in mballoc's allocation_context flags field.  
 *
 * Also used to show what's going on for debugging purposes when the
 * flag field is exported via the traceport interface
 */

/* prefer goal again. length */
#define EXT4_MB_HINT_MERGE		0x0001
@@ -127,6 +133,16 @@ struct mpage_da_data {
	int pages_written;
	int retval;
};
#define	DIO_AIO_UNWRITTEN	0x1
typedef struct ext4_io_end {
	struct list_head	list;		/* per-file finished AIO list */
	struct inode		*inode;		/* file being written to */
	unsigned int		flag;		/* unwritten or not */
	int			error;		/* I/O error code */
	ext4_lblk_t		offset;		/* offset in the file */
	size_t			size;		/* size of the extent */
	struct work_struct	work;		/* data work queue */
} ext4_io_end_t;

/*
 * Special inodes numbers
@@ -347,7 +363,16 @@ struct ext4_new_group_data {
	/* Call ext4_da_update_reserve_space() after successfully 
	   allocating the blocks */
#define EXT4_GET_BLOCKS_UPDATE_RESERVE_SPACE	0x0008

	/* caller is from the direct IO path, request to creation of an
	unitialized extents if not allocated, split the uninitialized
	extent if blocks has been preallocated already*/
#define EXT4_GET_BLOCKS_DIO			0x0010
#define EXT4_GET_BLOCKS_CONVERT			0x0020
#define EXT4_GET_BLOCKS_DIO_CREATE_EXT		(EXT4_GET_BLOCKS_DIO|\
					 EXT4_GET_BLOCKS_CREATE_UNINIT_EXT)
	/* Convert extent to initialized after direct IO complete */
#define EXT4_GET_BLOCKS_DIO_CONVERT_EXT		(EXT4_GET_BLOCKS_CONVERT|\
					 EXT4_GET_BLOCKS_DIO_CREATE_EXT)

/*
 * ioctl commands
@@ -500,8 +525,8 @@ struct move_extent {
static inline __le32 ext4_encode_extra_time(struct timespec *time)
{
       return cpu_to_le32((sizeof(time->tv_sec) > 4 ?
			   time->tv_sec >> 32 : 0) |
			   ((time->tv_nsec << 2) & EXT4_NSEC_MASK));
			   (time->tv_sec >> 32) & EXT4_EPOCH_MASK : 0) |
                          ((time->tv_nsec << EXT4_EPOCH_BITS) & EXT4_NSEC_MASK));
}

static inline void ext4_decode_extra_time(struct timespec *time, __le32 extra)
@@ -509,7 +534,7 @@ static inline void ext4_decode_extra_time(struct timespec *time, __le32 extra)
       if (sizeof(time->tv_sec) > 4)
	       time->tv_sec |= (__u64)(le32_to_cpu(extra) & EXT4_EPOCH_MASK)
			       << 32;
       time->tv_nsec = (le32_to_cpu(extra) & EXT4_NSEC_MASK) >> 2;
       time->tv_nsec = (le32_to_cpu(extra) & EXT4_NSEC_MASK) >> EXT4_EPOCH_BITS;
}

#define EXT4_INODE_SET_XTIME(xtime, inode, raw_inode)			       \
@@ -672,6 +697,11 @@ struct ext4_inode_info {
	__u16 i_extra_isize;

	spinlock_t i_block_reservation_lock;

	/* completed async DIOs that might need unwritten extents handling */
	struct list_head i_aio_dio_complete_list;
	/* current io_end structure for async DIO write*/
	ext4_io_end_t *cur_aio_dio;
};

/*
@@ -942,18 +972,11 @@ struct ext4_sb_info {
	unsigned int s_mb_stats;
	unsigned int s_mb_order2_reqs;
	unsigned int s_mb_group_prealloc;
	unsigned int s_max_writeback_mb_bump;
	/* where last allocation was done - for stream allocation */
	unsigned long s_mb_last_group;
	unsigned long s_mb_last_start;

	/* history to debug policy */
	struct ext4_mb_history *s_mb_history;
	int s_mb_history_cur;
	int s_mb_history_max;
	int s_mb_history_num;
	spinlock_t s_mb_history_lock;
	int s_mb_history_filter;

	/* stats for buddy allocator */
	spinlock_t s_mb_pa_lock;
	atomic_t s_bal_reqs;	/* number of reqs with len > 1 */
@@ -980,6 +1003,9 @@ struct ext4_sb_info {

	unsigned int s_log_groups_per_flex;
	struct flex_groups *s_flex_groups;

	/* workqueue for dio unwritten */
	struct workqueue_struct *dio_unwritten_wq;
};

static inline struct ext4_sb_info *EXT4_SB(struct super_block *sb)
@@ -1397,7 +1423,7 @@ extern int ext4_block_truncate_page(handle_t *handle,
		struct address_space *mapping, loff_t from);
extern int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);
extern qsize_t ext4_get_reserved_space(struct inode *inode);

extern int flush_aio_dio_completed_IO(struct inode *inode);
/* ioctl.c */
extern long ext4_ioctl(struct file *, unsigned int, unsigned long);
extern long ext4_compat_ioctl(struct file *, unsigned int, unsigned long);
@@ -1699,6 +1725,8 @@ extern void ext4_ext_init(struct super_block *);
extern void ext4_ext_release(struct super_block *);
extern long ext4_fallocate(struct inode *inode, int mode, loff_t offset,
			  loff_t len);
extern int ext4_convert_unwritten_extents(struct inode *inode, loff_t offset,
			  loff_t len);
extern int ext4_get_blocks(handle_t *handle, struct inode *inode,
			   sector_t block, unsigned int max_blocks,
			   struct buffer_head *bh, int flags);
+6 −1
Original line number Diff line number Diff line
@@ -220,6 +220,11 @@ static inline int ext4_ext_get_actual_len(struct ext4_extent *ext)
		(le16_to_cpu(ext->ee_len) - EXT_INIT_MAX_LEN));
}

static inline void ext4_ext_mark_initialized(struct ext4_extent *ext)
{
	ext->ee_len = cpu_to_le16(ext4_ext_get_actual_len(ext));
}

extern int ext4_ext_calc_metadata_amount(struct inode *inode, int blocks);
extern ext4_fsblk_t ext_pblock(struct ext4_extent *ex);
extern ext4_fsblk_t idx_pblock(struct ext4_extent_idx *);
@@ -235,7 +240,7 @@ extern int ext4_ext_try_to_merge(struct inode *inode,
				 struct ext4_ext_path *path,
				 struct ext4_extent *);
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 *, int);
extern int ext4_ext_walk_space(struct inode *, ext4_lblk_t, ext4_lblk_t,
							ext_prepare_callback, void *);
extern struct ext4_ext_path *ext4_ext_find_extent(struct inode *, ext4_lblk_t,
+4 −2
Original line number Diff line number Diff line
@@ -161,11 +161,13 @@ int __ext4_handle_dirty_metadata(const char *where, handle_t *handle,
handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks);
int __ext4_journal_stop(const char *where, handle_t *handle);

#define EXT4_NOJOURNAL_HANDLE	((handle_t *) 0x1)
#define EXT4_NOJOURNAL_MAX_REF_COUNT ((unsigned long) 4096)

/* Note:  Do not use this for NULL handles.  This is only to determine if
 * a properly allocated handle is using a journal or not. */
static inline int ext4_handle_valid(handle_t *handle)
{
	if (handle == EXT4_NOJOURNAL_HANDLE)
	if ((unsigned long)handle < EXT4_NOJOURNAL_MAX_REF_COUNT)
		return 0;
	return 1;
}
Loading