From: Miao Xie <miaox@cn.fujitsu.com>
To: viro <viro@zeniv.linux.org.uk>, Chris Mason <chris.mason@oracle.com>
Cc: Linux Fsdevel <linux-fsdevel@vger.kernel.org>,
Linux Btrfs <linux-btrfs@vger.kernel.org>
Subject: [RFC PATCH 1/2] vfs: add an interface to do some preparation for umount
Date: Thu, 22 Mar 2012 11:13:15 +0800 [thread overview]
Message-ID: <4F6A98CB.1070308@cn.fujitsu.com> (raw)
Some file systems can do some works in the background by kthreads, we'd
better stop those works before we umount the file system, or it is easy to
introduce some problems. So we add an interface that is used to do some
preparation for umount.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
fs/namespace.c | 2 ++
include/linux/fs.h | 1 +
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index e608199..f5c1cce 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1173,6 +1173,8 @@ static int do_umount(struct mount *mnt, int flags)
}
br_write_unlock(vfsmount_lock);
up_write(&namespace_sem);
+ if (!retval && sb->s_op->umount_prepare)
+ sb->s_op->umount_prepare(sb);
release_mounts(&umount_list);
return retval;
}
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 69cd5bb..6b9657c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1686,6 +1686,7 @@ struct super_operations {
int (*statfs) (struct dentry *, struct kstatfs *);
int (*remount_fs) (struct super_block *, int *, char *);
void (*umount_begin) (struct super_block *);
+ void (*umount_prepare) (struct super_block *);
int (*show_options)(struct seq_file *, struct dentry *);
int (*show_devname)(struct seq_file *, struct dentry *);
--
1.7.6.5
next reply other threads:[~2012-03-22 3:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-22 3:13 Miao Xie [this message]
2012-03-22 3:41 ` [RFC PATCH 1/2] vfs: add an interface to do some preparation for umount Al Viro
2012-03-22 5:07 ` Miao Xie
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=4F6A98CB.1070308@cn.fujitsu.com \
--to=miaox@cn.fujitsu.com \
--cc=chris.mason@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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).