Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754579AbYAOSFQ (ORCPT ); Tue, 15 Jan 2008 13:05:16 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751417AbYAOSFE (ORCPT ); Tue, 15 Jan 2008 13:05:04 -0500 Received: from pentafluge.infradead.org ([213.146.154.40]:38769 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbYAOSFC (ORCPT ); Tue, 15 Jan 2008 13:05:02 -0500 Date: Tue, 15 Jan 2008 18:04:55 +0000 From: Christoph Hellwig To: Anton Salikhmetov Cc: linux-mm@kvack.org, jakob@unthought.net, linux-kernel@vger.kernel.org, valdis.kletnieks@vt.edu, riel@redhat.com, ksm@42.dk, staubach@redhat.com, jesper.juhl@gmail.com, torvalds@linux-foundation.org, a.p.zijlstra@chello.nl, akpm@linux-foundation.org, protasnb@gmail.com, miklos@szeredi.hu Subject: Re: [PATCH 2/2] Updating ctime and mtime at syncing Message-ID: <20080115180455.GB21557@infradead.org> References: <12004129652397-git-send-email-salikhmetov@gmail.com> <1200412978699-git-send-email-salikhmetov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1200412978699-git-send-email-salikhmetov@gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 837 Lines: 26 On Tue, Jan 15, 2008 at 07:02:45PM +0300, Anton Salikhmetov wrote: > +/* > + * Update the ctime and mtime stamps for memory-mapped block device files. > + */ > +static void bd_inode_update_time(struct inode *inode, struct timespec *ts) > +{ > + struct block_device *bdev = inode->i_bdev; > + struct list_head *p; > + > + if (bdev == NULL) > + return; inode->i_bdev is never NULL for inodes currently beeing written to. > + > + mutex_lock(&bdev->bd_mutex); > + list_for_each(p, &bdev->bd_inodes) { > + inode = list_entry(p, struct inode, i_devices); this should use list_for_each_entry. -- 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/