From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot0-f171.google.com ([74.125.82.171]:33689 "EHLO mail-ot0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751505AbeCVPuo (ORCPT ); Thu, 22 Mar 2018 11:50:44 -0400 Received: by mail-ot0-f171.google.com with SMTP id y11-v6so9952431otg.0 for ; Thu, 22 Mar 2018 08:50:44 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20180322072734.GB28713@lst.de> References: <152167302988.5268.4370226749268662682.stgit@dwillia2-desk3.amr.corp.intel.com> <152167310580.5268.18270880990191450094.stgit@dwillia2-desk3.amr.corp.intel.com> <20180322072734.GB28713@lst.de> From: Dan Williams Date: Thu, 22 Mar 2018 08:50:43 -0700 Message-ID: Subject: Re: [PATCH v7 13/14] xfs: prepare xfs_break_layouts() for another layout type To: Christoph Hellwig Cc: linux-nvdimm , "Darrick J. Wong" , Ross Zwisler , Dave Chinner , linux-fsdevel , linux-xfs , Linux Kernel Mailing List , Jan Kara Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Mar 22, 2018 at 12:27 AM, Christoph Hellwig wrote: >> + ASSERT(xfs_isilocked(ip, XFS_IOLOCK_SHARED | XFS_IOLOCK_EXCL >> + | (reason == BREAK_UNMAPI >> + ? XFS_MMAPLOCK_EXCL : 0))); > > please split the assert, e.g.: > > ASSERT(xfs_isilocked(ip, XFS_IOLOCK_SHARED | XFS_IOLOCK_EXCL)); > > switch (reason) { > + case BREAK_UNMAPI: > ASSERT(xfs_isilocked(ip, XFS_MMAPLOCK_EXCL)); Sure, I was thinking to keep it out of the loop, but the common case is that this loop only iterates once. >> + /* fall through */ >> + case BREAK_WRITE: >> + error = xfs_break_leased_layouts(inode, iolock, &did_unlock); >> + break; >> + default: >> + error = -EINVAL; >> + break; >> + } >> + >> + return error; > > I have to say I'd prefer BREAK_UNMAP over BREAK_UNMAPI given that weird > I suffix doesn't buy us anything, but that's just a minor issue. Ok will do. > Otherwise looks good: > > Reviewed-by: Christoph Hellwig