From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot0-f193.google.com ([74.125.82.193]:44658 "EHLO mail-ot0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751844AbeEPLhW (ORCPT ); Wed, 16 May 2018 07:37:22 -0400 Received: by mail-ot0-f193.google.com with SMTP id g7-v6so471962otj.11 for ; Wed, 16 May 2018 04:37:22 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1526379972-20923-1-git-send-email-amir73il@gmail.com> <1526379972-20923-4-git-send-email-amir73il@gmail.com> From: Miklos Szeredi Date: Wed, 16 May 2018 13:37:21 +0200 Message-ID: Subject: Re: [PATCH v3 3/4] ovl: create helper ovl_create_temp() To: Amir Goldstein Cc: Al Viro , Vivek Goyal , overlayfs , linux-fsdevel Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, May 16, 2018 at 1:15 PM, Amir Goldstein wrote: >>> @@ -160,6 +160,26 @@ int ovl_create_real(struct inode *dir, struct dentry *newdentry, >>> return err; >>> } >>> >>> +struct dentry *ovl_create_temp(struct dentry *workdir, struct cattr *attr, >>> + struct dentry *hardlink) >> >> Talking of cleanups, can we put hardlink into cattr as well? (separate patch) >> > > OK. If you don't mind, I'll use this opportunity to also namespace > it to ovl_cattr. Good idea. > >>> +{ >>> + struct inode *wdir = workdir->d_inode; >>> + struct dentry *temp; >>> + int err; >>> + >>> + temp = ovl_lookup_temp(workdir); >>> + if (IS_ERR(temp)) >>> + return temp; >> >> What's wrong with viro's version of dentry in ovl_create_real()? >> Turns this whole function into: >> >> return ovl_create_real(d_inode(workdir), >> ovl_lookup_temp(workdir), attr, hardlink, true); > > Nothing. A matter of taste. If you like Al's version better, > I'll add it back in the next patch. Al's version is the functional style yours is the procedural. I think in this particular case the functional version looks nicer. Thanks, Miklos