From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jelinek, Sarah" Subject: Re: Inode metadata and file data syncing Date: Wed, 18 Jul 2012 17:52:21 +0000 Message-ID: References: <20120718172132.GD2112@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT Cc: "linux-fsdevel@vger.kernel.org" To: Josef Bacik Return-path: Received: from mga02.intel.com ([134.134.136.20]:37446 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754021Ab2GRRw3 convert rfc822-to-8bit (ORCPT ); Wed, 18 Jul 2012 13:52:29 -0400 In-Reply-To: <20120718172132.GD2112@localhost.localdomain> Content-Language: en-US Content-ID: <259E868722E5ED49A76DCE7CF1792C64@intel.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi Josef, Thank you! This helps a lot. I hadn't seen the use of write_inode(), or not using it as a way to do this. Regards, sarah On 7/18/12 11:21 AM, "Josef Bacik" wrote: >On Wed, Jul 18, 2012 at 10:53:00AM -0600, Jelinek, Sarah wrote: >> I am in the process of writing a file system in Linux. This file system >> has a separate mechanism by which we manage metadata so I do not want to >> write the file inode metadata to disk without explicitly requesting an >> update. I do need the file data pages to be written to disk as per the >> normal writeback process. >> >> If I use the common mechanism of creating an inode and inserting it into >> the hash via insert_inode_locked(), the inode will be in the I_NEW state >> and when the inode is marked dirty it will be put on the dirty list and >> eventually flushed out to disk. One way I thought I could get around >>this >> is by initializing the inode to i_state = I_DIRTY, skipping I_NEW, and >> using insert_inode_hash() instead, so that if mark_inode_dirty() is >>called >> it won't get put on the dirty list. The issue with this approach is that >> it looks like this inode's pages will not get flushed to disk either >>since >> it won't ever get on the dirty list. I need the pages written just not >>the >> inode itself. >> > >All the major file systems do this currently. If you just don't implement >->write_inode() you can control when the metadata is written out, the >data will >be flushed normally and you can write out the metadata whenever you feel >like >it, like the rest of us do without doing horrible things to the i_state. >Thanks, > >Josef