From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 06/25] vfs: add i_op->atomic_create() Date: Tue, 13 Mar 2012 05:37:20 -0400 Message-ID: <20120313093720.GC11797@infradead.org> References: <1331155362-11132-1-git-send-email-miklos@szeredi.hu> <1331155362-11132-7-git-send-email-miklos@szeredi.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: viro@ZenIV.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hch@infradead.org, Trond.Myklebust@netapp.com, sfrench@samba.org, sage@newdream.net, ericvh@gmail.com, mszeredi@suse.cz To: Miklos Szeredi Return-path: Received: from 173-166-109-252-newengland.hfc.comcastbusiness.net ([173.166.109.252]:48748 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760159Ab2CMJhV (ORCPT ); Tue, 13 Mar 2012 05:37:21 -0400 Content-Disposition: inline In-Reply-To: <1331155362-11132-7-git-send-email-miklos@szeredi.hu> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Mar 07, 2012 at 10:22:23PM +0100, Miklos Szeredi wrote: > From: Miklos Szeredi > > Add a new inode operation which is called on regular file create. This is a > replacement for ->create() which allows the file to be opened atomically with > creation. > > This function is also called for non-open creates (mknod(2)) with a NULL file > argument. Only one of ->create or ->atomic_create will be called, implementing > both makes no sense. > > The functionality of this method partially overlaps that of ->atomic_open(). > FUSE and 9P only use ->atomic_create, NFS, CIFS and CEPH use both. I really don't like the special casing of the mknod handling in every atomic_create instance. Either we should keep ->create for it, or do a cleanup pass before to always make that pass go through ->mknod - in fact most filesystems handle the two in common code anyway so we might be able to get rid of one of them, possible mkdir as well.