diff options
Diffstat (limited to 'fs/ntfs/file.c')
-rw-r--r-- | fs/ntfs/file.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index 727533891813..fb413d3d8618 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, |
@@ -2173,7 +2173,7 @@ static ssize_t ntfs_file_aio_write_nolock(struct kiocb *iocb, | |||
2173 | err = remove_suid(file->f_dentry); | 2173 | err = remove_suid(file->f_dentry); |
2174 | if (err) | 2174 | if (err) |
2175 | goto out; | 2175 | goto out; |
2176 | inode_update_time(inode, 1); | 2176 | file_update_time(file); |
2177 | written = ntfs_file_buffered_write(iocb, iov, nr_segs, pos, ppos, | 2177 | written = ntfs_file_buffered_write(iocb, iov, nr_segs, pos, ppos, |
2178 | count); | 2178 | count); |
2179 | out: | 2179 | out: |
@@ -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 |