Return-Path: Received: from out2-smtp.messagingengine.com ([66.111.4.26]:35382 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750717AbcKGFZ3 (ORCPT ); Mon, 7 Nov 2016 00:25:29 -0500 From: Nikolaus Rath To: Jose Lopes Cc: Alexander Viro , linux-fsdevel@vger.kernel.org, fuse-devel@lists.sourceforge.net Subject: Re: [PATCH] Make file struct available to fchmod FS handlers. References: <20161102225340.11613-1-jabolopes@gmail.com> Date: Sun, 06 Nov 2016 21:25:26 -0800 In-Reply-To: <20161102225340.11613-1-jabolopes@gmail.com> (Jose Lopes's message of "Wed, 2 Nov 2016 23:53:40 +0100") Message-ID: <8737j397zt.fsf@vostro.rath.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Nov 03 2016, Jose Lopes wrote: > Syscall 'ftruncate' makes the 'file' struct available to filesystem > handlers. This makes it possible, e.g., for filesystems, such as, > FUSE, to access the file handle associated with the file descriptor > that was passed to 'ftruncate'. In the specific case of FUSE, this > also makes it possible for (userspace) FUSE-based filesystems to > distinguish between calls to 'truncate' and 'ftruncate'. > > From an implementation point of view, this is possible because the > 'ftruncate' syscall passes the 'file' struct to the underlying > filesystem handlers via the 'ia_file' field and the 'ia_valid' field > mask. > > Similarly to 'ftruncate', pass the 'file' struct to 'fchmod', which > allows filesystem handlers to get the file handle associated with the > file descriptor passed to 'fchmod' and allows FUSE-based filesystems > to distinguish between calls to 'chmod' and 'fchmod'. > > In a future patch, make a similar change to the 'fchown' and > 'futimens' syscalls. > > Signed-off-by: Jose Lopes Tested-by: Nikolaus Rath Best, -Nikolaus --=20 GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F =C2=BBTime flies like an arrow, fruit flies like a Banana.=C2= =AB