Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965047AbWBGU1L (ORCPT ); Tue, 7 Feb 2006 15:27:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S965071AbWBGU1K (ORCPT ); Tue, 7 Feb 2006 15:27:10 -0500 Received: from mx1.redhat.com ([66.187.233.31]:45976 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S964881AbWBGU1I (ORCPT ); Tue, 7 Feb 2006 15:27:08 -0500 Date: Tue, 7 Feb 2006 15:26:55 -0500 From: Dave Jones To: James Bottomley Cc: linux-kernel , linux-scsi , Andrew Morton Subject: Re: [PATCH] add execute_in_process_context() API Message-ID: <20060207202655.GD24775@redhat.com> Mail-Followup-To: Dave Jones , James Bottomley , linux-kernel , linux-scsi , Andrew Morton References: <1139342419.6065.8.camel@mulgrave.il.steeleye.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1139342419.6065.8.camel@mulgrave.il.steeleye.com> User-Agent: Mutt/1.4.2.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 922 Lines: 35 On Tue, Feb 07, 2006 at 02:00:19PM -0600, James Bottomley wrote: > +int execute_in_process_context(void (*fn)(void *data), void *data) > +{ > + struct work_queue_work *wqw; > + > + if (!in_interrupt()) { > + fn(data); > + return 0; > + } > + > + wqw = kmalloc(sizeof(struct work_queue_work), GFP_ATOMIC); > + > + if (unlikely(!wqw)) { > + printk(KERN_ERR "Failed to allocate memory\n"); > + WARN_ON(1); > + return -ENOMEM; > + } > + > + INIT_WORK(&wqw->work, execute_in_process_context_work, wqw); > + wqw->fn = fn; > + wqw->data = data; > + schedule_work(&wqw->work); > + > + return 1; > +} After the workqueue has run, what free's wqw ? Dave - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/