From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH V2 2/2] hfsplus: Add an ioctl to bless files Date: Mon, 6 Feb 2012 12:35:53 -0500 Message-ID: <20120206173553.GB1135@infradead.org> References: <1328215191-4201-1-git-send-email-mjg@redhat.com> <1328215191-4201-2-git-send-email-mjg@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hch@infradead.org To: Matthew Garrett Return-path: Content-Disposition: inline In-Reply-To: <1328215191-4201-2-git-send-email-mjg@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org +#define HFSPLUS_IOC_BLESS _IO('f', 0x20) I'd probably move this to fs.h and follow the numbering there, otherwise we are bound to run into conflicts. > +static int hfsplus_ioctl_bless(struct file *file, int __user *user_flags) Care to add a little comment on what this ioctl does, bless is a bit of a generic name. > +{ > + struct inode *inode = file->f_dentry->d_inode; Please use file->f_path.dentry instead of the f_dentry define, please. Also given that we use the dentry almost as often I'd pull it into a local variable as well. > + mutex_lock(&sbi->vh_mutex); > + vh->finder_info[0] = bvh->finder_info[0] = > + cpu_to_be32(parent_ino(file->f_dentry)); > + vh->finder_info[1] = bvh->finder_info[1] = cpu_to_be32(inode->i_ino); > + vh->finder_info[5] = bvh->finder_info[5] = > + cpu_to_be32(parent_ino(file->f_dentry)); Any idea why we write the parent twice? Not directly relevant, but where do you plan to put the userspace to call this ioctl?