From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752810AbbF1TwU (ORCPT ); Sun, 28 Jun 2015 15:52:20 -0400 Received: from mail-ig0-f177.google.com ([209.85.213.177]:34438 "EHLO mail-ig0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752209AbbF1TwL (ORCPT ); Sun, 28 Jun 2015 15:52:11 -0400 MIME-Version: 1.0 In-Reply-To: References: Date: Sun, 28 Jun 2015 12:52:11 -0700 X-Google-Sender-Auth: AVcaDgk9YwVvcdBlk46s2XD1cNE Message-ID: Subject: Re: [PATCH] hpfs: add fstrim support From: Linus Torvalds To: Mikulas Patocka , Al Viro , "Ted Ts'o" Cc: Linux Kernel Mailing List , linux-fsdevel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 28, 2015 at 6:16 AM, Mikulas Patocka wrote: > This patch adds support for fstrim to the HPFS filesystem. ... > +#ifdef CONFIG_COMPAT > + .compat_ioctl = hpfs_compat_ioctl, > +#endif ... > +#ifdef CONFIG_COMPAT > + .compat_ioctl = hpfs_compat_ioctl, > +#endif ... > +#ifdef CONFIG_COMPAT > +long hpfs_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg) > +{ > + return hpfs_ioctl(file, cmd, (unsigned long)compat_ptr(arg)); > +} > +#endif Hmm. You've clearly copied this pattern from other filesystems, and so I can't really blame you, but this thing annoys me a lot. Why isn't FITRIM just marked as a COMPATIBLE_IOCTL(), at which point the generic ioctl layer will do exactly the above translation for us? Am I missing something? Linus