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

Commit f4d544ee authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs

* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: Fix error return for fallocate() on XFS
  xfs: cleanup dmapi macros in the umount path
  xfs: remove incorrect sparse annotation for xfs_iget_cache_miss
  xfs: kill the STATIC_INLINE macro
  xfs: uninline xfs_get_extsz_hint
  xfs: rename xfs_attr_fetch to xfs_attr_get_int
  xfs: simplify xfs_buf_get / xfs_buf_read interfaces
  xfs: remove IO_ISAIO
  xfs: Wrapped journal record corruption on read at recovery
  xfs: cleanup data end I/O handlers
  xfs: use WRITE_SYNC_PLUG for synchronous writeout
  xfs: reset the i_iolock lock class in the reclaim path
  xfs: I/O completion handlers must use NOFS allocations
  xfs: fix mmap_sem/iolock inversion in xfs_free_eofblocks
  xfs: simplify inode teardown
parents 0e2f7b83 44a743f6
Loading
Loading
Loading
Loading
+37 −77
Original line number Diff line number Diff line
@@ -235,71 +235,36 @@ xfs_setfilesize(
}

/*
 * Buffered IO write completion for delayed allocate extents.
 * IO write completion.
 */
STATIC void
xfs_end_bio_delalloc(
xfs_end_io(
	struct work_struct	*work)
{
	xfs_ioend_t		*ioend =
		container_of(work, xfs_ioend_t, io_work);

	xfs_setfilesize(ioend);
	xfs_destroy_ioend(ioend);
}

/*
 * Buffered IO write completion for regular, written extents.
 */
STATIC void
xfs_end_bio_written(
	struct work_struct	*work)
{
	xfs_ioend_t		*ioend =
		container_of(work, xfs_ioend_t, io_work);

	xfs_setfilesize(ioend);
	xfs_destroy_ioend(ioend);
}
	struct xfs_inode	*ip = XFS_I(ioend->io_inode);

	/*
 * IO write completion for unwritten extents.
 *
 * Issue transactions to convert a buffer range from unwritten
 * to written extents.
	 * For unwritten extents we need to issue transactions to convert a
	 * range to normal written extens after the data I/O has finished.
	 */
STATIC void
xfs_end_bio_unwritten(
	struct work_struct	*work)
{
	xfs_ioend_t		*ioend =
		container_of(work, xfs_ioend_t, io_work);
	struct xfs_inode	*ip = XFS_I(ioend->io_inode);
	xfs_off_t		offset = ioend->io_offset;
	size_t			size = ioend->io_size;

	if (likely(!ioend->io_error)) {
		if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) {
	if (ioend->io_type == IOMAP_UNWRITTEN &&
	    likely(!ioend->io_error && !XFS_FORCED_SHUTDOWN(ip->i_mount))) {
		int error;
			error = xfs_iomap_write_unwritten(ip, offset, size);

		error = xfs_iomap_write_unwritten(ip, ioend->io_offset,
						 ioend->io_size);
		if (error)
			ioend->io_error = error;
	}
		xfs_setfilesize(ioend);
	}
	xfs_destroy_ioend(ioend);
}

	/*
 * IO read completion for regular, written extents.
	 * We might have to update the on-disk file size after extending
	 * writes.
	 */
STATIC void
xfs_end_bio_read(
	struct work_struct	*work)
{
	xfs_ioend_t		*ioend =
		container_of(work, xfs_ioend_t, io_work);

	if (ioend->io_type != IOMAP_READ)
		xfs_setfilesize(ioend);
	xfs_destroy_ioend(ioend);
}

@@ -314,10 +279,10 @@ xfs_finish_ioend(
	int		wait)
{
	if (atomic_dec_and_test(&ioend->io_remaining)) {
		struct workqueue_struct *wq = xfsdatad_workqueue;
		if (ioend->io_work.func == xfs_end_bio_unwritten)
			wq = xfsconvertd_workqueue;
		struct workqueue_struct *wq;

		wq = (ioend->io_type == IOMAP_UNWRITTEN) ?
			xfsconvertd_workqueue : xfsdatad_workqueue;
		queue_work(wq, &ioend->io_work);
		if (wait)
			flush_workqueue(wq);
@@ -355,15 +320,7 @@ xfs_alloc_ioend(
	ioend->io_offset = 0;
	ioend->io_size = 0;

	if (type == IOMAP_UNWRITTEN)
		INIT_WORK(&ioend->io_work, xfs_end_bio_unwritten);
	else if (type == IOMAP_DELAY)
		INIT_WORK(&ioend->io_work, xfs_end_bio_delalloc);
	else if (type == IOMAP_READ)
		INIT_WORK(&ioend->io_work, xfs_end_bio_read);
	else
		INIT_WORK(&ioend->io_work, xfs_end_bio_written);

	INIT_WORK(&ioend->io_work, xfs_end_io);
	return ioend;
}

@@ -380,7 +337,7 @@ xfs_map_blocks(
	return -xfs_iomap(XFS_I(inode), offset, count, flags, mapp, &nmaps);
}

STATIC_INLINE int
STATIC int
xfs_iomap_valid(
	xfs_iomap_t		*iomapp,
	loff_t			offset)
@@ -412,6 +369,7 @@ xfs_end_bio(

STATIC void
xfs_submit_ioend_bio(
	struct writeback_control *wbc,
	xfs_ioend_t		*ioend,
	struct bio		*bio)
{
@@ -426,7 +384,8 @@ xfs_submit_ioend_bio(
	if (xfs_ioend_new_eof(ioend))
		xfs_mark_inode_dirty_sync(XFS_I(ioend->io_inode));

	submit_bio(WRITE, bio);
	submit_bio(wbc->sync_mode == WB_SYNC_ALL ?
		   WRITE_SYNC_PLUG : WRITE, bio);
	ASSERT(!bio_flagged(bio, BIO_EOPNOTSUPP));
	bio_put(bio);
}
@@ -505,6 +464,7 @@ static inline int bio_add_buffer(struct bio *bio, struct buffer_head *bh)
 */
STATIC void
xfs_submit_ioend(
	struct writeback_control *wbc,
	xfs_ioend_t		*ioend)
{
	xfs_ioend_t		*head = ioend;
@@ -533,19 +493,19 @@ xfs_submit_ioend(
 retry:
				bio = xfs_alloc_ioend_bio(bh);
			} else if (bh->b_blocknr != lastblock + 1) {
				xfs_submit_ioend_bio(ioend, bio);
				xfs_submit_ioend_bio(wbc, ioend, bio);
				goto retry;
			}

			if (bio_add_buffer(bio, bh) != bh->b_size) {
				xfs_submit_ioend_bio(ioend, bio);
				xfs_submit_ioend_bio(wbc, ioend, bio);
				goto retry;
			}

			lastblock = bh->b_blocknr;
		}
		if (bio)
			xfs_submit_ioend_bio(ioend, bio);
			xfs_submit_ioend_bio(wbc, ioend, bio);
		xfs_finish_ioend(ioend, 0);
	} while ((ioend = next) != NULL);
}
@@ -1191,7 +1151,7 @@ xfs_page_state_convert(
	}

	if (iohead)
		xfs_submit_ioend(iohead);
		xfs_submit_ioend(wbc, iohead);

	return page_dirty;

@@ -1528,7 +1488,7 @@ xfs_end_io_direct(
		 * didn't map an unwritten extent so switch it's completion
		 * handler.
		 */
		INIT_WORK(&ioend->io_work, xfs_end_bio_written);
		ioend->io_type = IOMAP_NEW;
		xfs_finish_ioend(ioend, 0);
	}

+7 −7
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ page_region_mask(
	return mask;
}

STATIC_INLINE void
STATIC void
set_page_region(
	struct page	*page,
	size_t		offset,
@@ -161,7 +161,7 @@ set_page_region(
		SetPageUptodate(page);
}

STATIC_INLINE int
STATIC int
test_page_region(
	struct page	*page,
	size_t		offset,
@@ -582,7 +582,7 @@ found:
 *	although backing storage may not be.
 */
xfs_buf_t *
xfs_buf_get_flags(
xfs_buf_get(
	xfs_buftarg_t		*target,/* target for buffer		*/
	xfs_off_t		ioff,	/* starting offset of range	*/
	size_t			isize,	/* length of range		*/
@@ -661,7 +661,7 @@ _xfs_buf_read(
}

xfs_buf_t *
xfs_buf_read_flags(
xfs_buf_read(
	xfs_buftarg_t		*target,
	xfs_off_t		ioff,
	size_t			isize,
@@ -671,7 +671,7 @@ xfs_buf_read_flags(

	flags |= XBF_READ;

	bp = xfs_buf_get_flags(target, ioff, isize, flags);
	bp = xfs_buf_get(target, ioff, isize, flags);
	if (bp) {
		if (!XFS_BUF_ISDONE(bp)) {
			XB_TRACE(bp, "read", (unsigned long)flags);
@@ -718,7 +718,7 @@ xfs_buf_readahead(
		return;

	flags |= (XBF_TRYLOCK|XBF_ASYNC|XBF_READ_AHEAD);
	xfs_buf_read_flags(target, ioff, isize, flags);
	xfs_buf_read(target, ioff, isize, flags);
}

xfs_buf_t *
@@ -1113,7 +1113,7 @@ xfs_bdwrite(
	xfs_buf_delwri_queue(bp, 1);
}

STATIC_INLINE void
STATIC void
_xfs_buf_ioend(
	xfs_buf_t		*bp,
	int			schedule)
+2 −7
Original line number Diff line number Diff line
@@ -186,15 +186,10 @@ extern xfs_buf_t *_xfs_buf_find(xfs_buftarg_t *, xfs_off_t, size_t,
#define xfs_incore(buftarg,blkno,len,lockit) \
	_xfs_buf_find(buftarg, blkno ,len, lockit, NULL)

extern xfs_buf_t *xfs_buf_get_flags(xfs_buftarg_t *, xfs_off_t, size_t,
extern xfs_buf_t *xfs_buf_get(xfs_buftarg_t *, xfs_off_t, size_t,
				xfs_buf_flags_t);
#define xfs_buf_get(target, blkno, len, flags) \
	xfs_buf_get_flags((target), (blkno), (len), XBF_LOCK | XBF_MAPPED)

extern xfs_buf_t *xfs_buf_read_flags(xfs_buftarg_t *, xfs_off_t, size_t,
extern xfs_buf_t *xfs_buf_read(xfs_buftarg_t *, xfs_off_t, size_t,
				xfs_buf_flags_t);
#define xfs_buf_read(target, blkno, len, flags) \
	xfs_buf_read_flags((target), (blkno), (len), XBF_LOCK | XBF_MAPPED)

extern xfs_buf_t *xfs_buf_get_empty(size_t, xfs_buftarg_t *);
extern xfs_buf_t *xfs_buf_get_noaddr(size_t, xfs_buftarg_t *);
+2 −2
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ xfs_file_aio_read(
	loff_t			pos)
{
	struct file		*file = iocb->ki_filp;
	int			ioflags = IO_ISAIO;
	int			ioflags = 0;

	BUG_ON(iocb->ki_pos != pos);
	if (unlikely(file->f_flags & O_DIRECT))
@@ -71,7 +71,7 @@ xfs_file_aio_write(
	loff_t			pos)
{
	struct file		*file = iocb->ki_filp;
	int			ioflags = IO_ISAIO;
	int			ioflags = 0;

	BUG_ON(iocb->ki_pos != pos);
	if (unlikely(file->f_flags & O_DIRECT))
+3 −3
Original line number Diff line number Diff line
@@ -573,7 +573,7 @@ xfs_vn_fallocate(
	bf.l_len = len;

	xfs_ilock(ip, XFS_IOLOCK_EXCL);
	error = xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf,
	error = -xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf,
				       0, XFS_ATTR_NOLOCK);
	if (!error && !(mode & FALLOC_FL_KEEP_SIZE) &&
	    offset + len > i_size_read(inode))
@@ -585,7 +585,7 @@ xfs_vn_fallocate(

		iattr.ia_valid = ATTR_SIZE;
		iattr.ia_size = new_size;
		error = xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK);
		error = -xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK);
	}

	xfs_iunlock(ip, XFS_IOLOCK_EXCL);
Loading