diff options
author | npiggin@suse.de <npiggin@suse.de> | 2009-04-26 06:25:56 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-11 21:36:02 -0400 |
commit | 864d7c4c068f23642efe91b33be3a84afe5f71e0 (patch) | |
tree | 512b253428958e95ca99274a664ace103f6bb10e /fs/super.c | |
parent | 96029c4e09ccbd73a6d0ed2b29e80bf2586ad7ef (diff) |
fs: move mark_files_ro into file_table.c
This function walks the s_files lock, and operates primarily on the
files in a superblock, so it better belongs here (eg. see also
fs_may_remount_ro).
[AV: ... and it shouldn't be static after that move]
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/super.c')
-rw-r--r-- | fs/super.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/fs/super.c b/fs/super.c index 1943fdf655fa..c170551c23fe 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -616,45 +616,6 @@ out: | |||
616 | } | 616 | } |
617 | 617 | ||
618 | /** | 618 | /** |
619 | * mark_files_ro - mark all files read-only | ||
620 | * @sb: superblock in question | ||
621 | * | ||
622 | * All files are marked read-only. We don't care about pending | ||
623 | * delete files so this should be used in 'force' mode only. | ||
624 | */ | ||
625 | |||
626 | static void mark_files_ro(struct super_block *sb) | ||
627 | { | ||
628 | struct file *f; | ||
629 | |||
630 | retry: | ||
631 | file_list_lock(); | ||
632 | list_for_each_entry(f, &sb->s_files, f_u.fu_list) { | ||
633 | struct vfsmount *mnt; | ||
634 | if (!S_ISREG(f->f_path.dentry->d_inode->i_mode)) | ||
635 | continue; | ||
636 | if (!file_count(f)) | ||
637 | continue; | ||
638 | if (!(f->f_mode & FMODE_WRITE)) | ||
639 | continue; | ||
640 | f->f_mode &= ~FMODE_WRITE; | ||
641 | if (file_check_writeable(f) != 0) | ||
642 | continue; | ||
643 | file_release_write(f); | ||
644 | mnt = mntget(f->f_path.mnt); | ||
645 | file_list_unlock(); | ||
646 | /* | ||
647 | * This can sleep, so we can't hold | ||
648 | * the file_list_lock() spinlock. | ||
649 | */ | ||
650 | mnt_drop_write(mnt); | ||
651 | mntput(mnt); | ||
652 | goto retry; | ||
653 | } | ||
654 | file_list_unlock(); | ||
655 | } | ||
656 | |||
657 | /** | ||
658 | * do_remount_sb - asks filesystem to change mount options. | 619 | * do_remount_sb - asks filesystem to change mount options. |
659 | * @sb: superblock in question | 620 | * @sb: superblock in question |
660 | * @flags: numeric part of options | 621 | * @flags: numeric part of options |