From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de ([213.95.11.211]:54874 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752611AbeFDMp1 (ORCPT ); Mon, 4 Jun 2018 08:45:27 -0400 Date: Mon, 4 Jun 2018 14:52:27 +0200 From: Christoph Hellwig To: Andreas Gruenbacher Cc: cluster-devel@redhat.com, Christoph Hellwig , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v7 12/12] iomap: Put struct iomap_ops into struct iomap Message-ID: <20180604125227.GC30780@lst.de> References: <20180604123729.23414-1-agruenba@redhat.com> <20180604123729.23414-13-agruenba@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180604123729.23414-13-agruenba@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Jun 04, 2018 at 02:37:29PM +0200, Andreas Gruenbacher wrote: > We need access to the struct iomap_ops in iomap_write_end to call the > (optional) page_write_end hook, so instead of passing the operators to > iomap_write_end differently depending on the code path, add an ops field > to struct iomap. I don't really like this. We already pass the iomap_ops to the function we call from iomap.c, and in fact ->iomap_begin is called through the ops. But what we could do is to move the page_write_end callback out of iomap_ops and just attached it to the iomap, especially given that it isn't really as generic as the other ops. Can't say I like the implications of this callback in general, but the use case is real, so..