From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f196.google.com ([209.85.128.196]:41682 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750879AbeFDRAW (ORCPT ); Mon, 4 Jun 2018 13:00:22 -0400 Received: by mail-wr0-f196.google.com with SMTP id h10-v6so3633727wrq.8 for ; Mon, 04 Jun 2018 10:00:22 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20180604125227.GC30780@lst.de> References: <20180604123729.23414-1-agruenba@redhat.com> <20180604123729.23414-13-agruenba@redhat.com> <20180604125227.GC30780@lst.de> From: =?UTF-8?Q?Andreas_Gr=C3=BCnbacher?= Date: Mon, 4 Jun 2018 19:00:21 +0200 Message-ID: Subject: Re: [PATCH v7 12/12] iomap: Put struct iomap_ops into struct iomap To: Christoph Hellwig Cc: Andreas Gruenbacher , cluster-devel , Linux FS-devel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 2018-06-04 14:52 GMT+02:00 Christoph Hellwig : > 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. There's no duplicate ops passing going on if that's what you mean. > 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. Given that struct iomap is allocated inside iomap_apply(), if page_write_end is moved to struct iomap, how would the filesystem set it? > Can't say I like the implications of this callback in general, but > the use case is real, so.. Yes, it's not very pretty. Thanks, Andreas