diff options
author | Jes Sorensen <jes@sgi.com> | 2006-01-09 18:59:24 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@hera.kernel.org> | 2006-01-09 18:59:24 -0500 |
commit | 1b1dcc1b57a49136f118a0f16367256ff9994a69 (patch) | |
tree | b0b36d4f41d28c9d6514fb309d33c1a084d6309b /fs/ntfs | |
parent | 794ee1baee1c26be40410233e6c20bceb2b03c08 (diff) |
[PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_sem
This patch converts the inode semaphore to a mutex. I have tested it on
XFS and compiled as much as one can consider on an ia64. Anyway your
luck with it might be different.
Modified-by: Ingo Molnar <mingo@elte.hu>
(finished the conversion)
Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/ntfs')
-rw-r--r-- | fs/ntfs/attrib.c | 4 | ||||
-rw-r--r-- | fs/ntfs/dir.c | 8 | ||||
-rw-r--r-- | fs/ntfs/file.c | 18 | ||||
-rw-r--r-- | fs/ntfs/index.c | 6 | ||||
-rw-r--r-- | fs/ntfs/inode.c | 8 | ||||
-rw-r--r-- | fs/ntfs/namei.c | 6 | ||||
-rw-r--r-- | fs/ntfs/quota.c | 6 | ||||
-rw-r--r-- | fs/ntfs/super.c | 16 |
8 files changed, 36 insertions, 36 deletions
diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c index eda056bac256..9480a0526cd3 100644 --- a/fs/ntfs/attrib.c +++ b/fs/ntfs/attrib.c | |||
@@ -1532,7 +1532,7 @@ int ntfs_resident_attr_value_resize(MFT_RECORD *m, ATTR_RECORD *a, | |||
1532 | * NOTE to self: No changes in the attribute list are required to move from | 1532 | * NOTE to self: No changes in the attribute list are required to move from |
1533 | * a resident to a non-resident attribute. | 1533 | * a resident to a non-resident attribute. |
1534 | * | 1534 | * |
1535 | * Locking: - The caller must hold i_sem on the inode. | 1535 | * Locking: - The caller must hold i_mutex on the inode. |
1536 | */ | 1536 | */ |
1537 | int ntfs_attr_make_non_resident(ntfs_inode *ni, const u32 data_size) | 1537 | int ntfs_attr_make_non_resident(ntfs_inode *ni, const u32 data_size) |
1538 | { | 1538 | { |
@@ -1728,7 +1728,7 @@ int ntfs_attr_make_non_resident(ntfs_inode *ni, const u32 data_size) | |||
1728 | /* | 1728 | /* |
1729 | * This needs to be last since the address space operations ->readpage | 1729 | * This needs to be last since the address space operations ->readpage |
1730 | * and ->writepage can run concurrently with us as they are not | 1730 | * and ->writepage can run concurrently with us as they are not |
1731 | * serialized on i_sem. Note, we are not allowed to fail once we flip | 1731 | * serialized on i_mutex. Note, we are not allowed to fail once we flip |
1732 | * this switch, which is another reason to do this last. | 1732 | * this switch, which is another reason to do this last. |
1733 | */ | 1733 | */ |
1734 | NInoSetNonResident(ni); | 1734 | NInoSetNonResident(ni); |
diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c index 795c3d1930f5..b0690d4c8906 100644 --- a/fs/ntfs/dir.c +++ b/fs/ntfs/dir.c | |||
@@ -69,7 +69,7 @@ ntfschar I30[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('I'), | |||
69 | * work but we don't care for how quickly one can access them. This also fixes | 69 | * work but we don't care for how quickly one can access them. This also fixes |
70 | * the dcache aliasing issues. | 70 | * the dcache aliasing issues. |
71 | * | 71 | * |
72 | * Locking: - Caller must hold i_sem on the directory. | 72 | * Locking: - Caller must hold i_mutex on the directory. |
73 | * - Each page cache page in the index allocation mapping must be | 73 | * - Each page cache page in the index allocation mapping must be |
74 | * locked whilst being accessed otherwise we may find a corrupt | 74 | * locked whilst being accessed otherwise we may find a corrupt |
75 | * page due to it being under ->writepage at the moment which | 75 | * page due to it being under ->writepage at the moment which |
@@ -1085,11 +1085,11 @@ static inline int ntfs_filldir(ntfs_volume *vol, loff_t fpos, | |||
1085 | * While this will return the names in random order this doesn't matter for | 1085 | * While this will return the names in random order this doesn't matter for |
1086 | * ->readdir but OTOH results in a faster ->readdir. | 1086 | * ->readdir but OTOH results in a faster ->readdir. |
1087 | * | 1087 | * |
1088 | * VFS calls ->readdir without BKL but with i_sem held. This protects the VFS | 1088 | * VFS calls ->readdir without BKL but with i_mutex held. This protects the VFS |
1089 | * parts (e.g. ->f_pos and ->i_size, and it also protects against directory | 1089 | * parts (e.g. ->f_pos and ->i_size, and it also protects against directory |
1090 | * modifications). | 1090 | * modifications). |
1091 | * | 1091 | * |
1092 | * Locking: - Caller must hold i_sem on the directory. | 1092 | * Locking: - Caller must hold i_mutex on the directory. |
1093 | * - Each page cache page in the index allocation mapping must be | 1093 | * - Each page cache page in the index allocation mapping must be |
1094 | * locked whilst being accessed otherwise we may find a corrupt | 1094 | * locked whilst being accessed otherwise we may find a corrupt |
1095 | * page due to it being under ->writepage at the moment which | 1095 | * page due to it being under ->writepage at the moment which |
@@ -1520,7 +1520,7 @@ static int ntfs_dir_open(struct inode *vi, struct file *filp) | |||
1520 | * Note: In the past @filp could be NULL so we ignore it as we don't need it | 1520 | * Note: In the past @filp could be NULL so we ignore it as we don't need it |
1521 | * anyway. | 1521 | * anyway. |
1522 | * | 1522 | * |
1523 | * Locking: Caller must hold i_sem on the inode. | 1523 | * Locking: Caller must hold i_mutex on the inode. |
1524 | * | 1524 | * |
1525 | * TODO: We should probably also write all attribute/index inodes associated | 1525 | * TODO: We should probably also write all attribute/index inodes associated |
1526 | * with this inode but since we have no simple way of getting to them we ignore | 1526 | * with this inode but since we have no simple way of getting to them we ignore |
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index 727533891813..30f71acdc1cb 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c | |||
@@ -106,7 +106,7 @@ static int ntfs_file_open(struct inode *vi, struct file *filp) | |||
106 | * this is the case, the necessary zeroing will also have happened and that all | 106 | * this is the case, the necessary zeroing will also have happened and that all |
107 | * metadata is self-consistent. | 107 | * metadata is self-consistent. |
108 | * | 108 | * |
109 | * Locking: i_sem on the vfs inode corrseponsind to the ntfs inode @ni must be | 109 | * Locking: i_mutex on the vfs inode corrseponsind to the ntfs inode @ni must be |
110 | * held by the caller. | 110 | * held by the caller. |
111 | */ | 111 | */ |
112 | static int ntfs_attr_extend_initialized(ntfs_inode *ni, const s64 new_init_size, | 112 | static int ntfs_attr_extend_initialized(ntfs_inode *ni, const s64 new_init_size, |
@@ -473,7 +473,7 @@ static inline int ntfs_submit_bh_for_read(struct buffer_head *bh) | |||
473 | * @bytes: number of bytes to be written | 473 | * @bytes: number of bytes to be written |
474 | * | 474 | * |
475 | * This is called for non-resident attributes from ntfs_file_buffered_write() | 475 | * This is called for non-resident attributes from ntfs_file_buffered_write() |
476 | * with i_sem held on the inode (@pages[0]->mapping->host). There are | 476 | * with i_mutex held on the inode (@pages[0]->mapping->host). There are |
477 | * @nr_pages pages in @pages which are locked but not kmap()ped. The source | 477 | * @nr_pages pages in @pages which are locked but not kmap()ped. The source |
478 | * data has not yet been copied into the @pages. | 478 | * data has not yet been copied into the @pages. |
479 | * | 479 | * |
@@ -1637,7 +1637,7 @@ err_out: | |||
1637 | * @pos: byte position in file at which the write begins | 1637 | * @pos: byte position in file at which the write begins |
1638 | * @bytes: number of bytes to be written | 1638 | * @bytes: number of bytes to be written |
1639 | * | 1639 | * |
1640 | * This is called from ntfs_file_buffered_write() with i_sem held on the inode | 1640 | * This is called from ntfs_file_buffered_write() with i_mutex held on the inode |
1641 | * (@pages[0]->mapping->host). There are @nr_pages pages in @pages which are | 1641 | * (@pages[0]->mapping->host). There are @nr_pages pages in @pages which are |
1642 | * locked but not kmap()ped. The source data has already been copied into the | 1642 | * locked but not kmap()ped. The source data has already been copied into the |
1643 | * @page. ntfs_prepare_pages_for_non_resident_write() has been called before | 1643 | * @page. ntfs_prepare_pages_for_non_resident_write() has been called before |
@@ -1814,7 +1814,7 @@ err_out: | |||
1814 | /** | 1814 | /** |
1815 | * ntfs_file_buffered_write - | 1815 | * ntfs_file_buffered_write - |
1816 | * | 1816 | * |
1817 | * Locking: The vfs is holding ->i_sem on the inode. | 1817 | * Locking: The vfs is holding ->i_mutex on the inode. |
1818 | */ | 1818 | */ |
1819 | static ssize_t ntfs_file_buffered_write(struct kiocb *iocb, | 1819 | static ssize_t ntfs_file_buffered_write(struct kiocb *iocb, |
1820 | const struct iovec *iov, unsigned long nr_segs, | 1820 | const struct iovec *iov, unsigned long nr_segs, |
@@ -2196,9 +2196,9 @@ static ssize_t ntfs_file_aio_write(struct kiocb *iocb, const char __user *buf, | |||
2196 | 2196 | ||
2197 | BUG_ON(iocb->ki_pos != pos); | 2197 | BUG_ON(iocb->ki_pos != pos); |
2198 | 2198 | ||
2199 | down(&inode->i_sem); | 2199 | mutex_lock(&inode->i_mutex); |
2200 | ret = ntfs_file_aio_write_nolock(iocb, &local_iov, 1, &iocb->ki_pos); | 2200 | ret = ntfs_file_aio_write_nolock(iocb, &local_iov, 1, &iocb->ki_pos); |
2201 | up(&inode->i_sem); | 2201 | mutex_unlock(&inode->i_mutex); |
2202 | if (ret > 0 && ((file->f_flags & O_SYNC) || IS_SYNC(inode))) { | 2202 | if (ret > 0 && ((file->f_flags & O_SYNC) || IS_SYNC(inode))) { |
2203 | int err = sync_page_range(inode, mapping, pos, ret); | 2203 | int err = sync_page_range(inode, mapping, pos, ret); |
2204 | if (err < 0) | 2204 | if (err < 0) |
@@ -2221,12 +2221,12 @@ static ssize_t ntfs_file_writev(struct file *file, const struct iovec *iov, | |||
2221 | struct kiocb kiocb; | 2221 | struct kiocb kiocb; |
2222 | ssize_t ret; | 2222 | ssize_t ret; |
2223 | 2223 | ||
2224 | down(&inode->i_sem); | 2224 | mutex_lock(&inode->i_mutex); |
2225 | init_sync_kiocb(&kiocb, file); | 2225 | init_sync_kiocb(&kiocb, file); |
2226 | ret = ntfs_file_aio_write_nolock(&kiocb, iov, nr_segs, ppos); | 2226 | ret = ntfs_file_aio_write_nolock(&kiocb, iov, nr_segs, ppos); |
2227 | if (ret == -EIOCBQUEUED) | 2227 | if (ret == -EIOCBQUEUED) |
2228 | ret = wait_on_sync_kiocb(&kiocb); | 2228 | ret = wait_on_sync_kiocb(&kiocb); |
2229 | up(&inode->i_sem); | 2229 | mutex_unlock(&inode->i_mutex); |
2230 | if (ret > 0 && ((file->f_flags & O_SYNC) || IS_SYNC(inode))) { | 2230 | if (ret > 0 && ((file->f_flags & O_SYNC) || IS_SYNC(inode))) { |
2231 | int err = sync_page_range(inode, mapping, *ppos - ret, ret); | 2231 | int err = sync_page_range(inode, mapping, *ppos - ret, ret); |
2232 | if (err < 0) | 2232 | if (err < 0) |
@@ -2269,7 +2269,7 @@ static ssize_t ntfs_file_write(struct file *file, const char __user *buf, | |||
2269 | * Note: In the past @filp could be NULL so we ignore it as we don't need it | 2269 | * Note: In the past @filp could be NULL so we ignore it as we don't need it |
2270 | * anyway. | 2270 | * anyway. |
2271 | * | 2271 | * |
2272 | * Locking: Caller must hold i_sem on the inode. | 2272 | * Locking: Caller must hold i_mutex on the inode. |
2273 | * | 2273 | * |
2274 | * TODO: We should probably also write all attribute/index inodes associated | 2274 | * TODO: We should probably also write all attribute/index inodes associated |
2275 | * with this inode but since we have no simple way of getting to them we ignore | 2275 | * with this inode but since we have no simple way of getting to them we ignore |
diff --git a/fs/ntfs/index.c b/fs/ntfs/index.c index 8f2d5727546f..9f5427c2d105 100644 --- a/fs/ntfs/index.c +++ b/fs/ntfs/index.c | |||
@@ -32,7 +32,7 @@ | |||
32 | * Allocate a new index context, initialize it with @idx_ni and return it. | 32 | * Allocate a new index context, initialize it with @idx_ni and return it. |
33 | * Return NULL if allocation failed. | 33 | * Return NULL if allocation failed. |
34 | * | 34 | * |
35 | * Locking: Caller must hold i_sem on the index inode. | 35 | * Locking: Caller must hold i_mutex on the index inode. |
36 | */ | 36 | */ |
37 | ntfs_index_context *ntfs_index_ctx_get(ntfs_inode *idx_ni) | 37 | ntfs_index_context *ntfs_index_ctx_get(ntfs_inode *idx_ni) |
38 | { | 38 | { |
@@ -50,7 +50,7 @@ ntfs_index_context *ntfs_index_ctx_get(ntfs_inode *idx_ni) | |||
50 | * | 50 | * |
51 | * Release the index context @ictx, releasing all associated resources. | 51 | * Release the index context @ictx, releasing all associated resources. |
52 | * | 52 | * |
53 | * Locking: Caller must hold i_sem on the index inode. | 53 | * Locking: Caller must hold i_mutex on the index inode. |
54 | */ | 54 | */ |
55 | void ntfs_index_ctx_put(ntfs_index_context *ictx) | 55 | void ntfs_index_ctx_put(ntfs_index_context *ictx) |
56 | { | 56 | { |
@@ -106,7 +106,7 @@ void ntfs_index_ctx_put(ntfs_index_context *ictx) | |||
106 | * or ntfs_index_entry_write() before the call to ntfs_index_ctx_put() to | 106 | * or ntfs_index_entry_write() before the call to ntfs_index_ctx_put() to |
107 | * ensure that the changes are written to disk. | 107 | * ensure that the changes are written to disk. |
108 | * | 108 | * |
109 | * Locking: - Caller must hold i_sem on the index inode. | 109 | * Locking: - Caller must hold i_mutex on the index inode. |
110 | * - Each page cache page in the index allocation mapping must be | 110 | * - Each page cache page in the index allocation mapping must be |
111 | * locked whilst being accessed otherwise we may find a corrupt | 111 | * locked whilst being accessed otherwise we may find a corrupt |
112 | * page due to it being under ->writepage at the moment which | 112 | * page due to it being under ->writepage at the moment which |
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index b24f4c4b2c5c..bda7a08911a5 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c | |||
@@ -2125,13 +2125,13 @@ void ntfs_put_inode(struct inode *vi) | |||
2125 | ntfs_inode *ni = NTFS_I(vi); | 2125 | ntfs_inode *ni = NTFS_I(vi); |
2126 | if (NInoIndexAllocPresent(ni)) { | 2126 | if (NInoIndexAllocPresent(ni)) { |
2127 | struct inode *bvi = NULL; | 2127 | struct inode *bvi = NULL; |
2128 | down(&vi->i_sem); | 2128 | mutex_lock(&vi->i_mutex); |
2129 | if (atomic_read(&vi->i_count) == 2) { | 2129 | if (atomic_read(&vi->i_count) == 2) { |
2130 | bvi = ni->itype.index.bmp_ino; | 2130 | bvi = ni->itype.index.bmp_ino; |
2131 | if (bvi) | 2131 | if (bvi) |
2132 | ni->itype.index.bmp_ino = NULL; | 2132 | ni->itype.index.bmp_ino = NULL; |
2133 | } | 2133 | } |
2134 | up(&vi->i_sem); | 2134 | mutex_unlock(&vi->i_mutex); |
2135 | if (bvi) | 2135 | if (bvi) |
2136 | iput(bvi); | 2136 | iput(bvi); |
2137 | } | 2137 | } |
@@ -2311,7 +2311,7 @@ static const char *es = " Leaving inconsistent metadata. Unmount and run " | |||
2311 | * | 2311 | * |
2312 | * Returns 0 on success or -errno on error. | 2312 | * Returns 0 on success or -errno on error. |
2313 | * | 2313 | * |
2314 | * Called with ->i_sem held. In all but one case ->i_alloc_sem is held for | 2314 | * Called with ->i_mutex held. In all but one case ->i_alloc_sem is held for |
2315 | * writing. The only case in the kernel where ->i_alloc_sem is not held is | 2315 | * writing. The only case in the kernel where ->i_alloc_sem is not held is |
2316 | * mm/filemap.c::generic_file_buffered_write() where vmtruncate() is called | 2316 | * mm/filemap.c::generic_file_buffered_write() where vmtruncate() is called |
2317 | * with the current i_size as the offset. The analogous place in NTFS is in | 2317 | * with the current i_size as the offset. The analogous place in NTFS is in |
@@ -2831,7 +2831,7 @@ void ntfs_truncate_vfs(struct inode *vi) { | |||
2831 | * We also abort all changes of user, group, and mode as we do not implement | 2831 | * We also abort all changes of user, group, and mode as we do not implement |
2832 | * the NTFS ACLs yet. | 2832 | * the NTFS ACLs yet. |
2833 | * | 2833 | * |
2834 | * Called with ->i_sem held. For the ATTR_SIZE (i.e. ->truncate) case, also | 2834 | * Called with ->i_mutex held. For the ATTR_SIZE (i.e. ->truncate) case, also |
2835 | * called with ->i_alloc_sem held for writing. | 2835 | * called with ->i_alloc_sem held for writing. |
2836 | * | 2836 | * |
2837 | * Basically this is a copy of generic notify_change() and inode_setattr() | 2837 | * Basically this is a copy of generic notify_change() and inode_setattr() |
diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c index 351dbc3b6e40..5ea9eb93af62 100644 --- a/fs/ntfs/namei.c +++ b/fs/ntfs/namei.c | |||
@@ -96,7 +96,7 @@ | |||
96 | * name. We then convert the name to the current NLS code page, and proceed | 96 | * name. We then convert the name to the current NLS code page, and proceed |
97 | * searching for a dentry with this name, etc, as in case 2), above. | 97 | * searching for a dentry with this name, etc, as in case 2), above. |
98 | * | 98 | * |
99 | * Locking: Caller must hold i_sem on the directory. | 99 | * Locking: Caller must hold i_mutex on the directory. |
100 | */ | 100 | */ |
101 | static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent, | 101 | static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent, |
102 | struct nameidata *nd) | 102 | struct nameidata *nd) |
@@ -254,7 +254,7 @@ handle_name: | |||
254 | nls_name.hash = full_name_hash(nls_name.name, nls_name.len); | 254 | nls_name.hash = full_name_hash(nls_name.name, nls_name.len); |
255 | 255 | ||
256 | /* | 256 | /* |
257 | * Note: No need for dent->d_lock lock as i_sem is held on the | 257 | * Note: No need for dent->d_lock lock as i_mutex is held on the |
258 | * parent inode. | 258 | * parent inode. |
259 | */ | 259 | */ |
260 | 260 | ||
@@ -374,7 +374,7 @@ struct inode_operations ntfs_dir_inode_ops = { | |||
374 | * The code is based on the ext3 ->get_parent() implementation found in | 374 | * The code is based on the ext3 ->get_parent() implementation found in |
375 | * fs/ext3/namei.c::ext3_get_parent(). | 375 | * fs/ext3/namei.c::ext3_get_parent(). |
376 | * | 376 | * |
377 | * Note: ntfs_get_parent() is called with @child_dent->d_inode->i_sem down. | 377 | * Note: ntfs_get_parent() is called with @child_dent->d_inode->i_mutex down. |
378 | * | 378 | * |
379 | * Return the dentry of the parent directory on success or the error code on | 379 | * Return the dentry of the parent directory on success or the error code on |
380 | * error (IS_ERR() is true). | 380 | * error (IS_ERR() is true). |
diff --git a/fs/ntfs/quota.c b/fs/ntfs/quota.c index 833df2a4e9fb..d0ef4182147b 100644 --- a/fs/ntfs/quota.c +++ b/fs/ntfs/quota.c | |||
@@ -48,7 +48,7 @@ BOOL ntfs_mark_quotas_out_of_date(ntfs_volume *vol) | |||
48 | ntfs_error(vol->sb, "Quota inodes are not open."); | 48 | ntfs_error(vol->sb, "Quota inodes are not open."); |
49 | return FALSE; | 49 | return FALSE; |
50 | } | 50 | } |
51 | down(&vol->quota_q_ino->i_sem); | 51 | mutex_lock(&vol->quota_q_ino->i_mutex); |
52 | ictx = ntfs_index_ctx_get(NTFS_I(vol->quota_q_ino)); | 52 | ictx = ntfs_index_ctx_get(NTFS_I(vol->quota_q_ino)); |
53 | if (!ictx) { | 53 | if (!ictx) { |
54 | ntfs_error(vol->sb, "Failed to get index context."); | 54 | ntfs_error(vol->sb, "Failed to get index context."); |
@@ -98,7 +98,7 @@ BOOL ntfs_mark_quotas_out_of_date(ntfs_volume *vol) | |||
98 | ntfs_index_entry_mark_dirty(ictx); | 98 | ntfs_index_entry_mark_dirty(ictx); |
99 | set_done: | 99 | set_done: |
100 | ntfs_index_ctx_put(ictx); | 100 | ntfs_index_ctx_put(ictx); |
101 | up(&vol->quota_q_ino->i_sem); | 101 | mutex_unlock(&vol->quota_q_ino->i_mutex); |
102 | /* | 102 | /* |
103 | * We set the flag so we do not try to mark the quotas out of date | 103 | * We set the flag so we do not try to mark the quotas out of date |
104 | * again on remount. | 104 | * again on remount. |
@@ -110,7 +110,7 @@ done: | |||
110 | err_out: | 110 | err_out: |
111 | if (ictx) | 111 | if (ictx) |
112 | ntfs_index_ctx_put(ictx); | 112 | ntfs_index_ctx_put(ictx); |
113 | up(&vol->quota_q_ino->i_sem); | 113 | mutex_unlock(&vol->quota_q_ino->i_mutex); |
114 | return FALSE; | 114 | return FALSE; |
115 | } | 115 | } |
116 | 116 | ||
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 6c16db9e1a8a..280e383fc84e 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c | |||
@@ -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, |
@@ -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"; |