From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Kleikamp Subject: Re: mark_inode_dirty vs mark_inode_dirty_sync Date: Fri, 02 Sep 2005 07:42:39 -0500 Message-ID: <1125664959.9401.15.camel@kleikamp.austin.ibm.com> References: <17AB476A04B7C842887E0EB1F268111E026F3E@xpserver.intra.lexbox.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from e35.co.us.ibm.com ([32.97.110.133]:65246 "EHLO e35.co.us.ibm.com") by vger.kernel.org with ESMTP id S1751297AbVIBMmm (ORCPT ); Fri, 2 Sep 2005 08:42:42 -0400 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e35.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j82CgfcJ143236 for ; Fri, 2 Sep 2005 08:42:41 -0400 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j82CgeRK481030 for ; Fri, 2 Sep 2005 06:42:40 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id j82Cgedw012691 for ; Fri, 2 Sep 2005 06:42:40 -0600 To: David Sanchez In-Reply-To: <17AB476A04B7C842887E0EB1F268111E026F3E@xpserver.intra.lexbox.org> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Fri, 2005-09-02 at 11:55 +0200, David Sanchez wrote: > Hi, > Please, could somebody explain me what the mark_inode_dirty* functions > do and what is the difference between mark_inode_dirty and > mark_inode_dirty_sync ? They put the inode on the superblock's dirty list and make the inode as dirty in the i_state field. This makes sure that the inode will eventually be written to disk. mark_inode_dirty_sync only sets the I_DIRTY_SYNC flag, which does not imply that any file data was changed. It is called when a minor change is made to an inode, such as a timestamp is changed. Some sync operations will only write the inode if data was written, so can avoid writing the an inode that is only dirtied by I_DIRTY_SYNC. mark_inode_dirty sets I_DIRTY which is I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES. This indicates that the in-memory inode has changes to the data that have not yet been written to disk. Shaggy -- David Kleikamp IBM Linux Technology Center