linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@sun.com>
To: Abhijit Paithankar <apaithan@akamai.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [RFC PATCH] Filesystem Journal Notifications
Date: Sun, 14 Sep 2008 19:31:26 -0700	[thread overview]
Message-ID: <20080915023126.GF4090@webber.adilger.int> (raw)
In-Reply-To: <20080912220649.GB26999@apaithan-desktop.sanmateo.corp.akamai.com>

On Sep 12, 2008  15:06 -0700, Abhijit Paithankar wrote:
> On journaling file systems, applications need to know when the meta-data
> changes to files are written to disks in a manner which is persistent to
> crashes and reboots.
> 
> One way to do it is to fsync every few operations. However, fsync is
> blocking and affects performance.
> 
> The other (more efficient) way is to have the filesystem notify the
> application when a transaction/change is written to disk.
> 
> This patch implements such a notification mechanism based on inotify for
> Ext3 and Ext4.
> 
> Every time an application creates, renames, unlinks, etc a file or
> directory, a journal_cookie is sent via the inotify mechanism. Ofcourse,
> the application has to first register for such notifications on the
> files/directories of interest.
> 
> Once the transaction corresponding to that journal_cookie is committed
> to the journal another notification is sent to the application
> indicating that the change is now persistent.

We had a much more flexible journal commit notification mechanism.  The
caller would register a callback with the journal layer that contained
a caller-private callback function and callback data.  This avoided
exposing the journal transaction IDs outside of the filesystem, and the
caller could use any identifier desired.

There was also no limit on the number/type of callbacks registered with
the filesystem.  The basic data structure was a linked list of callbacks
registered on the transaction:

struct journal_callback {
       struct list_head jcb_list;
       void (*jcb_func)(struct journal_callback *jcb, int error);
       /* caller data goes here */
};

and in journal_commit_transaction() the callbacks are called:

               list_for_each_entry_safe(jcb, n, &commit_transaction->t_jcb,
					jcb_list) {
                       list_del_init(&jcb->jcb_list);
                       jcb->jcb_func(jcb, error);
               }


Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.


  parent reply	other threads:[~2008-09-15  2:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-12 22:06 [RFC PATCH] Filesystem Journal Notifications Abhijit Paithankar
2008-09-13  9:19 ` Dave Chinner
2008-09-15  2:31 ` Andreas Dilger [this message]
2008-09-15  5:39   ` Andreas Dilger
2008-09-15 19:36     ` Abhijit Paithankar
2008-09-15 23:37       ` Andreas Dilger
2008-09-16 23:05         ` Abhijit Paithankar
2008-09-19 20:34           ` Andreas Dilger
2008-09-20 15:51             ` Jamie Lokier
2008-09-20  5:15       ` Jan Kara
2008-09-23 22:26         ` Andreas Dilger
2008-09-15 13:23 ` Jamie Lokier
2008-09-17  0:06   ` Abhijit Paithankar
2008-09-17 11:35     ` Jamie Lokier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080915023126.GF4090@webber.adilger.int \
    --to=adilger@sun.com \
    --cc=apaithan@akamai.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).