diff options
| author | Anton Altaparmakov <aia21@cantab.net> | 2006-01-19 11:39:33 -0500 |
|---|---|---|
| committer | Anton Altaparmakov <aia21@cantab.net> | 2006-01-19 11:39:33 -0500 |
| commit | 944d79559d154c12becde0dab327016cf438f46c (patch) | |
| tree | 50c101806f4d3b6585222dda060559eb4f3e005a /fs/ntfs/super.c | |
| parent | d087e4bdd24ebe3ae3d0b265b6573ec901af4b4b (diff) | |
| parent | 0f36b018b2e314d45af86449f1a97facb1fbe300 (diff) | |
Merge branch 'master' of /usr/src/ntfs-2.6/
Diffstat (limited to 'fs/ntfs/super.c')
| -rw-r--r-- | fs/ntfs/super.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 6c16db9e1a8a..c3a3f1a8310b 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c | |||
| @@ -443,8 +443,8 @@ static int ntfs_remount(struct super_block *sb, int *flags, char *opt) | |||
| 443 | 443 | ||
| 444 | ntfs_debug("Entering with remount options string: %s", opt); | 444 | ntfs_debug("Entering with remount options string: %s", opt); |
| 445 | #ifndef NTFS_RW | 445 | #ifndef NTFS_RW |
| 446 | /* For read-only compiled driver, enforce all read-only flags. */ | 446 | /* For read-only compiled driver, enforce read-only flag. */ |
| 447 | *flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME; | 447 | *flags |= MS_RDONLY; |
| 448 | #else /* NTFS_RW */ | 448 | #else /* NTFS_RW */ |
| 449 | /* | 449 | /* |
| 450 | * For the read-write compiled driver, if we are remounting read-write, | 450 | * For the read-write compiled driver, if we are remounting read-write, |
| @@ -1213,10 +1213,10 @@ static int check_windows_hibernation_status(ntfs_volume *vol) | |||
| 1213 | * Find the inode number for the hibernation file by looking up the | 1213 | * Find the inode number for the hibernation file by looking up the |
| 1214 | * filename hiberfil.sys in the root directory. | 1214 | * filename hiberfil.sys in the root directory. |
| 1215 | */ | 1215 | */ |
| 1216 | down(&vol->root_ino->i_sem); | 1216 | mutex_lock(&vol->root_ino->i_mutex); |
| 1217 | mref = ntfs_lookup_inode_by_name(NTFS_I(vol->root_ino), hiberfil, 12, | 1217 | mref = ntfs_lookup_inode_by_name(NTFS_I(vol->root_ino), hiberfil, 12, |
| 1218 | &name); | 1218 | &name); |
| 1219 | up(&vol->root_ino->i_sem); | 1219 | mutex_unlock(&vol->root_ino->i_mutex); |
| 1220 | if (IS_ERR_MREF(mref)) { | 1220 | if (IS_ERR_MREF(mref)) { |
| 1221 | ret = MREF_ERR(mref); | 1221 | ret = MREF_ERR(mref); |
| 1222 | /* If the file does not exist, Windows is not hibernated. */ | 1222 | /* If the file does not exist, Windows is not hibernated. */ |
| @@ -1307,10 +1307,10 @@ static BOOL load_and_init_quota(ntfs_volume *vol) | |||
| 1307 | * Find the inode number for the quota file by looking up the filename | 1307 | * Find the inode number for the quota file by looking up the filename |
| 1308 | * $Quota in the extended system files directory $Extend. | 1308 | * $Quota in the extended system files directory $Extend. |
| 1309 | */ | 1309 | */ |
| 1310 | down(&vol->extend_ino->i_sem); | 1310 | mutex_lock(&vol->extend_ino->i_mutex); |
| 1311 | mref = ntfs_lookup_inode_by_name(NTFS_I(vol->extend_ino), Quota, 6, | 1311 | mref = ntfs_lookup_inode_by_name(NTFS_I(vol->extend_ino), Quota, 6, |
| 1312 | &name); | 1312 | &name); |
| 1313 | up(&vol->extend_ino->i_sem); | 1313 | mutex_unlock(&vol->extend_ino->i_mutex); |
| 1314 | if (IS_ERR_MREF(mref)) { | 1314 | if (IS_ERR_MREF(mref)) { |
| 1315 | /* | 1315 | /* |
| 1316 | * If the file does not exist, quotas are disabled and have | 1316 | * If the file does not exist, quotas are disabled and have |
| @@ -1390,10 +1390,10 @@ static BOOL load_and_init_usnjrnl(ntfs_volume *vol) | |||
| 1390 | * Find the inode number for the transaction log file by looking up the | 1390 | * Find the inode number for the transaction log file by looking up the |
| 1391 | * filename $UsnJrnl in the extended system files directory $Extend. | 1391 | * filename $UsnJrnl in the extended system files directory $Extend. |
| 1392 | */ | 1392 | */ |
| 1393 | down(&vol->extend_ino->i_sem); | 1393 | mutex_lock(&vol->extend_ino->i_mutex); |
| 1394 | mref = ntfs_lookup_inode_by_name(NTFS_I(vol->extend_ino), UsnJrnl, 8, | 1394 | mref = ntfs_lookup_inode_by_name(NTFS_I(vol->extend_ino), UsnJrnl, 8, |
| 1395 | &name); | 1395 | &name); |
| 1396 | up(&vol->extend_ino->i_sem); | 1396 | mutex_unlock(&vol->extend_ino->i_mutex); |
| 1397 | if (IS_ERR_MREF(mref)) { | 1397 | if (IS_ERR_MREF(mref)) { |
| 1398 | /* | 1398 | /* |
| 1399 | * If the file does not exist, transaction logging is disabled, | 1399 | * If the file does not exist, transaction logging is disabled, |
| @@ -1721,7 +1721,7 @@ static BOOL load_system_files(ntfs_volume *vol) | |||
| 1721 | es3); | 1721 | es3); |
| 1722 | goto iput_mirr_err_out; | 1722 | goto iput_mirr_err_out; |
| 1723 | } | 1723 | } |
| 1724 | sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME; | 1724 | sb->s_flags |= MS_RDONLY; |
| 1725 | ntfs_error(sb, "%s. Mounting read-only%s", | 1725 | ntfs_error(sb, "%s. Mounting read-only%s", |
| 1726 | !vol->mftmirr_ino ? es1 : es2, es3); | 1726 | !vol->mftmirr_ino ? es1 : es2, es3); |
| 1727 | } else | 1727 | } else |
| @@ -1837,7 +1837,7 @@ get_ctx_vol_failed: | |||
| 1837 | es1, es2); | 1837 | es1, es2); |
| 1838 | goto iput_vol_err_out; | 1838 | goto iput_vol_err_out; |
| 1839 | } | 1839 | } |
| 1840 | sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME; | 1840 | sb->s_flags |= MS_RDONLY; |
| 1841 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 1841 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
| 1842 | } else | 1842 | } else |
| 1843 | ntfs_warning(sb, "%s. Will not be able to remount " | 1843 | ntfs_warning(sb, "%s. Will not be able to remount " |
| @@ -1874,7 +1874,7 @@ get_ctx_vol_failed: | |||
| 1874 | } | 1874 | } |
| 1875 | goto iput_logfile_err_out; | 1875 | goto iput_logfile_err_out; |
| 1876 | } | 1876 | } |
| 1877 | sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME; | 1877 | sb->s_flags |= MS_RDONLY; |
| 1878 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 1878 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
| 1879 | } else | 1879 | } else |
| 1880 | ntfs_warning(sb, "%s. Will not be able to remount " | 1880 | ntfs_warning(sb, "%s. Will not be able to remount " |
| @@ -1919,7 +1919,7 @@ get_ctx_vol_failed: | |||
| 1919 | es1, es2); | 1919 | es1, es2); |
| 1920 | goto iput_root_err_out; | 1920 | goto iput_root_err_out; |
| 1921 | } | 1921 | } |
| 1922 | sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME; | 1922 | sb->s_flags |= MS_RDONLY; |
| 1923 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 1923 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
| 1924 | } else | 1924 | } else |
| 1925 | ntfs_warning(sb, "%s. Will not be able to remount " | 1925 | ntfs_warning(sb, "%s. Will not be able to remount " |
| @@ -1943,7 +1943,7 @@ get_ctx_vol_failed: | |||
| 1943 | goto iput_root_err_out; | 1943 | goto iput_root_err_out; |
| 1944 | } | 1944 | } |
| 1945 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 1945 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
| 1946 | sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME; | 1946 | sb->s_flags |= MS_RDONLY; |
| 1947 | /* | 1947 | /* |
| 1948 | * Do not set NVolErrors() because ntfs_remount() might manage | 1948 | * Do not set NVolErrors() because ntfs_remount() might manage |
| 1949 | * to set the dirty flag in which case all would be well. | 1949 | * to set the dirty flag in which case all would be well. |
| @@ -1970,7 +1970,7 @@ get_ctx_vol_failed: | |||
| 1970 | goto iput_root_err_out; | 1970 | goto iput_root_err_out; |
| 1971 | } | 1971 | } |
| 1972 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 1972 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
| 1973 | sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME; | 1973 | sb->s_flags |= MS_RDONLY; |
| 1974 | NVolSetErrors(vol); | 1974 | NVolSetErrors(vol); |
| 1975 | } | 1975 | } |
| 1976 | #endif | 1976 | #endif |
| @@ -1989,7 +1989,7 @@ get_ctx_vol_failed: | |||
| 1989 | goto iput_root_err_out; | 1989 | goto iput_root_err_out; |
| 1990 | } | 1990 | } |
| 1991 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 1991 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
| 1992 | sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME; | 1992 | sb->s_flags |= MS_RDONLY; |
| 1993 | NVolSetErrors(vol); | 1993 | NVolSetErrors(vol); |
| 1994 | } | 1994 | } |
| 1995 | #endif /* NTFS_RW */ | 1995 | #endif /* NTFS_RW */ |
| @@ -2030,7 +2030,7 @@ get_ctx_vol_failed: | |||
| 2030 | es1, es2); | 2030 | es1, es2); |
| 2031 | goto iput_quota_err_out; | 2031 | goto iput_quota_err_out; |
| 2032 | } | 2032 | } |
| 2033 | sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME; | 2033 | sb->s_flags |= MS_RDONLY; |
| 2034 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 2034 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
| 2035 | } else | 2035 | } else |
| 2036 | ntfs_warning(sb, "%s. Will not be able to remount " | 2036 | ntfs_warning(sb, "%s. Will not be able to remount " |
| @@ -2053,7 +2053,7 @@ get_ctx_vol_failed: | |||
| 2053 | goto iput_quota_err_out; | 2053 | goto iput_quota_err_out; |
| 2054 | } | 2054 | } |
| 2055 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 2055 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
| 2056 | sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME; | 2056 | sb->s_flags |= MS_RDONLY; |
| 2057 | NVolSetErrors(vol); | 2057 | NVolSetErrors(vol); |
| 2058 | } | 2058 | } |
| 2059 | /* | 2059 | /* |
| @@ -2074,7 +2074,7 @@ get_ctx_vol_failed: | |||
| 2074 | es1, es2); | 2074 | es1, es2); |
| 2075 | goto iput_usnjrnl_err_out; | 2075 | goto iput_usnjrnl_err_out; |
| 2076 | } | 2076 | } |
| 2077 | sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME; | 2077 | sb->s_flags |= MS_RDONLY; |
| 2078 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 2078 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
| 2079 | } else | 2079 | } else |
| 2080 | ntfs_warning(sb, "%s. Will not be able to remount " | 2080 | ntfs_warning(sb, "%s. Will not be able to remount " |
| @@ -2097,7 +2097,7 @@ get_ctx_vol_failed: | |||
| 2097 | goto iput_usnjrnl_err_out; | 2097 | goto iput_usnjrnl_err_out; |
| 2098 | } | 2098 | } |
| 2099 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 2099 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
| 2100 | sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME; | 2100 | sb->s_flags |= MS_RDONLY; |
| 2101 | NVolSetErrors(vol); | 2101 | NVolSetErrors(vol); |
| 2102 | } | 2102 | } |
| 2103 | #endif /* NTFS_RW */ | 2103 | #endif /* NTFS_RW */ |
| @@ -2312,9 +2312,9 @@ static void ntfs_put_super(struct super_block *sb) | |||
| 2312 | if (!list_empty(&sb->s_dirty)) { | 2312 | if (!list_empty(&sb->s_dirty)) { |
| 2313 | const char *s1, *s2; | 2313 | const char *s1, *s2; |
| 2314 | 2314 | ||
| 2315 | down(&vol->mft_ino->i_sem); | 2315 | mutex_lock(&vol->mft_ino->i_mutex); |
| 2316 | truncate_inode_pages(vol->mft_ino->i_mapping, 0); | 2316 | truncate_inode_pages(vol->mft_ino->i_mapping, 0); |
| 2317 | up(&vol->mft_ino->i_sem); | 2317 | mutex_unlock(&vol->mft_ino->i_mutex); |
| 2318 | write_inode_now(vol->mft_ino, 1); | 2318 | write_inode_now(vol->mft_ino, 1); |
| 2319 | if (!list_empty(&sb->s_dirty)) { | 2319 | if (!list_empty(&sb->s_dirty)) { |
| 2320 | static const char *_s1 = "inodes"; | 2320 | static const char *_s1 = "inodes"; |
| @@ -2689,7 +2689,7 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent) | |||
| 2689 | 2689 | ||
| 2690 | ntfs_debug("Entering."); | 2690 | ntfs_debug("Entering."); |
| 2691 | #ifndef NTFS_RW | 2691 | #ifndef NTFS_RW |
| 2692 | sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME; | 2692 | sb->s_flags |= MS_RDONLY; |
| 2693 | #endif /* ! NTFS_RW */ | 2693 | #endif /* ! NTFS_RW */ |
| 2694 | /* Allocate a new ntfs_volume and place it in sb->s_fs_info. */ | 2694 | /* Allocate a new ntfs_volume and place it in sb->s_fs_info. */ |
| 2695 | sb->s_fs_info = kmalloc(sizeof(ntfs_volume), GFP_NOFS); | 2695 | sb->s_fs_info = kmalloc(sizeof(ntfs_volume), GFP_NOFS); |
