Commit dda65b94 authored by Anton Altaparmakov's avatar Anton Altaparmakov

NTFS: Fix compilation warnings with gcc-4.0.2 on SUSE 10.0.

Signed-off-by: default avatarAnton Altaparmakov <aia21@cantab.net>
parent d04bd1fb
...@@ -77,6 +77,7 @@ ToDo/Notes: ...@@ -77,6 +77,7 @@ ToDo/Notes:
EOPNOTSUPP is returned. EOPNOTSUPP is returned.
- $EA attributes can be both resident and non-resident. - $EA attributes can be both resident and non-resident.
- Use %z for size_t to fix compilation warnings. (Andrew Morton) - Use %z for size_t to fix compilation warnings. (Andrew Morton)
- Fix compilation warnings with gcc-4.0.2 on SUSE 10.0.
2.1.24 - Lots of bug fixes and support more clean journal states. 2.1.24 - Lots of bug fixes and support more clean journal states.
......
...@@ -91,7 +91,7 @@ int ntfs_map_runlist_nolock(ntfs_inode *ni, VCN vcn, ntfs_attr_search_ctx *ctx) ...@@ -91,7 +91,7 @@ int ntfs_map_runlist_nolock(ntfs_inode *ni, VCN vcn, ntfs_attr_search_ctx *ctx)
struct page *put_this_page = NULL; struct page *put_this_page = NULL;
int err = 0; int err = 0;
BOOL ctx_is_temporary, ctx_needs_reset; BOOL ctx_is_temporary, ctx_needs_reset;
ntfs_attr_search_ctx old_ctx; ntfs_attr_search_ctx old_ctx = { NULL, };
ntfs_debug("Mapping runlist part containing vcn 0x%llx.", ntfs_debug("Mapping runlist part containing vcn 0x%llx.",
(unsigned long long)vcn); (unsigned long long)vcn);
......
...@@ -78,12 +78,8 @@ static int ntfs_file_open(struct inode *vi, struct file *filp) ...@@ -78,12 +78,8 @@ static int ntfs_file_open(struct inode *vi, struct file *filp)
* Extend the initialized size of an attribute described by the ntfs inode @ni * Extend the initialized size of an attribute described by the ntfs inode @ni
* to @new_init_size bytes. This involves zeroing any non-sparse space between * to @new_init_size bytes. This involves zeroing any non-sparse space between
* the old initialized size and @new_init_size both in the page cache and on * the old initialized size and @new_init_size both in the page cache and on
* disk (if relevant complete pages are zeroed in the page cache then these may * disk (if relevant complete pages are already uptodate in the page cache then
* simply be marked dirty for later writeout). There is one caveat and that is * these are simply marked dirty).
* that if any uptodate page cache pages between the old initialized size and
* the smaller of @new_init_size and the file size (vfs inode->i_size) are in
* memory, these need to be marked dirty without being zeroed since they could
* be non-zero due to mmap() based writes.
* *
* As a side-effect, the file size (vfs inode->i_size) may be incremented as, * As a side-effect, the file size (vfs inode->i_size) may be incremented as,
* in the resident attribute case, it is tied to the initialized size and, in * 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,10 +94,10 @@ static int ntfs_file_open(struct inode *vi, struct file *filp)
* with new data via mmap() based writes, so we cannot just zero it. And since * with new data via mmap() based writes, so we cannot just zero it. And since
* POSIX specifies that the behaviour of resizing a file whilst it is mmap()ped * POSIX specifies that the behaviour of resizing a file whilst it is mmap()ped
* is unspecified, we choose not to do zeroing and thus we do not need to touch * is unspecified, we choose not to do zeroing and thus we do not need to touch
* the page at all. For a more detailed explanation see ntfs_truncate() which * the page at all. For a more detailed explanation see ntfs_truncate() in
* is in fs/ntfs/inode.c. * fs/ntfs/inode.c.
* *
* @cached_page and @lru_pvec are just optimisations for dealing with multiple * @cached_page and @lru_pvec are just optimizations for dealing with multiple
* pages. * pages.
* *
* Return 0 on success and -errno on error. In the case that an error is * 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,9 +106,8 @@ static int ntfs_file_open(struct inode *vi, struct file *filp)
* this is the case, the necessary zeroing will also have happened and that all * this is the case, the necessary zeroing will also have happened and that all
* metadata is self-consistent. * metadata is self-consistent.
* *
* Locking: This function locks the mft record of the base ntfs inode and * Locking: i_sem on the vfs inode corrseponsind to the ntfs inode @ni must be
* maintains the lock throughout execution of the function. This is required * held by the caller.
* so that the initialized size of the attribute can be modified safely.
*/ */
static int ntfs_attr_extend_initialized(ntfs_inode *ni, const s64 new_init_size, static int ntfs_attr_extend_initialized(ntfs_inode *ni, const s64 new_init_size,
struct page **cached_page, struct pagevec *lru_pvec) struct page **cached_page, struct pagevec *lru_pvec)
...@@ -1836,7 +1831,7 @@ static ssize_t ntfs_file_buffered_write(struct kiocb *iocb, ...@@ -1836,7 +1831,7 @@ static ssize_t ntfs_file_buffered_write(struct kiocb *iocb,
VCN last_vcn; VCN last_vcn;
LCN lcn; LCN lcn;
unsigned long flags; unsigned long flags;
size_t bytes, iov_ofs; size_t bytes, iov_ofs = 0; /* Offset in the current iovec. */
ssize_t status, written; ssize_t status, written;
unsigned nr_pages; unsigned nr_pages;
int err; int err;
...@@ -1988,8 +1983,6 @@ static ssize_t ntfs_file_buffered_write(struct kiocb *iocb, ...@@ -1988,8 +1983,6 @@ static ssize_t ntfs_file_buffered_write(struct kiocb *iocb,
last_vcn = -1; last_vcn = -1;
if (likely(nr_segs == 1)) if (likely(nr_segs == 1))
buf = iov->iov_base; buf = iov->iov_base;
else
iov_ofs = 0; /* Offset in the current iovec. */
do { do {
VCN vcn; VCN vcn;
pgoff_t idx, start_idx; pgoff_t idx, start_idx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment