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 RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux