From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <56CCAB61.20206@hpe.com> Date: Tue, 23 Feb 2016 13:56:33 -0500 From: Waiman Long MIME-Version: 1.0 To: Dave Chinner CC: Alexander Viro , Jan Kara , Jeff Layton , "J. Bruce Fields" , Tejun Heo , Christoph Lameter , , , Ingo Molnar , Peter Zijlstra , Andi Kleen , Dave Chinner , Scott J Norton , Douglas Hatch Subject: Re: [PATCH v2 3/3] vfs: Use per-cpu list for superblock's inode list References: <1455916245-32707-1-git-send-email-Waiman.Long@hpe.com> <1455916245-32707-4-git-send-email-Waiman.Long@hpe.com> <20160221213419.GB25832@dastard> In-Reply-To: <20160221213419.GB25832@dastard> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: On 02/21/2016 04:34 PM, Dave Chinner wrote: > On Fri, Feb 19, 2016 at 04:10:45PM -0500, Waiman Long wrote: >> +/* >> + * Superblock's inode list iterator function and arguments macros >> + */ >> +#define SB_INODES_ITER_FUNC(name, lock, struct_fields) \ >> + struct name ## _arg { \ >> + struct_fields; \ >> + }; \ >> + static int name ## _iter(struct pcpu_list_node *_node, \ >> + struct pcpu_list_node **_pnext, \ >> + spinlock_t *lock, void *_arg) >> + >> +#define SB_INODES_ITER_ARGS(name, i, a) \ >> + struct inode *i = container_of(_node, struct inode, i_sb_list); \ >> + struct name ## _arg *a = (struct name ## _arg *)_arg >> + >> +#define SB_INODES_ITER_ARGS_SAFE(name, i, n, a) \ >> + struct inode *i = container_of(_node, struct inode, i_sb_list); \ >> + struct inode *n = container_of(*_pnext, struct inode, i_sb_list);\ >> + struct name ## _arg *a = (struct name ## _arg *)_arg >> + >> +#define SB_INODES_ITER_SET_PCPU_LIST_NEXT(n) \ >> + { *_pnext =&(n)->i_sb_list; } >> + >> +#define SB_INODES_ITER_CALL(name, sb) \ >> + pcpu_list_iterate(sb->s_inodes, false, NULL, name ## _iter,&arg) >> + >> +#define SB_INODES_ITER_CALL_SAFE(name, sb, phead) \ >> + pcpu_list_iterate(sb->s_inodes, true, phead, name ## _iter,&arg) >> + > No, just no. > > Ungreppable, breaks cscope, obfuscates everything, shouts a lot, > code using the API looks completely broken (e.g. semi-colons in > "function declarations"), and it reminds me of the worst of the > worst unmaintainable code in an exceedingly buggy and undebuggable > proprietary filesystem I've previously had the "joy" of working > with. > > Just fix the bug in the previous version; it's so much cleaner than > this .... mess. > > Cheers, > > Dave. Sorry for that. I will scrap the current approach and use another way to iterate the list instead. I will send out an updated patch soon. Cheers, Longman