From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:46430 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933950AbeDXNVM (ORCPT ); Tue, 24 Apr 2018 09:21:12 -0400 Date: Tue, 24 Apr 2018 06:21:07 -0700 From: Christoph Hellwig To: Omar Sandoval Cc: Al Viro , linux-fsdevel@vger.kernel.org, Linus Torvalds , linux-api@vger.kernel.org, kernel-team@fb.com, Xi Wang Subject: Re: [RFC PATCH v3 0/2] fs: add AT_REPLACE flag for linkat() Message-ID: <20180424132107.GA14919@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: > Patch 1 implements the VFS support for this flag. The implementation > resembles sys_renameat2(), and I took care to preserve all of the > original error cases and make the new error cases consistent with > rename. Shouldn't we try to reuse the rename code and the ->rename method instead of largely duplicating it? In fact I wonder if a better interface would just use renameat(2) and accept the AT_EMPTY_PATH (for the source name only).