From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Pekka Enberg" Subject: Re: [PATCH 19 of 23] Unionfs: Helper macros/inlines Date: Fri, 13 Oct 2006 11:23:51 +0300 Message-ID: <84144f020610130123u1f7b9d2cve36c0242a6bc037@mail.gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, torvalds@osdl.org, akpm@osdl.org, hch@infradead.org, viro@ftp.linux.org.uk Return-path: Received: from nf-out-0910.google.com ([64.233.182.186]:52786 "EHLO nf-out-0910.google.com") by vger.kernel.org with ESMTP id S1750743AbWJMIXx (ORCPT ); Fri, 13 Oct 2006 04:23:53 -0400 Received: by nf-out-0910.google.com with SMTP id x30so871983nfb for ; Fri, 13 Oct 2006 01:23:51 -0700 (PDT) To: "Josef Jeff Sipek" In-Reply-To: Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hi Josef, The names of some of these macros are somewhat unreadable. On 10/7/06, Josef Jeff Sipek wrote: > +/* Inode to private data */ > +static inline struct unionfs_inode_info *itopd(const struct inode *inode) > +{ > + return > + &(container_of(inode, struct unionfs_inode_container, vfs_inode)-> > + info); > +} Rename to unionfs_inode? > +#define itohi_ptr(ino) (itopd(ino)->uii_inode) unionfs_hidden_inodes ? > +#define ibstart(ino) (itopd(ino)->b_start) unionfs_inode_branch_start ? > +#define ibend(ino) (itopd(ino)->b_end) unionfs_inode_branch_end ? > +#define stopd(super) ((struct unionfs_sb_info *)(super)->s_fs_info) unionfs_sb_info ? > +#define stopd_lhs(super) ((super)->s_fs_info) This you should drop. > +#define sbstart(sb) 0 unionfs_sb_branch_start? > +#define sbend(sb) stopd(sb)->b_end unionfs_sb_branch_end? > +#define sbmax(sb) (stopd(sb)->b_end + 1) unionfs_sb_branch_max? > +#define ftopd(file) ((struct unionfs_file_info *)((file)->private_data)) unionfs_file_info ? > +#define ftopd_lhs(file) ((file)->private_data) This you should drop. > +#define ftohf_ptr(file) (ftopd(file)->ufi_file) unionfs_hidden_files ? > +#define fbstart(file) (ftopd(file)->b_start) unionfs_file_branch_start ? > +#define fbend(file) (ftopd(file)->b_end) unionfs_file_branch_end ? > + > +/* File to hidden file. */ > +static inline struct file *ftohf(struct file *f) > +{ > + return ftopd(f)->ufi_file[fbstart(f)]; > +} unionfs_hidden_file ? > + > +static inline struct file *ftohf_index(const struct file *f, int index) > +{ > + return ftopd(f)->ufi_file[index]; > +} __unionfs_hidden_file (and make the above use this too)? > + > +static inline void set_ftohf_index(struct file *f, int index, struct file *val) > +{ > + ftopd(f)->ufi_file[index] = val; > +} __unionfs_set_hidden_file ? > + > +static inline void set_ftohf(struct file *f, struct file *val) > +{ > + ftopd(f)->ufi_file[fbstart(f)] = val; > +} unionfs_set_hidden_file ? [Same comments apply for the rest.]