Re: Re: WAL and commit_delay

From: ncm(at)zembu(dot)com (Nathan Myers)
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: WAL and commit_delay
Date: 2001-02-18 02:13:19
Message-ID: 20010217181319.A16736@store.zembu.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Feb 17, 2001 at 07:34:22PM -0500, Tom Lane wrote:
> ncm(at)zembu(dot)com (Nathan Myers) writes:
> > In the 2.4 kernel it says (fs/buffer.c)
>
> > /* this needs further work, at the moment it is identical to fsync() */
> > down(&inode->i_sem);
> > err = file->f_op->fsync(file, dentry);
> > up(&inode->i_sem);
>
> Hmm, that's the same code that's been there since 2.0 or before.

Indeed. All xterms look alike, and I used one connected to the wrong box.
Here's what's in 2.4.0:

For fsync:

filemap_fdatasync(inode->i_mapping);
err = file->f_op->fsync(file, dentry, 0);
filemap_fdatawait(inode->i_mapping);

and for fdatasync:

filemap_fdatasync(inode->i_mapping);
err = file->f_op->fsync(file, dentry, 1);
filemap_fdatawait(inode->i_mapping);

(Notice the "1" vs. "0" difference?) So the actual file system
(ext2fs, reiserfs, etc.) has the option of equating the two, or not.
In fs/ext2/fsync.c, we have

int ext2_fsync_inode(struct inode *inode, int datasync)
{
int err;
err = fsync_inode_buffers(inode);
if (!(inode->i_state & I_DIRTY))
return err;
if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
return err;
err |= ext2_sync_inode(inode);
return err ? -EIO : 0;
}

I.e. yes, Linux 2.4.0 and ext2 do implement the distinction.
Sorry for the misinformation.

Nathan Myers
ncm(at)zembu(dot)com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-02-18 03:45:18 Re: Re: WAL and commit_delay
Previous Message Roberto Mello 2001-02-18 00:34:22 PL/SQL-to-PL/PgSQL-HOWTO beta Available