aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ntfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ntfs')
-rw-r--r--fs/ntfs/file.c42
-rw-r--r--fs/ntfs/layout.h2
-rw-r--r--fs/ntfs/malloc.h2
3 files changed, 3 insertions, 43 deletions
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
index 4350d4993b18..663c0e341f8b 100644
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
@@ -2146,46 +2146,6 @@ static ssize_t ntfs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
2146} 2146}
2147 2147
2148/** 2148/**
2149 * ntfs_file_writev -
2150 *
2151 * Basically the same as generic_file_writev() except that it ends up calling
2152 * ntfs_file_aio_write_nolock() instead of __generic_file_aio_write_nolock().
2153 */
2154static ssize_t ntfs_file_writev(struct file *file, const struct iovec *iov,
2155 unsigned long nr_segs, loff_t *ppos)
2156{
2157 struct address_space *mapping = file->f_mapping;
2158 struct inode *inode = mapping->host;
2159 struct kiocb kiocb;
2160 ssize_t ret;
2161
2162 mutex_lock(&inode->i_mutex);
2163 init_sync_kiocb(&kiocb, file);
2164 ret = ntfs_file_aio_write_nolock(&kiocb, iov, nr_segs, ppos);
2165 if (ret == -EIOCBQUEUED)
2166 ret = wait_on_sync_kiocb(&kiocb);
2167 mutex_unlock(&inode->i_mutex);
2168 if (ret > 0) {
2169 int err = generic_write_sync(file, *ppos - ret, ret);
2170 if (err < 0)
2171 ret = err;
2172 }
2173 return ret;
2174}
2175
2176/**
2177 * ntfs_file_write - simple wrapper for ntfs_file_writev()
2178 */
2179static ssize_t ntfs_file_write(struct file *file, const char __user *buf,
2180 size_t count, loff_t *ppos)
2181{
2182 struct iovec local_iov = { .iov_base = (void __user *)buf,
2183 .iov_len = count };
2184
2185 return ntfs_file_writev(file, &local_iov, 1, ppos);
2186}
2187
2188/**
2189 * ntfs_file_fsync - sync a file to disk 2149 * ntfs_file_fsync - sync a file to disk
2190 * @filp: file to be synced 2150 * @filp: file to be synced
2191 * @dentry: dentry describing the file to sync 2151 * @dentry: dentry describing the file to sync
@@ -2247,7 +2207,7 @@ const struct file_operations ntfs_file_ops = {
2247 .read = do_sync_read, /* Read from file. */ 2207 .read = do_sync_read, /* Read from file. */
2248 .aio_read = generic_file_aio_read, /* Async read from file. */ 2208 .aio_read = generic_file_aio_read, /* Async read from file. */
2249#ifdef NTFS_RW 2209#ifdef NTFS_RW
2250 .write = ntfs_file_write, /* Write to file. */ 2210 .write = do_sync_write, /* Write to file. */
2251 .aio_write = ntfs_file_aio_write, /* Async write to file. */ 2211 .aio_write = ntfs_file_aio_write, /* Async write to file. */
2252 /*.release = ,*/ /* Last file is closed. See 2212 /*.release = ,*/ /* Last file is closed. See
2253 fs/ext2/file.c:: 2213 fs/ext2/file.c::
diff --git a/fs/ntfs/layout.h b/fs/ntfs/layout.h
index 50931b1ce4b9..8b2549f672bf 100644
--- a/fs/ntfs/layout.h
+++ b/fs/ntfs/layout.h
@@ -829,7 +829,7 @@ enum {
829 /* Note, FILE_ATTR_VALID_SET_FLAGS masks out the old DOS VolId, the 829 /* Note, FILE_ATTR_VALID_SET_FLAGS masks out the old DOS VolId, the
830 F_A_DEVICE, F_A_DIRECTORY, F_A_SPARSE_FILE, F_A_REPARSE_POINT, 830 F_A_DEVICE, F_A_DIRECTORY, F_A_SPARSE_FILE, F_A_REPARSE_POINT,
831 F_A_COMPRESSED, and F_A_ENCRYPTED and preserves the rest. This mask 831 F_A_COMPRESSED, and F_A_ENCRYPTED and preserves the rest. This mask
832 is used to to obtain all flags that are valid for setting. */ 832 is used to obtain all flags that are valid for setting. */
833 /* 833 /*
834 * The flag FILE_ATTR_DUP_FILENAME_INDEX_PRESENT is present in all 834 * The flag FILE_ATTR_DUP_FILENAME_INDEX_PRESENT is present in all
835 * FILENAME_ATTR attributes but not in the STANDARD_INFORMATION 835 * FILENAME_ATTR attributes but not in the STANDARD_INFORMATION
diff --git a/fs/ntfs/malloc.h b/fs/ntfs/malloc.h
index cd0be3f5c3cd..a44b14cbceeb 100644
--- a/fs/ntfs/malloc.h
+++ b/fs/ntfs/malloc.h
@@ -47,7 +47,7 @@ static inline void *__ntfs_malloc(unsigned long size, gfp_t gfp_mask)
47 return kmalloc(PAGE_SIZE, gfp_mask & ~__GFP_HIGHMEM); 47 return kmalloc(PAGE_SIZE, gfp_mask & ~__GFP_HIGHMEM);
48 /* return (void *)__get_free_page(gfp_mask); */ 48 /* return (void *)__get_free_page(gfp_mask); */
49 } 49 }
50 if (likely(size >> PAGE_SHIFT < num_physpages)) 50 if (likely((size >> PAGE_SHIFT) < totalram_pages))
51 return __vmalloc(size, gfp_mask, PAGE_KERNEL); 51 return __vmalloc(size, gfp_mask, PAGE_KERNEL);
52 return NULL; 52 return NULL;
53} 53}