From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: [PATCH 8/11] hfsplus: write up fsync for directories Date: Wed, 17 Nov 2010 23:22:53 +0100 Message-ID: <20101117222253.GI21700@lst.de> References: <20101117222117.GA21700@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: linux-fsdevel@vger.kernel.org Return-path: Received: from verein.lst.de ([213.95.11.210]:38596 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935437Ab0KQWWy (ORCPT ); Wed, 17 Nov 2010 17:22:54 -0500 Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id oAHMMr88021813 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 17 Nov 2010 23:22:53 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-7.2) id oAHMMrbX021812 for linux-fsdevel@vger.kernel.org; Wed, 17 Nov 2010 23:22:53 +0100 Content-Disposition: inline In-Reply-To: <20101117222117.GA21700@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: fsync is supposed to not just work on regular files, but also on directories. Fortunately enough hfsplus_file_fsync works just fine for directories, so we can just wire it up. Signed-off-by: Christoph Hellwig Index: linux-2.6/fs/hfsplus/dir.c =================================================================== --- linux-2.6.orig/fs/hfsplus/dir.c 2010-11-17 17:56:34.456022981 +0100 +++ linux-2.6/fs/hfsplus/dir.c 2010-11-17 17:57:05.398003633 +0100 @@ -485,6 +485,7 @@ const struct inode_operations hfsplus_di }; const struct file_operations hfsplus_dir_operations = { + .fsync = hfsplus_file_fsync, .read = generic_read_dir, .readdir = hfsplus_readdir, .unlocked_ioctl = hfsplus_ioctl, Index: linux-2.6/fs/hfsplus/hfsplus_fs.h =================================================================== --- linux-2.6.orig/fs/hfsplus/hfsplus_fs.h 2010-11-17 17:56:34.443004473 +0100 +++ linux-2.6/fs/hfsplus/hfsplus_fs.h 2010-11-17 17:56:50.548003984 +0100 @@ -352,6 +352,7 @@ int hfsplus_cat_read_inode(struct inode int hfsplus_cat_write_inode(struct inode *); struct inode *hfsplus_new_inode(struct super_block *, int); void hfsplus_delete_inode(struct inode *); +int hfsplus_file_fsync(struct file *file, int datasync); /* ioctl.c */ long hfsplus_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); Index: linux-2.6/fs/hfsplus/inode.c =================================================================== --- linux-2.6.orig/fs/hfsplus/inode.c 2010-11-17 17:56:34.429008943 +0100 +++ linux-2.6/fs/hfsplus/inode.c 2010-11-17 17:56:39.059006079 +0100 @@ -302,7 +302,7 @@ static int hfsplus_setattr(struct dentry return 0; } -static int hfsplus_file_fsync(struct file *file, int datasync) +int hfsplus_file_fsync(struct file *file, int datasync) { struct inode *inode = file->f_mapping->host; struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb);