diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-03-23 11:57:48 -0500 |
---|---|---|
committer | Anton Altaparmakov <aia21@cantab.net> | 2006-03-23 11:57:48 -0500 |
commit | 4e5e529ad684f1b3fba957f5dd4eb7c2b534ee92 (patch) | |
tree | fdd2fd4ef26dc758b28dfb13d56075129a2cbdec /fs/ntfs/super.c | |
parent | 834ba600cefe6847acaebe5e8e984476dfeebf55 (diff) |
NTFS: Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Diffstat (limited to 'fs/ntfs/super.c')
-rw-r--r-- | fs/ntfs/super.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index fd4aecc5548e..6816edafe4dd 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c | |||
@@ -1677,11 +1677,11 @@ read_partial_upcase_page: | |||
1677 | ntfs_debug("Read %llu bytes from $UpCase (expected %zu bytes).", | 1677 | ntfs_debug("Read %llu bytes from $UpCase (expected %zu bytes).", |
1678 | i_size, 64 * 1024 * sizeof(ntfschar)); | 1678 | i_size, 64 * 1024 * sizeof(ntfschar)); |
1679 | iput(ino); | 1679 | iput(ino); |
1680 | down(&ntfs_lock); | 1680 | mutex_lock(&ntfs_lock); |
1681 | if (!default_upcase) { | 1681 | if (!default_upcase) { |
1682 | ntfs_debug("Using volume specified $UpCase since default is " | 1682 | ntfs_debug("Using volume specified $UpCase since default is " |
1683 | "not present."); | 1683 | "not present."); |
1684 | up(&ntfs_lock); | 1684 | mutex_unlock(&ntfs_lock); |
1685 | return TRUE; | 1685 | return TRUE; |
1686 | } | 1686 | } |
1687 | max = default_upcase_len; | 1687 | max = default_upcase_len; |
@@ -1695,12 +1695,12 @@ read_partial_upcase_page: | |||
1695 | vol->upcase = default_upcase; | 1695 | vol->upcase = default_upcase; |
1696 | vol->upcase_len = max; | 1696 | vol->upcase_len = max; |
1697 | ntfs_nr_upcase_users++; | 1697 | ntfs_nr_upcase_users++; |
1698 | up(&ntfs_lock); | 1698 | mutex_unlock(&ntfs_lock); |
1699 | ntfs_debug("Volume specified $UpCase matches default. Using " | 1699 | ntfs_debug("Volume specified $UpCase matches default. Using " |
1700 | "default."); | 1700 | "default."); |
1701 | return TRUE; | 1701 | return TRUE; |
1702 | } | 1702 | } |
1703 | up(&ntfs_lock); | 1703 | mutex_unlock(&ntfs_lock); |
1704 | ntfs_debug("Using volume specified $UpCase since it does not match " | 1704 | ntfs_debug("Using volume specified $UpCase since it does not match " |
1705 | "the default."); | 1705 | "the default."); |
1706 | return TRUE; | 1706 | return TRUE; |
@@ -1709,17 +1709,17 @@ iput_upcase_failed: | |||
1709 | ntfs_free(vol->upcase); | 1709 | ntfs_free(vol->upcase); |
1710 | vol->upcase = NULL; | 1710 | vol->upcase = NULL; |
1711 | upcase_failed: | 1711 | upcase_failed: |
1712 | down(&ntfs_lock); | 1712 | mutex_lock(&ntfs_lock); |
1713 | if (default_upcase) { | 1713 | if (default_upcase) { |
1714 | vol->upcase = default_upcase; | 1714 | vol->upcase = default_upcase; |
1715 | vol->upcase_len = default_upcase_len; | 1715 | vol->upcase_len = default_upcase_len; |
1716 | ntfs_nr_upcase_users++; | 1716 | ntfs_nr_upcase_users++; |
1717 | up(&ntfs_lock); | 1717 | mutex_unlock(&ntfs_lock); |
1718 | ntfs_error(sb, "Failed to load $UpCase from the volume. Using " | 1718 | ntfs_error(sb, "Failed to load $UpCase from the volume. Using " |
1719 | "default."); | 1719 | "default."); |
1720 | return TRUE; | 1720 | return TRUE; |
1721 | } | 1721 | } |
1722 | up(&ntfs_lock); | 1722 | mutex_unlock(&ntfs_lock); |
1723 | ntfs_error(sb, "Failed to initialize upcase table."); | 1723 | ntfs_error(sb, "Failed to initialize upcase table."); |
1724 | return FALSE; | 1724 | return FALSE; |
1725 | } | 1725 | } |
@@ -2195,12 +2195,12 @@ iput_attrdef_err_out: | |||
2195 | iput_upcase_err_out: | 2195 | iput_upcase_err_out: |
2196 | #endif /* NTFS_RW */ | 2196 | #endif /* NTFS_RW */ |
2197 | vol->upcase_len = 0; | 2197 | vol->upcase_len = 0; |
2198 | down(&ntfs_lock); | 2198 | mutex_lock(&ntfs_lock); |
2199 | if (vol->upcase == default_upcase) { | 2199 | if (vol->upcase == default_upcase) { |
2200 | ntfs_nr_upcase_users--; | 2200 | ntfs_nr_upcase_users--; |
2201 | vol->upcase = NULL; | 2201 | vol->upcase = NULL; |
2202 | } | 2202 | } |
2203 | up(&ntfs_lock); | 2203 | mutex_unlock(&ntfs_lock); |
2204 | if (vol->upcase) { | 2204 | if (vol->upcase) { |
2205 | ntfs_free(vol->upcase); | 2205 | ntfs_free(vol->upcase); |
2206 | vol->upcase = NULL; | 2206 | vol->upcase = NULL; |
@@ -2405,7 +2405,7 @@ static void ntfs_put_super(struct super_block *sb) | |||
2405 | * Destroy the global default upcase table if necessary. Also decrease | 2405 | * Destroy the global default upcase table if necessary. Also decrease |
2406 | * the number of upcase users if we are a user. | 2406 | * the number of upcase users if we are a user. |
2407 | */ | 2407 | */ |
2408 | down(&ntfs_lock); | 2408 | mutex_lock(&ntfs_lock); |
2409 | if (vol->upcase == default_upcase) { | 2409 | if (vol->upcase == default_upcase) { |
2410 | ntfs_nr_upcase_users--; | 2410 | ntfs_nr_upcase_users--; |
2411 | vol->upcase = NULL; | 2411 | vol->upcase = NULL; |
@@ -2416,7 +2416,7 @@ static void ntfs_put_super(struct super_block *sb) | |||
2416 | } | 2416 | } |
2417 | if (vol->cluster_size <= 4096 && !--ntfs_nr_compression_users) | 2417 | if (vol->cluster_size <= 4096 && !--ntfs_nr_compression_users) |
2418 | free_compression_buffers(); | 2418 | free_compression_buffers(); |
2419 | up(&ntfs_lock); | 2419 | mutex_unlock(&ntfs_lock); |
2420 | if (vol->upcase) { | 2420 | if (vol->upcase) { |
2421 | ntfs_free(vol->upcase); | 2421 | ntfs_free(vol->upcase); |
2422 | vol->upcase = NULL; | 2422 | vol->upcase = NULL; |
@@ -2890,7 +2890,7 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent) | |||
2890 | ntfs_error(sb, "Failed to load essential metadata."); | 2890 | ntfs_error(sb, "Failed to load essential metadata."); |
2891 | goto iput_tmp_ino_err_out_now; | 2891 | goto iput_tmp_ino_err_out_now; |
2892 | } | 2892 | } |
2893 | down(&ntfs_lock); | 2893 | mutex_lock(&ntfs_lock); |
2894 | /* | 2894 | /* |
2895 | * The current mount is a compression user if the cluster size is | 2895 | * The current mount is a compression user if the cluster size is |
2896 | * less than or equal 4kiB. | 2896 | * less than or equal 4kiB. |
@@ -2901,7 +2901,7 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent) | |||
2901 | ntfs_error(NULL, "Failed to allocate buffers " | 2901 | ntfs_error(NULL, "Failed to allocate buffers " |
2902 | "for compression engine."); | 2902 | "for compression engine."); |
2903 | ntfs_nr_compression_users--; | 2903 | ntfs_nr_compression_users--; |
2904 | up(&ntfs_lock); | 2904 | mutex_unlock(&ntfs_lock); |
2905 | goto iput_tmp_ino_err_out_now; | 2905 | goto iput_tmp_ino_err_out_now; |
2906 | } | 2906 | } |
2907 | } | 2907 | } |
@@ -2913,7 +2913,7 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent) | |||
2913 | if (!default_upcase) | 2913 | if (!default_upcase) |
2914 | default_upcase = generate_default_upcase(); | 2914 | default_upcase = generate_default_upcase(); |
2915 | ntfs_nr_upcase_users++; | 2915 | ntfs_nr_upcase_users++; |
2916 | up(&ntfs_lock); | 2916 | mutex_unlock(&ntfs_lock); |
2917 | /* | 2917 | /* |
2918 | * From now on, ignore @silent parameter. If we fail below this line, | 2918 | * From now on, ignore @silent parameter. If we fail below this line, |
2919 | * it will be due to a corrupt fs or a system error, so we report it. | 2919 | * it will be due to a corrupt fs or a system error, so we report it. |
@@ -2931,12 +2931,12 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent) | |||
2931 | atomic_inc(&vol->root_ino->i_count); | 2931 | atomic_inc(&vol->root_ino->i_count); |
2932 | ntfs_debug("Exiting, status successful."); | 2932 | ntfs_debug("Exiting, status successful."); |
2933 | /* Release the default upcase if it has no users. */ | 2933 | /* Release the default upcase if it has no users. */ |
2934 | down(&ntfs_lock); | 2934 | mutex_lock(&ntfs_lock); |
2935 | if (!--ntfs_nr_upcase_users && default_upcase) { | 2935 | if (!--ntfs_nr_upcase_users && default_upcase) { |
2936 | ntfs_free(default_upcase); | 2936 | ntfs_free(default_upcase); |
2937 | default_upcase = NULL; | 2937 | default_upcase = NULL; |
2938 | } | 2938 | } |
2939 | up(&ntfs_lock); | 2939 | mutex_unlock(&ntfs_lock); |
2940 | sb->s_export_op = &ntfs_export_ops; | 2940 | sb->s_export_op = &ntfs_export_ops; |
2941 | lock_kernel(); | 2941 | lock_kernel(); |
2942 | return 0; | 2942 | return 0; |
@@ -3004,12 +3004,12 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent) | |||
3004 | vol->attrdef = NULL; | 3004 | vol->attrdef = NULL; |
3005 | } | 3005 | } |
3006 | vol->upcase_len = 0; | 3006 | vol->upcase_len = 0; |
3007 | down(&ntfs_lock); | 3007 | mutex_lock(&ntfs_lock); |
3008 | if (vol->upcase == default_upcase) { | 3008 | if (vol->upcase == default_upcase) { |
3009 | ntfs_nr_upcase_users--; | 3009 | ntfs_nr_upcase_users--; |
3010 | vol->upcase = NULL; | 3010 | vol->upcase = NULL; |
3011 | } | 3011 | } |
3012 | up(&ntfs_lock); | 3012 | mutex_unlock(&ntfs_lock); |
3013 | if (vol->upcase) { | 3013 | if (vol->upcase) { |
3014 | ntfs_free(vol->upcase); | 3014 | ntfs_free(vol->upcase); |
3015 | vol->upcase = NULL; | 3015 | vol->upcase = NULL; |
@@ -3024,14 +3024,14 @@ unl_upcase_iput_tmp_ino_err_out_now: | |||
3024 | * Decrease the number of upcase users and destroy the global default | 3024 | * Decrease the number of upcase users and destroy the global default |
3025 | * upcase table if necessary. | 3025 | * upcase table if necessary. |
3026 | */ | 3026 | */ |
3027 | down(&ntfs_lock); | 3027 | mutex_lock(&ntfs_lock); |
3028 | if (!--ntfs_nr_upcase_users && default_upcase) { | 3028 | if (!--ntfs_nr_upcase_users && default_upcase) { |
3029 | ntfs_free(default_upcase); | 3029 | ntfs_free(default_upcase); |
3030 | default_upcase = NULL; | 3030 | default_upcase = NULL; |
3031 | } | 3031 | } |
3032 | if (vol->cluster_size <= 4096 && !--ntfs_nr_compression_users) | 3032 | if (vol->cluster_size <= 4096 && !--ntfs_nr_compression_users) |
3033 | free_compression_buffers(); | 3033 | free_compression_buffers(); |
3034 | up(&ntfs_lock); | 3034 | mutex_unlock(&ntfs_lock); |
3035 | iput_tmp_ino_err_out_now: | 3035 | iput_tmp_ino_err_out_now: |
3036 | iput(tmp_ino); | 3036 | iput(tmp_ino); |
3037 | if (vol->mft_ino && vol->mft_ino != tmp_ino) | 3037 | if (vol->mft_ino && vol->mft_ino != tmp_ino) |
@@ -3091,7 +3091,7 @@ struct kmem_cache *ntfs_attr_ctx_cache; | |||
3091 | struct kmem_cache *ntfs_index_ctx_cache; | 3091 | struct kmem_cache *ntfs_index_ctx_cache; |
3092 | 3092 | ||
3093 | /* Driver wide semaphore. */ | 3093 | /* Driver wide semaphore. */ |
3094 | DECLARE_MUTEX(ntfs_lock); | 3094 | DEFINE_MUTEX(ntfs_lock); |
3095 | 3095 | ||
3096 | static struct super_block *ntfs_get_sb(struct file_system_type *fs_type, | 3096 | static struct super_block *ntfs_get_sb(struct file_system_type *fs_type, |
3097 | int flags, const char *dev_name, void *data) | 3097 | int flags, const char *dev_name, void *data) |