From: Colin Leroy <colin@colino.net>
To: linux-kernel@vger.kernel.org
Cc: hirofumi@mail.parknet.co.jp
Subject: [PATCH] let vfat handle MS_SYNCHRONOUS flag
Date: Thu, 18 Nov 2004 19:51:29 +0100 [thread overview]
Message-ID: <20041118195129.432f4110.colin@colino.net> (raw)
In-Reply-To: <20041118194959.3f1a3c8e.colin@colino.net>
On 18 Nov 2004 at 19h11, Colin Leroy wrote:
Hi,
Same patch for vfat.
Signed-off-by: Colin Leroy <colin@colino.net>
--- a/fs/vfat/namei.c 2004-10-18 23:54:37.000000000 +0200
+++ b/fs/vfat/namei.c 2004-11-18 18:41:52.000000000 +0100
@@ -743,6 +743,8 @@
(*de)->adate = (*de)->cdate = (*de)->date;
mark_buffer_dirty(*bh);
+ if (dir->i_sb->s_flags & MS_SYNCHRONOUS)
+ sync_dirty_buffer(*bh);
/* slots can't be less than 1 */
sinfo_out->long_slots = slots - 1;
@@ -844,7 +846,6 @@
if (res < 0)
goto out;
inode = fat_build_inode(sb, de, sinfo.i_pos, &res);
- brelse(bh);
if (!inode)
goto out;
res = 0;
@@ -854,7 +855,10 @@
dir->i_version++;
dentry->d_time = dentry->d_parent->d_inode->i_version;
d_instantiate(dentry,inode);
+ if (sb->s_flags & MS_SYNCHRONOUS)
+ sync_dirty_buffer(bh);
out:
+ brelse(bh);
unlock_kernel();
return res;
}
@@ -871,6 +875,7 @@
mark_inode_dirty(dir);
de->name[0] = DELETED_FLAG;
mark_buffer_dirty(bh);
+
/* remove the longname */
offset = sinfo->longname_offset; de = NULL;
for (i = sinfo->long_slots; i > 0; --i) {
@@ -880,6 +885,9 @@
de->attr = ATTR_NONE;
mark_buffer_dirty(bh);
}
+ if (dir->i_sb->s_flags & MS_SYNCHRONOUS)
+ sync_dirty_buffer(bh);
+
brelse(bh);
}
@@ -903,7 +911,7 @@
dentry->d_inode->i_mtime = dentry->d_inode->i_atime = CURRENT_TIME;
fat_detach(dentry->d_inode);
mark_inode_dirty(dentry->d_inode);
- /* releases bh */
+ /* releases bh and syncs it if necessary */
vfat_remove_entry(dir,&sinfo,bh,de);
dir->i_nlink--;
out:
@@ -926,7 +934,7 @@
dentry->d_inode->i_mtime = dentry->d_inode->i_atime = CURRENT_TIME;
fat_detach(dentry->d_inode);
mark_inode_dirty(dentry->d_inode);
- /* releases bh */
+ /* releases bh and syncs it if necessary */
vfat_remove_entry(dir,&sinfo,bh,de);
out:
unlock_kernel();
@@ -956,6 +964,10 @@
dir->i_version++;
dir->i_nlink++;
inode->i_nlink = 2; /* no need to mark them dirty */
+
+ if (sb->s_flags & MS_SYNCHRONOUS)
+ sync_dirty_buffer(bh);
+
res = fat_new_dir(inode, dir, 1);
if (res < 0)
goto mkdir_failed;
@@ -972,7 +984,7 @@
inode->i_mtime = inode->i_atime = CURRENT_TIME;
fat_detach(inode);
mark_inode_dirty(inode);
- /* releases bh */
+ /* releases bh ands syncs if necessary */
vfat_remove_entry(dir,&sinfo,bh,de);
iput(inode);
dir->i_nlink--;
@@ -1057,6 +1069,8 @@
new_dir->i_nlink++;
mark_inode_dirty(new_dir);
}
+ if (new_dir->i_sb->s_flags & MS_SYNCHRONOUS)
+ sync_dirty_buffer(dotdot_bh);
}
rename_done:
next prev parent reply other threads:[~2004-11-18 18:56 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-18 18:49 [PATCH] let fat " Colin Leroy
2004-11-18 18:51 ` Colin Leroy [this message]
2004-11-23 19:32 ` Colin Leroy
2004-11-23 20:24 ` OGAWA Hirofumi
2004-11-24 3:20 ` Matt Mackall
2004-11-24 5:00 ` OGAWA Hirofumi
2004-11-24 5:35 ` Matt Mackall
2004-11-24 6:26 ` OGAWA Hirofumi
2004-11-24 6:40 ` Andrew Morton
2004-11-24 6:49 ` Matt Mackall
2004-11-24 6:57 ` Andrew Morton
2004-11-24 13:26 ` OGAWA Hirofumi
2004-11-24 5:41 ` Bernd Eckenfels
2004-11-24 7:30 ` Colin Leroy
2004-11-24 3:17 ` Matt Mackall
2004-11-24 7:34 ` Colin Leroy
2004-11-24 7:50 ` Matt Mackall
2004-11-24 8:40 ` Colin Leroy
2004-11-24 14:02 ` OGAWA Hirofumi
2004-11-24 14:25 ` Colin Leroy
2004-11-24 15:02 ` Colin Leroy
2004-11-24 18:10 ` OGAWA Hirofumi
2004-11-24 20:28 ` Colin Leroy
[not found] ` <87k6saunwl.fsf@devron.myhome.or.jp>
2004-11-25 12:47 ` Colin Leroy
[not found] ` <87act6ulc5.fsf@devron.myhome.or.jp>
2004-11-25 13:11 ` Colin Leroy
2004-12-29 19:33 ` Robert Hardy
2004-12-30 3:02 ` OGAWA Hirofumi
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=20041118195129.432f4110.colin@colino.net \
--to=colin@colino.net \
--cc=hirofumi@mail.parknet.co.jp \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®