Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp691805iob; Wed, 18 May 2022 10:43:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJAdyZYeWjBDlQ8Z9ue1iej5NIaRuYKf4INWIiXKM/ZIIkNKevazfXAgzkK3hlOgfA78uH X-Received: by 2002:a63:2c4a:0:b0:3c1:df82:cf0e with SMTP id s71-20020a632c4a000000b003c1df82cf0emr494145pgs.474.1652895826854; Wed, 18 May 2022 10:43:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652895826; cv=none; d=google.com; s=arc-20160816; b=aGl/F3HDn10P4r2PdgDH3QDjjAb5mqjf7iGxuZ1wgWrxo/4uyzaLr1n3ZxpRjrGpNX tieN7UemKJEaIejWRVkDuP4wqXG/EeYfdEjeJnGi+pqVXP2BjalzkIxHuzMiHTtgEttT t9HJ/YVZkD5ziWmswuHAf8qmxj9wc+rz7C++x0iKXkUfIKlyNgoIXJDecphZCFKZ/QP6 YOCP10Vsal9Y9ggHOW3ifcgK3STEbzkSA00hu2w5dFnZK7u3IVsmAplsiSt4FfkMn2Fd 02pacKnJMD1dTYSRqOaaUg3UiqpTAR42DMDMBzCcBfmtplqiw1vr2WslHFXG2OI4RVDg 5K6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=sPnZ+RZGIkLqRaIJaYL7JahMWqDmcz+voS99NuTbAns=; b=NP8dreI2nqHBtWtlwABSlWJJFKM1jueGrJfJvTKb/LseosghhRj/umKJ/N4c+uKpLB QwuXP046n2nYQlALO945CIe75n0ifwptpFWtnjRruwrVnXDWGemPrdvBq9jB8fKL7Op6 03ZLM4MNHOXOoO8cSGBEdS3KyqUkDtKf2PYS8IiyWq/Lm2bywx4nzLWdp+FpnrOEfDmq K6J3ysddlR0z0ElkdEg5+neIAW7z11lN4CmDOLWFVxK/jwOQsmekROkPkxhYBO4Tqo/j hEkoAuOOFGDAaxsDUzSdEhaIGFDmxAgGqmMR2ZiWhgf0e127YWRMuziMnHspeEc7CeVO c5nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VPftXZQz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g20-20020a056a001a1400b0050a99acc9ecsi4374784pfv.45.2022.05.18.10.43.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 10:43:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VPftXZQz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D2ADA719DA; Wed, 18 May 2022 10:41:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241102AbiERRlS (ORCPT + 99 others); Wed, 18 May 2022 13:41:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241137AbiERRlI (ORCPT ); Wed, 18 May 2022 13:41:08 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3EB952BB0D for ; Wed, 18 May 2022 10:41:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652895666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sPnZ+RZGIkLqRaIJaYL7JahMWqDmcz+voS99NuTbAns=; b=VPftXZQzXzQyfrsPGBw0wOyQcYtQPBVJhWoJuJRD46c5M4JPT2oaiXTTPT/wQWVivgbgui GtbTlr3v2qK1NLdFJbnPVrIwxsm3oXIZ065MQ+G0fbT+OOHhRzPhJ+wiLj+Gtt4tj4PGFX KYKDTxUyrmKXXhpEp6zfCrOEa7PCt2s= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-6pijxGN6NR6xvj_bJ_OBrw-1; Wed, 18 May 2022 13:41:03 -0400 X-MC-Unique: 6pijxGN6NR6xvj_bJ_OBrw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 90BB3811E78; Wed, 18 May 2022 17:41:02 +0000 (UTC) Received: from horse.redhat.com (unknown [10.22.16.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id 581882026D2F; Wed, 18 May 2022 17:41:02 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 0C6E22208FA; Wed, 18 May 2022 13:41:02 -0400 (EDT) Date: Wed, 18 May 2022 13:41:01 -0400 From: Vivek Goyal To: Dharmendra Singh Cc: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org, fuse-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, bschubert@ddn.com, Dharmendra Singh Subject: Re: [PATCH v5 1/3] FUSE: Avoid lookups in fuse create Message-ID: References: <20220517100744.26849-1-dharamhans87@gmail.com> <20220517100744.26849-2-dharamhans87@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220517100744.26849-2-dharamhans87@gmail.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 17, 2022 at 03:37:42PM +0530, Dharmendra Singh wrote: [..] > diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h > index d6ccee961891..bebe4be3f1cb 100644 > --- a/include/uapi/linux/fuse.h > +++ b/include/uapi/linux/fuse.h > @@ -301,6 +301,7 @@ struct fuse_file_lock { > * FOPEN_CACHE_DIR: allow caching this directory > * FOPEN_STREAM: the file is stream-like (no file position at all) > * FOPEN_NOFLUSH: don't flush data cache on close (unless FUSE_WRITEBACK_CACHE) > + * FOPEN_FILE_CREATED: the file was actually created > */ > #define FOPEN_DIRECT_IO (1 << 0) > #define FOPEN_KEEP_CACHE (1 << 1) > @@ -308,6 +309,7 @@ struct fuse_file_lock { > #define FOPEN_CACHE_DIR (1 << 3) > #define FOPEN_STREAM (1 << 4) > #define FOPEN_NOFLUSH (1 << 5) > +#define FOPEN_FILE_CREATED (1 << 6) > > /** > * INIT request/reply flags > @@ -537,6 +539,7 @@ enum fuse_opcode { > FUSE_SETUPMAPPING = 48, > FUSE_REMOVEMAPPING = 49, > FUSE_SYNCFS = 50, > + FUSE_CREATE_EXT = 51, I am wondering if we really have to introduce a new opcode for this. Both FUSE_CREATE and FUSE_CREATE_EXT prepare and send fuse_create_in{} and expect fuse_entry_out and fuse_open_out in response. So no new structures are being added. Only thing FUSE_CREATE_EXT does extra is that it also reports back whether file was actually created or not. May be instead of adding an new fuse_opcode, we could simply add a new flag which we send in fuse_create_in and that reqeusts to report if file was created or not. This is along the lines of FUSE_OPEN_KILL_SUIDGID. So say, a new flag FUSE_OPEN_REPORT_CREATE flag. Which we will set in fuse_create_in->open_flags. If file server sees this flag is set, it knows that it needs to set FOPEN_FILE_CREATED flag in response. To me creating a new flag FUSE_OPEN_REPORT_CREATE seems better instead of adding a new opcode. Thanks Vivek > > /* CUSE specific operations */ > CUSE_INIT = 4096, > -- > 2.17.1 >