From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 844BCC433FE for ; Wed, 18 May 2022 17:41:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241105AbiERRlT (ORCPT ); Wed, 18 May 2022 13:41:19 -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 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 >