Re: [PATCH v2] loop: fix no-unmap write-zeroes request behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While this looks generally good to me, I have another nitpick to avoid
code duplication.  What about just renaming lo_discard to lo_fallocate
and pass the mode (possibly minus the FALLOC_FL_KEEP_SIZE flag) to it?

The in the do_req_filebacked we could further simplify it down to:

  	case REQ_OP_WRITE_ZEROES:
		/*
		 * If the caller doesn't want deallocation, call zeroout to
		 * write zeroes the range.  Otherwise, punch them out.
		 */
		return lo_fallocate(lo, rq, pos,
			(rq->cmd_flags & REQ_NOUNMAP) ?
				FALLOC_FL_ZERO_RANGE : FALLOC_FL_PUNCH_HOLE);
		break;
	case REQ_OP_DISCARD:
		return lo_fallocate(lo, rq, pos, FALLOC_FL_PUNCH_HOLE);



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux