diff options
Diffstat (limited to 'fs/ntfs')
-rw-r--r-- | fs/ntfs/ChangeLog | 1 | ||||
-rw-r--r-- | fs/ntfs/attrib.c | 2 | ||||
-rw-r--r-- | fs/ntfs/file.c | 23 |
3 files changed, 10 insertions, 16 deletions
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog index 2a76b1fbbfc0..dea742405161 100644 --- a/fs/ntfs/ChangeLog +++ b/fs/ntfs/ChangeLog | |||
@@ -77,6 +77,7 @@ ToDo/Notes: | |||
77 | EOPNOTSUPP is returned. | 77 | EOPNOTSUPP is returned. |
78 | - $EA attributes can be both resident and non-resident. | 78 | - $EA attributes can be both resident and non-resident. |
79 | - Use %z for size_t to fix compilation warnings. (Andrew Morton) | 79 | - Use %z for size_t to fix compilation warnings. (Andrew Morton) |
80 | - Fix compilation warnings with gcc-4.0.2 on SUSE 10.0. | ||
80 | 81 | ||
81 | 2.1.24 - Lots of bug fixes and support more clean journal states. | 82 | 2.1.24 - Lots of bug fixes and support more clean journal states. |
82 | 83 | ||
diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c index df2e2091f936..eda056bac256 100644 --- a/fs/ntfs/attrib.c +++ b/fs/ntfs/attrib.c | |||
@@ -91,7 +91,7 @@ int ntfs_map_runlist_nolock(ntfs_inode *ni, VCN vcn, ntfs_attr_search_ctx *ctx) | |||
91 | struct page *put_this_page = NULL; | 91 | struct page *put_this_page = NULL; |
92 | int err = 0; | 92 | int err = 0; |
93 | BOOL ctx_is_temporary, ctx_needs_reset; | 93 | BOOL ctx_is_temporary, ctx_needs_reset; |
94 | ntfs_attr_search_ctx old_ctx; | 94 | ntfs_attr_search_ctx old_ctx = { NULL, }; |
95 | 95 | ||
96 | ntfs_debug("Mapping runlist part containing vcn 0x%llx.", | 96 | ntfs_debug("Mapping runlist part containing vcn 0x%llx.", |
97 | (unsigned long long)vcn); | 97 | (unsigned long long)vcn); |
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index cdedc84e1372..cf3e6ced2d01 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c | |||
@@ -78,12 +78,8 @@ static int ntfs_file_open(struct inode *vi, struct file *filp) | |||
78 | * Extend the initialized size of an attribute described by the ntfs inode @ni | 78 | * Extend the initialized size of an attribute described by the ntfs inode @ni |
79 | * to @new_init_size bytes. This involves zeroing any non-sparse space between | 79 | * to @new_init_size bytes. This involves zeroing any non-sparse space between |
80 | * the old initialized size and @new_init_size both in the page cache and on | 80 | * the old initialized size and @new_init_size both in the page cache and on |
81 | * disk (if relevant complete pages are zeroed in the page cache then these may | 81 | * disk (if relevant complete pages are already uptodate in the page cache then |
82 | * simply be marked dirty for later writeout). There is one caveat and that is | 82 | * these are simply marked dirty). |
83 | * that if any uptodate page cache pages between the old initialized size and | ||
84 | * the smaller of @new_init_size and the file size (vfs inode->i_size) are in | ||
85 | * memory, these need to be marked dirty without being zeroed since they could | ||
86 | * be non-zero due to mmap() based writes. | ||
87 | * | 83 | * |
88 | * As a side-effect, the file size (vfs inode->i_size) may be incremented as, | 84 | * As a side-effect, the file size (vfs inode->i_size) may be incremented as, |
89 | * in the resident attribute case, it is tied to the initialized size and, in | 85 | * in the resident attribute case, it is tied to the initialized size and, in |
@@ -98,10 +94,10 @@ static int ntfs_file_open(struct inode *vi, struct file *filp) | |||
98 | * with new data via mmap() based writes, so we cannot just zero it. And since | 94 | * with new data via mmap() based writes, so we cannot just zero it. And since |
99 | * POSIX specifies that the behaviour of resizing a file whilst it is mmap()ped | 95 | * POSIX specifies that the behaviour of resizing a file whilst it is mmap()ped |
100 | * is unspecified, we choose not to do zeroing and thus we do not need to touch | 96 | * is unspecified, we choose not to do zeroing and thus we do not need to touch |
101 | * the page at all. For a more detailed explanation see ntfs_truncate() which | 97 | * the page at all. For a more detailed explanation see ntfs_truncate() in |
102 | * is in fs/ntfs/inode.c. | 98 | * fs/ntfs/inode.c. |
103 | * | 99 | * |
104 | * @cached_page and @lru_pvec are just optimisations for dealing with multiple | 100 | * @cached_page and @lru_pvec are just optimizations for dealing with multiple |
105 | * pages. | 101 | * pages. |
106 | * | 102 | * |
107 | * Return 0 on success and -errno on error. In the case that an error is | 103 | * Return 0 on success and -errno on error. In the case that an error is |
@@ -110,9 +106,8 @@ static int ntfs_file_open(struct inode *vi, struct file *filp) | |||
110 | * 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 |
111 | * metadata is self-consistent. | 107 | * metadata is self-consistent. |
112 | * | 108 | * |
113 | * Locking: This function locks the mft record of the base ntfs inode and | 109 | * Locking: i_sem on the vfs inode corrseponsind to the ntfs inode @ni must be |
114 | * maintains the lock throughout execution of the function. This is required | 110 | * held by the caller. |
115 | * so that the initialized size of the attribute can be modified safely. | ||
116 | */ | 111 | */ |
117 | 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, |
118 | struct page **cached_page, struct pagevec *lru_pvec) | 113 | struct page **cached_page, struct pagevec *lru_pvec) |
@@ -1836,7 +1831,7 @@ static ssize_t ntfs_file_buffered_write(struct kiocb *iocb, | |||
1836 | VCN last_vcn; | 1831 | VCN last_vcn; |
1837 | LCN lcn; | 1832 | LCN lcn; |
1838 | unsigned long flags; | 1833 | unsigned long flags; |
1839 | size_t bytes, iov_ofs; | 1834 | size_t bytes, iov_ofs = 0; /* Offset in the current iovec. */ |
1840 | ssize_t status, written; | 1835 | ssize_t status, written; |
1841 | unsigned nr_pages; | 1836 | unsigned nr_pages; |
1842 | int err; | 1837 | int err; |
@@ -1988,8 +1983,6 @@ static ssize_t ntfs_file_buffered_write(struct kiocb *iocb, | |||
1988 | last_vcn = -1; | 1983 | last_vcn = -1; |
1989 | if (likely(nr_segs == 1)) | 1984 | if (likely(nr_segs == 1)) |
1990 | buf = iov->iov_base; | 1985 | buf = iov->iov_base; |
1991 | else | ||
1992 | iov_ofs = 0; /* Offset in the current iovec. */ | ||
1993 | do { | 1986 | do { |
1994 | VCN vcn; | 1987 | VCN vcn; |
1995 | pgoff_t idx, start_idx; | 1988 | pgoff_t idx, start_idx; |