diff options
author | Paul Mackerras <paulus@samba.org> | 2005-10-12 00:43:32 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-10-12 00:43:32 -0400 |
commit | b6ec995a21a9428aef620b5adf46d047a18d88b8 (patch) | |
tree | 6719121e6605cbca524b687f47336b9bbf3b8d41 /fs | |
parent | 3a5f8c5f788d68e325d9fe3c26f4df5a5aee838a (diff) | |
parent | da64c6ee6bb71bfb3f09d9bb89ce1aa4b1ee7e89 (diff) |
Merge from Linus' tree
Diffstat (limited to 'fs')
-rw-r--r-- | fs/9p/vfs_file.c | 114 | ||||
-rw-r--r-- | fs/9p/vfs_super.c | 2 | ||||
-rw-r--r-- | fs/aio.c | 98 | ||||
-rw-r--r-- | fs/bfs/dir.c | 2 | ||||
-rw-r--r-- | fs/bfs/inode.c | 44 | ||||
-rw-r--r-- | fs/binfmt_elf.c | 2 | ||||
-rw-r--r-- | fs/bio.c | 10 | ||||
-rw-r--r-- | fs/buffer.c | 2 | ||||
-rw-r--r-- | fs/fuse/file.c | 4 | ||||
-rw-r--r-- | fs/hostfs/hostfs_kern.c | 7 | ||||
-rw-r--r-- | fs/mpage.c | 2 | ||||
-rw-r--r-- | fs/namei.c | 6 | ||||
-rw-r--r-- | fs/nfs_common/nfsacl.c | 70 | ||||
-rw-r--r-- | fs/ntfs/ChangeLog | 3 | ||||
-rw-r--r-- | fs/ntfs/bitmap.c | 5 | ||||
-rw-r--r-- | fs/ntfs/layout.h | 2 | ||||
-rw-r--r-- | fs/ntfs/malloc.h | 2 | ||||
-rw-r--r-- | fs/ntfs/mft.c | 3 | ||||
-rw-r--r-- | fs/ntfs/unistr.c | 2 | ||||
-rw-r--r-- | fs/posix_acl.c | 6 | ||||
-rw-r--r-- | fs/read_write.c | 3 | ||||
-rw-r--r-- | fs/relayfs/buffers.c | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/kmem.c | 10 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/kmem.h | 13 |
24 files changed, 190 insertions, 224 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index a4799e971d1c..bbc3cc63854f 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c | |||
@@ -175,16 +175,16 @@ static int v9fs_file_lock(struct file *filp, int cmd, struct file_lock *fl) | |||
175 | } | 175 | } |
176 | 176 | ||
177 | /** | 177 | /** |
178 | * v9fs_read - read from a file (internal) | 178 | * v9fs_file_read - read from a file |
179 | * @filep: file pointer to read | 179 | * @filep: file pointer to read |
180 | * @data: data buffer to read data into | 180 | * @data: data buffer to read data into |
181 | * @count: size of buffer | 181 | * @count: size of buffer |
182 | * @offset: offset at which to read data | 182 | * @offset: offset at which to read data |
183 | * | 183 | * |
184 | */ | 184 | */ |
185 | |||
186 | static ssize_t | 185 | static ssize_t |
187 | v9fs_read(struct file *filp, char *buffer, size_t count, loff_t * offset) | 186 | v9fs_file_read(struct file *filp, char __user * data, size_t count, |
187 | loff_t * offset) | ||
188 | { | 188 | { |
189 | struct inode *inode = filp->f_dentry->d_inode; | 189 | struct inode *inode = filp->f_dentry->d_inode; |
190 | struct v9fs_session_info *v9ses = v9fs_inode2v9ses(inode); | 190 | struct v9fs_session_info *v9ses = v9fs_inode2v9ses(inode); |
@@ -194,6 +194,7 @@ v9fs_read(struct file *filp, char *buffer, size_t count, loff_t * offset) | |||
194 | int rsize = 0; | 194 | int rsize = 0; |
195 | int result = 0; | 195 | int result = 0; |
196 | int total = 0; | 196 | int total = 0; |
197 | int n; | ||
197 | 198 | ||
198 | dprintk(DEBUG_VFS, "\n"); | 199 | dprintk(DEBUG_VFS, "\n"); |
199 | 200 | ||
@@ -216,10 +217,15 @@ v9fs_read(struct file *filp, char *buffer, size_t count, loff_t * offset) | |||
216 | } else | 217 | } else |
217 | *offset += result; | 218 | *offset += result; |
218 | 219 | ||
219 | /* XXX - extra copy */ | 220 | n = copy_to_user(data, fcall->params.rread.data, result); |
220 | memcpy(buffer, fcall->params.rread.data, result); | 221 | if (n) { |
222 | dprintk(DEBUG_ERROR, "Problem copying to user %d\n", n); | ||
223 | kfree(fcall); | ||
224 | return -EFAULT; | ||
225 | } | ||
226 | |||
221 | count -= result; | 227 | count -= result; |
222 | buffer += result; | 228 | data += result; |
223 | total += result; | 229 | total += result; |
224 | 230 | ||
225 | kfree(fcall); | 231 | kfree(fcall); |
@@ -232,42 +238,7 @@ v9fs_read(struct file *filp, char *buffer, size_t count, loff_t * offset) | |||
232 | } | 238 | } |
233 | 239 | ||
234 | /** | 240 | /** |
235 | * v9fs_file_read - read from a file | 241 | * v9fs_file_write - write to a file |
236 | * @filep: file pointer to read | ||
237 | * @data: data buffer to read data into | ||
238 | * @count: size of buffer | ||
239 | * @offset: offset at which to read data | ||
240 | * | ||
241 | */ | ||
242 | |||
243 | static ssize_t | ||
244 | v9fs_file_read(struct file *filp, char __user * data, size_t count, | ||
245 | loff_t * offset) | ||
246 | { | ||
247 | int retval = -1; | ||
248 | int ret = 0; | ||
249 | char *buffer; | ||
250 | |||
251 | buffer = kmalloc(count, GFP_KERNEL); | ||
252 | if (!buffer) | ||
253 | return -ENOMEM; | ||
254 | |||
255 | retval = v9fs_read(filp, buffer, count, offset); | ||
256 | if (retval > 0) { | ||
257 | if ((ret = copy_to_user(data, buffer, retval)) != 0) { | ||
258 | dprintk(DEBUG_ERROR, "Problem copying to user %d\n", | ||
259 | ret); | ||
260 | retval = ret; | ||
261 | } | ||
262 | } | ||
263 | |||
264 | kfree(buffer); | ||
265 | |||
266 | return retval; | ||
267 | } | ||
268 | |||
269 | /** | ||
270 | * v9fs_write - write to a file | ||
271 | * @filep: file pointer to write | 242 | * @filep: file pointer to write |
272 | * @data: data buffer to write data from | 243 | * @data: data buffer to write data from |
273 | * @count: size of buffer | 244 | * @count: size of buffer |
@@ -276,7 +247,8 @@ v9fs_file_read(struct file *filp, char __user * data, size_t count, | |||
276 | */ | 247 | */ |
277 | 248 | ||
278 | static ssize_t | 249 | static ssize_t |
279 | v9fs_write(struct file *filp, char *buffer, size_t count, loff_t * offset) | 250 | v9fs_file_write(struct file *filp, const char __user * data, |
251 | size_t count, loff_t * offset) | ||
280 | { | 252 | { |
281 | struct inode *inode = filp->f_dentry->d_inode; | 253 | struct inode *inode = filp->f_dentry->d_inode; |
282 | struct v9fs_session_info *v9ses = v9fs_inode2v9ses(inode); | 254 | struct v9fs_session_info *v9ses = v9fs_inode2v9ses(inode); |
@@ -286,30 +258,42 @@ v9fs_write(struct file *filp, char *buffer, size_t count, loff_t * offset) | |||
286 | int result = -EIO; | 258 | int result = -EIO; |
287 | int rsize = 0; | 259 | int rsize = 0; |
288 | int total = 0; | 260 | int total = 0; |
261 | char *buf; | ||
289 | 262 | ||
290 | dprintk(DEBUG_VFS, "data %p count %d offset %x\n", buffer, (int)count, | 263 | dprintk(DEBUG_VFS, "data %p count %d offset %x\n", data, (int)count, |
291 | (int)*offset); | 264 | (int)*offset); |
292 | rsize = v9ses->maxdata - V9FS_IOHDRSZ; | 265 | rsize = v9ses->maxdata - V9FS_IOHDRSZ; |
293 | if (v9fid->iounit != 0 && rsize > v9fid->iounit) | 266 | if (v9fid->iounit != 0 && rsize > v9fid->iounit) |
294 | rsize = v9fid->iounit; | 267 | rsize = v9fid->iounit; |
295 | 268 | ||
296 | dump_data(buffer, count); | 269 | buf = kmalloc(v9ses->maxdata - V9FS_IOHDRSZ, GFP_KERNEL); |
270 | if (!buf) | ||
271 | return -ENOMEM; | ||
297 | 272 | ||
298 | do { | 273 | do { |
299 | if (count < rsize) | 274 | if (count < rsize) |
300 | rsize = count; | 275 | rsize = count; |
301 | 276 | ||
302 | result = | 277 | result = copy_from_user(buf, data, rsize); |
303 | v9fs_t_write(v9ses, fid, *offset, rsize, buffer, &fcall); | 278 | if (result) { |
279 | dprintk(DEBUG_ERROR, "Problem copying from user\n"); | ||
280 | kfree(buf); | ||
281 | return -EFAULT; | ||
282 | } | ||
283 | |||
284 | dump_data(buf, rsize); | ||
285 | result = v9fs_t_write(v9ses, fid, *offset, rsize, buf, &fcall); | ||
304 | if (result < 0) { | 286 | if (result < 0) { |
305 | eprintk(KERN_ERR, "error while writing: %s(%d)\n", | 287 | eprintk(KERN_ERR, "error while writing: %s(%d)\n", |
306 | FCALL_ERROR(fcall), result); | 288 | FCALL_ERROR(fcall), result); |
307 | kfree(fcall); | 289 | kfree(fcall); |
290 | kfree(buf); | ||
308 | return result; | 291 | return result; |
309 | } else | 292 | } else |
310 | *offset += result; | 293 | *offset += result; |
311 | 294 | ||
312 | kfree(fcall); | 295 | kfree(fcall); |
296 | fcall = NULL; | ||
313 | 297 | ||
314 | if (result != rsize) { | 298 | if (result != rsize) { |
315 | eprintk(KERN_ERR, | 299 | eprintk(KERN_ERR, |
@@ -319,46 +303,14 @@ v9fs_write(struct file *filp, char *buffer, size_t count, loff_t * offset) | |||
319 | } | 303 | } |
320 | 304 | ||
321 | count -= result; | 305 | count -= result; |
322 | buffer += result; | 306 | data += result; |
323 | total += result; | 307 | total += result; |
324 | } while (count); | 308 | } while (count); |
325 | 309 | ||
310 | kfree(buf); | ||
326 | return total; | 311 | return total; |
327 | } | 312 | } |
328 | 313 | ||
329 | /** | ||
330 | * v9fs_file_write - write to a file | ||
331 | * @filep: file pointer to write | ||
332 | * @data: data buffer to write data from | ||
333 | * @count: size of buffer | ||
334 | * @offset: offset at which to write data | ||
335 | * | ||
336 | */ | ||
337 | |||
338 | static ssize_t | ||
339 | v9fs_file_write(struct file *filp, const char __user * data, | ||
340 | size_t count, loff_t * offset) | ||
341 | { | ||
342 | int ret = -1; | ||
343 | char *buffer; | ||
344 | |||
345 | buffer = kmalloc(count, GFP_KERNEL); | ||
346 | if (buffer == NULL) | ||
347 | return -ENOMEM; | ||
348 | |||
349 | ret = copy_from_user(buffer, data, count); | ||
350 | if (ret) { | ||
351 | dprintk(DEBUG_ERROR, "Problem copying from user\n"); | ||
352 | ret = -EFAULT; | ||
353 | } else { | ||
354 | ret = v9fs_write(filp, buffer, count, offset); | ||
355 | } | ||
356 | |||
357 | kfree(buffer); | ||
358 | |||
359 | return ret; | ||
360 | } | ||
361 | |||
362 | struct file_operations v9fs_file_operations = { | 314 | struct file_operations v9fs_file_operations = { |
363 | .llseek = generic_file_llseek, | 315 | .llseek = generic_file_llseek, |
364 | .read = v9fs_file_read, | 316 | .read = v9fs_file_read, |
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index 0957f4da91d4..82c5b0084079 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c | |||
@@ -129,7 +129,7 @@ static struct super_block *v9fs_get_sb(struct file_system_type | |||
129 | 129 | ||
130 | if ((newfid = v9fs_session_init(v9ses, dev_name, data)) < 0) { | 130 | if ((newfid = v9fs_session_init(v9ses, dev_name, data)) < 0) { |
131 | dprintk(DEBUG_ERROR, "problem initiating session\n"); | 131 | dprintk(DEBUG_ERROR, "problem initiating session\n"); |
132 | return newfid; | 132 | return ERR_PTR(newfid); |
133 | } | 133 | } |
134 | 134 | ||
135 | sb = sget(fs_type, NULL, v9fs_set_super, v9ses); | 135 | sb = sget(fs_type, NULL, v9fs_set_super, v9ses); |
@@ -741,19 +741,9 @@ static ssize_t aio_run_iocb(struct kiocb *iocb) | |||
741 | ret = retry(iocb); | 741 | ret = retry(iocb); |
742 | current->io_wait = NULL; | 742 | current->io_wait = NULL; |
743 | 743 | ||
744 | if (-EIOCBRETRY != ret) { | 744 | if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED) { |
745 | if (-EIOCBQUEUED != ret) { | 745 | BUG_ON(!list_empty(&iocb->ki_wait.task_list)); |
746 | BUG_ON(!list_empty(&iocb->ki_wait.task_list)); | 746 | aio_complete(iocb, ret, 0); |
747 | aio_complete(iocb, ret, 0); | ||
748 | /* must not access the iocb after this */ | ||
749 | } | ||
750 | } else { | ||
751 | /* | ||
752 | * Issue an additional retry to avoid waiting forever if | ||
753 | * no waits were queued (e.g. in case of a short read). | ||
754 | */ | ||
755 | if (list_empty(&iocb->ki_wait.task_list)) | ||
756 | kiocbSetKicked(iocb); | ||
757 | } | 747 | } |
758 | out: | 748 | out: |
759 | spin_lock_irq(&ctx->ctx_lock); | 749 | spin_lock_irq(&ctx->ctx_lock); |
@@ -899,16 +889,24 @@ static void aio_kick_handler(void *data) | |||
899 | * and if required activate the aio work queue to process | 889 | * and if required activate the aio work queue to process |
900 | * it | 890 | * it |
901 | */ | 891 | */ |
902 | static void queue_kicked_iocb(struct kiocb *iocb) | 892 | static void try_queue_kicked_iocb(struct kiocb *iocb) |
903 | { | 893 | { |
904 | struct kioctx *ctx = iocb->ki_ctx; | 894 | struct kioctx *ctx = iocb->ki_ctx; |
905 | unsigned long flags; | 895 | unsigned long flags; |
906 | int run = 0; | 896 | int run = 0; |
907 | 897 | ||
908 | WARN_ON((!list_empty(&iocb->ki_wait.task_list))); | 898 | /* We're supposed to be the only path putting the iocb back on the run |
899 | * list. If we find that the iocb is *back* on a wait queue already | ||
900 | * than retry has happened before we could queue the iocb. This also | ||
901 | * means that the retry could have completed and freed our iocb, no | ||
902 | * good. */ | ||
903 | BUG_ON((!list_empty(&iocb->ki_wait.task_list))); | ||
909 | 904 | ||
910 | spin_lock_irqsave(&ctx->ctx_lock, flags); | 905 | spin_lock_irqsave(&ctx->ctx_lock, flags); |
911 | run = __queue_kicked_iocb(iocb); | 906 | /* set this inside the lock so that we can't race with aio_run_iocb() |
907 | * testing it and putting the iocb on the run list under the lock */ | ||
908 | if (!kiocbTryKick(iocb)) | ||
909 | run = __queue_kicked_iocb(iocb); | ||
912 | spin_unlock_irqrestore(&ctx->ctx_lock, flags); | 910 | spin_unlock_irqrestore(&ctx->ctx_lock, flags); |
913 | if (run) | 911 | if (run) |
914 | aio_queue_work(ctx); | 912 | aio_queue_work(ctx); |
@@ -931,10 +929,7 @@ void fastcall kick_iocb(struct kiocb *iocb) | |||
931 | return; | 929 | return; |
932 | } | 930 | } |
933 | 931 | ||
934 | /* If its already kicked we shouldn't queue it again */ | 932 | try_queue_kicked_iocb(iocb); |
935 | if (!kiocbTryKick(iocb)) { | ||
936 | queue_kicked_iocb(iocb); | ||
937 | } | ||
938 | } | 933 | } |
939 | EXPORT_SYMBOL(kick_iocb); | 934 | EXPORT_SYMBOL(kick_iocb); |
940 | 935 | ||
@@ -1322,8 +1317,11 @@ asmlinkage long sys_io_destroy(aio_context_t ctx) | |||
1322 | } | 1317 | } |
1323 | 1318 | ||
1324 | /* | 1319 | /* |
1325 | * Default retry method for aio_read (also used for first time submit) | 1320 | * aio_p{read,write} are the default ki_retry methods for |
1326 | * Responsible for updating iocb state as retries progress | 1321 | * IO_CMD_P{READ,WRITE}. They maintains kiocb retry state around potentially |
1322 | * multiple calls to f_op->aio_read(). They loop around partial progress | ||
1323 | * instead of returning -EIOCBRETRY because they don't have the means to call | ||
1324 | * kick_iocb(). | ||
1327 | */ | 1325 | */ |
1328 | static ssize_t aio_pread(struct kiocb *iocb) | 1326 | static ssize_t aio_pread(struct kiocb *iocb) |
1329 | { | 1327 | { |
@@ -1332,25 +1330,25 @@ static ssize_t aio_pread(struct kiocb *iocb) | |||
1332 | struct inode *inode = mapping->host; | 1330 | struct inode *inode = mapping->host; |
1333 | ssize_t ret = 0; | 1331 | ssize_t ret = 0; |
1334 | 1332 | ||
1335 | ret = file->f_op->aio_read(iocb, iocb->ki_buf, | 1333 | do { |
1336 | iocb->ki_left, iocb->ki_pos); | 1334 | ret = file->f_op->aio_read(iocb, iocb->ki_buf, |
1335 | iocb->ki_left, iocb->ki_pos); | ||
1336 | /* | ||
1337 | * Can't just depend on iocb->ki_left to determine | ||
1338 | * whether we are done. This may have been a short read. | ||
1339 | */ | ||
1340 | if (ret > 0) { | ||
1341 | iocb->ki_buf += ret; | ||
1342 | iocb->ki_left -= ret; | ||
1343 | } | ||
1337 | 1344 | ||
1338 | /* | ||
1339 | * Can't just depend on iocb->ki_left to determine | ||
1340 | * whether we are done. This may have been a short read. | ||
1341 | */ | ||
1342 | if (ret > 0) { | ||
1343 | iocb->ki_buf += ret; | ||
1344 | iocb->ki_left -= ret; | ||
1345 | /* | 1345 | /* |
1346 | * For pipes and sockets we return once we have | 1346 | * For pipes and sockets we return once we have some data; for |
1347 | * some data; for regular files we retry till we | 1347 | * regular files we retry till we complete the entire read or |
1348 | * complete the entire read or find that we can't | 1348 | * find that we can't read any more data (e.g short reads). |
1349 | * read any more data (e.g short reads). | ||
1350 | */ | 1349 | */ |
1351 | if (!S_ISFIFO(inode->i_mode) && !S_ISSOCK(inode->i_mode)) | 1350 | } while (ret > 0 && iocb->ki_left > 0 && |
1352 | ret = -EIOCBRETRY; | 1351 | !S_ISFIFO(inode->i_mode) && !S_ISSOCK(inode->i_mode)); |
1353 | } | ||
1354 | 1352 | ||
1355 | /* This means we must have transferred all that we could */ | 1353 | /* This means we must have transferred all that we could */ |
1356 | /* No need to retry anymore */ | 1354 | /* No need to retry anymore */ |
@@ -1360,27 +1358,21 @@ static ssize_t aio_pread(struct kiocb *iocb) | |||
1360 | return ret; | 1358 | return ret; |
1361 | } | 1359 | } |
1362 | 1360 | ||
1363 | /* | 1361 | /* see aio_pread() */ |
1364 | * Default retry method for aio_write (also used for first time submit) | ||
1365 | * Responsible for updating iocb state as retries progress | ||
1366 | */ | ||
1367 | static ssize_t aio_pwrite(struct kiocb *iocb) | 1362 | static ssize_t aio_pwrite(struct kiocb *iocb) |
1368 | { | 1363 | { |
1369 | struct file *file = iocb->ki_filp; | 1364 | struct file *file = iocb->ki_filp; |
1370 | ssize_t ret = 0; | 1365 | ssize_t ret = 0; |
1371 | 1366 | ||
1372 | ret = file->f_op->aio_write(iocb, iocb->ki_buf, | 1367 | do { |
1373 | iocb->ki_left, iocb->ki_pos); | 1368 | ret = file->f_op->aio_write(iocb, iocb->ki_buf, |
1374 | 1369 | iocb->ki_left, iocb->ki_pos); | |
1375 | if (ret > 0) { | 1370 | if (ret > 0) { |
1376 | iocb->ki_buf += ret; | 1371 | iocb->ki_buf += ret; |
1377 | iocb->ki_left -= ret; | 1372 | iocb->ki_left -= ret; |
1378 | 1373 | } | |
1379 | ret = -EIOCBRETRY; | 1374 | } while (ret > 0 && iocb->ki_left > 0); |
1380 | } | ||
1381 | 1375 | ||
1382 | /* This means we must have transferred all that we could */ | ||
1383 | /* No need to retry anymore */ | ||
1384 | if ((ret == 0) || (iocb->ki_left == 0)) | 1376 | if ((ret == 0) || (iocb->ki_left == 0)) |
1385 | ret = iocb->ki_nbytes - iocb->ki_left; | 1377 | ret = iocb->ki_nbytes - iocb->ki_left; |
1386 | 1378 | ||
diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c index e240c335eb23..5af928fa0449 100644 --- a/fs/bfs/dir.c +++ b/fs/bfs/dir.c | |||
@@ -108,7 +108,7 @@ static int bfs_create(struct inode * dir, struct dentry * dentry, int mode, | |||
108 | inode->i_mapping->a_ops = &bfs_aops; | 108 | inode->i_mapping->a_ops = &bfs_aops; |
109 | inode->i_mode = mode; | 109 | inode->i_mode = mode; |
110 | inode->i_ino = ino; | 110 | inode->i_ino = ino; |
111 | BFS_I(inode)->i_dsk_ino = cpu_to_le16(ino); | 111 | BFS_I(inode)->i_dsk_ino = ino; |
112 | BFS_I(inode)->i_sblock = 0; | 112 | BFS_I(inode)->i_sblock = 0; |
113 | BFS_I(inode)->i_eblock = 0; | 113 | BFS_I(inode)->i_eblock = 0; |
114 | insert_inode_hash(inode); | 114 | insert_inode_hash(inode); |
diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index c7b39aa279d7..3af6c73c5b5a 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c | |||
@@ -357,28 +357,46 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent) | |||
357 | } | 357 | } |
358 | 358 | ||
359 | info->si_blocks = (le32_to_cpu(bfs_sb->s_end) + 1)>>BFS_BSIZE_BITS; /* for statfs(2) */ | 359 | info->si_blocks = (le32_to_cpu(bfs_sb->s_end) + 1)>>BFS_BSIZE_BITS; /* for statfs(2) */ |
360 | info->si_freeb = (le32_to_cpu(bfs_sb->s_end) + 1 - cpu_to_le32(bfs_sb->s_start))>>BFS_BSIZE_BITS; | 360 | info->si_freeb = (le32_to_cpu(bfs_sb->s_end) + 1 - le32_to_cpu(bfs_sb->s_start))>>BFS_BSIZE_BITS; |
361 | info->si_freei = 0; | 361 | info->si_freei = 0; |
362 | info->si_lf_eblk = 0; | 362 | info->si_lf_eblk = 0; |
363 | info->si_lf_sblk = 0; | 363 | info->si_lf_sblk = 0; |
364 | info->si_lf_ioff = 0; | 364 | info->si_lf_ioff = 0; |
365 | bh = NULL; | ||
365 | for (i=BFS_ROOT_INO; i<=info->si_lasti; i++) { | 366 | for (i=BFS_ROOT_INO; i<=info->si_lasti; i++) { |
366 | inode = iget(s,i); | 367 | struct bfs_inode *di; |
367 | if (BFS_I(inode)->i_dsk_ino == 0) | 368 | int block = (i - BFS_ROOT_INO)/BFS_INODES_PER_BLOCK + 1; |
369 | int off = (i - BFS_ROOT_INO) % BFS_INODES_PER_BLOCK; | ||
370 | unsigned long sblock, eblock; | ||
371 | |||
372 | if (!off) { | ||
373 | brelse(bh); | ||
374 | bh = sb_bread(s, block); | ||
375 | } | ||
376 | |||
377 | if (!bh) | ||
378 | continue; | ||
379 | |||
380 | di = (struct bfs_inode *)bh->b_data + off; | ||
381 | |||
382 | if (!di->i_ino) { | ||
368 | info->si_freei++; | 383 | info->si_freei++; |
369 | else { | 384 | continue; |
370 | set_bit(i, info->si_imap); | 385 | } |
371 | info->si_freeb -= inode->i_blocks; | 386 | set_bit(i, info->si_imap); |
372 | if (BFS_I(inode)->i_eblock > info->si_lf_eblk) { | 387 | info->si_freeb -= BFS_FILEBLOCKS(di); |
373 | info->si_lf_eblk = BFS_I(inode)->i_eblock; | 388 | |
374 | info->si_lf_sblk = BFS_I(inode)->i_sblock; | 389 | sblock = le32_to_cpu(di->i_sblock); |
375 | info->si_lf_ioff = BFS_INO2OFF(i); | 390 | eblock = le32_to_cpu(di->i_eblock); |
376 | } | 391 | if (eblock > info->si_lf_eblk) { |
392 | info->si_lf_eblk = eblock; | ||
393 | info->si_lf_sblk = sblock; | ||
394 | info->si_lf_ioff = BFS_INO2OFF(i); | ||
377 | } | 395 | } |
378 | iput(inode); | ||
379 | } | 396 | } |
397 | brelse(bh); | ||
380 | if (!(s->s_flags & MS_RDONLY)) { | 398 | if (!(s->s_flags & MS_RDONLY)) { |
381 | mark_buffer_dirty(bh); | 399 | mark_buffer_dirty(info->si_sbh); |
382 | s->s_dirt = 1; | 400 | s->s_dirt = 1; |
383 | } | 401 | } |
384 | dump_imap("read_super", s); | 402 | dump_imap("read_super", s); |
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 7976a238f0a3..d4b15576e584 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c | |||
@@ -905,7 +905,7 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) | |||
905 | send_sig(SIGKILL, current, 0); | 905 | send_sig(SIGKILL, current, 0); |
906 | goto out_free_dentry; | 906 | goto out_free_dentry; |
907 | } | 907 | } |
908 | if (padzero(elf_bss)) { | 908 | if (likely(elf_bss != elf_brk) && unlikely(padzero(elf_bss))) { |
909 | send_sig(SIGSEGV, current, 0); | 909 | send_sig(SIGSEGV, current, 0); |
910 | retval = -EFAULT; /* Nobody gets to see this, but.. */ | 910 | retval = -EFAULT; /* Nobody gets to see this, but.. */ |
911 | goto out_free_dentry; | 911 | goto out_free_dentry; |
@@ -75,7 +75,7 @@ struct bio_set { | |||
75 | */ | 75 | */ |
76 | static struct bio_set *fs_bio_set; | 76 | static struct bio_set *fs_bio_set; |
77 | 77 | ||
78 | static inline struct bio_vec *bvec_alloc_bs(unsigned int __nocast gfp_mask, int nr, unsigned long *idx, struct bio_set *bs) | 78 | static inline struct bio_vec *bvec_alloc_bs(gfp_t gfp_mask, int nr, unsigned long *idx, struct bio_set *bs) |
79 | { | 79 | { |
80 | struct bio_vec *bvl; | 80 | struct bio_vec *bvl; |
81 | struct biovec_slab *bp; | 81 | struct biovec_slab *bp; |
@@ -155,7 +155,7 @@ inline void bio_init(struct bio *bio) | |||
155 | * allocate bio and iovecs from the memory pools specified by the | 155 | * allocate bio and iovecs from the memory pools specified by the |
156 | * bio_set structure. | 156 | * bio_set structure. |
157 | **/ | 157 | **/ |
158 | struct bio *bio_alloc_bioset(unsigned int __nocast gfp_mask, int nr_iovecs, struct bio_set *bs) | 158 | struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs) |
159 | { | 159 | { |
160 | struct bio *bio = mempool_alloc(bs->bio_pool, gfp_mask); | 160 | struct bio *bio = mempool_alloc(bs->bio_pool, gfp_mask); |
161 | 161 | ||
@@ -181,7 +181,7 @@ out: | |||
181 | return bio; | 181 | return bio; |
182 | } | 182 | } |
183 | 183 | ||
184 | struct bio *bio_alloc(unsigned int __nocast gfp_mask, int nr_iovecs) | 184 | struct bio *bio_alloc(gfp_t gfp_mask, int nr_iovecs) |
185 | { | 185 | { |
186 | struct bio *bio = bio_alloc_bioset(gfp_mask, nr_iovecs, fs_bio_set); | 186 | struct bio *bio = bio_alloc_bioset(gfp_mask, nr_iovecs, fs_bio_set); |
187 | 187 | ||
@@ -277,7 +277,7 @@ inline void __bio_clone(struct bio *bio, struct bio *bio_src) | |||
277 | * | 277 | * |
278 | * Like __bio_clone, only also allocates the returned bio | 278 | * Like __bio_clone, only also allocates the returned bio |
279 | */ | 279 | */ |
280 | struct bio *bio_clone(struct bio *bio, unsigned int __nocast gfp_mask) | 280 | struct bio *bio_clone(struct bio *bio, gfp_t gfp_mask) |
281 | { | 281 | { |
282 | struct bio *b = bio_alloc_bioset(gfp_mask, bio->bi_max_vecs, fs_bio_set); | 282 | struct bio *b = bio_alloc_bioset(gfp_mask, bio->bi_max_vecs, fs_bio_set); |
283 | 283 | ||
@@ -1078,7 +1078,7 @@ struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, int first_sectors) | |||
1078 | return bp; | 1078 | return bp; |
1079 | } | 1079 | } |
1080 | 1080 | ||
1081 | static void *bio_pair_alloc(unsigned int __nocast gfp_flags, void *data) | 1081 | static void *bio_pair_alloc(gfp_t gfp_flags, void *data) |
1082 | { | 1082 | { |
1083 | return kmalloc(sizeof(struct bio_pair), gfp_flags); | 1083 | return kmalloc(sizeof(struct bio_pair), gfp_flags); |
1084 | } | 1084 | } |
diff --git a/fs/buffer.c b/fs/buffer.c index 6cbfceabd95d..1216c0d3c8ce 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -3045,7 +3045,7 @@ static void recalc_bh_state(void) | |||
3045 | buffer_heads_over_limit = (tot > max_buffer_heads); | 3045 | buffer_heads_over_limit = (tot > max_buffer_heads); |
3046 | } | 3046 | } |
3047 | 3047 | ||
3048 | struct buffer_head *alloc_buffer_head(unsigned int __nocast gfp_flags) | 3048 | struct buffer_head *alloc_buffer_head(gfp_t gfp_flags) |
3049 | { | 3049 | { |
3050 | struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags); | 3050 | struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags); |
3051 | if (ret) { | 3051 | if (ret) { |
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 6454022b0536..657ab11c173b 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -23,6 +23,10 @@ int fuse_open_common(struct inode *inode, struct file *file, int isdir) | |||
23 | struct fuse_file *ff; | 23 | struct fuse_file *ff; |
24 | int err; | 24 | int err; |
25 | 25 | ||
26 | /* VFS checks this, but only _after_ ->open() */ | ||
27 | if (file->f_flags & O_DIRECT) | ||
28 | return -EINVAL; | ||
29 | |||
26 | err = generic_file_open(inode, file); | 30 | err = generic_file_open(inode, file); |
27 | if (err) | 31 | if (err) |
28 | return err; | 32 | return err; |
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 59c5062cd63f..dd7113106269 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -793,11 +793,6 @@ int hostfs_rename(struct inode *from_ino, struct dentry *from, | |||
793 | return(err); | 793 | return(err); |
794 | } | 794 | } |
795 | 795 | ||
796 | void hostfs_truncate(struct inode *ino) | ||
797 | { | ||
798 | not_implemented(); | ||
799 | } | ||
800 | |||
801 | int hostfs_permission(struct inode *ino, int desired, struct nameidata *nd) | 796 | int hostfs_permission(struct inode *ino, int desired, struct nameidata *nd) |
802 | { | 797 | { |
803 | char *name; | 798 | char *name; |
@@ -894,7 +889,6 @@ static struct inode_operations hostfs_iops = { | |||
894 | .rmdir = hostfs_rmdir, | 889 | .rmdir = hostfs_rmdir, |
895 | .mknod = hostfs_mknod, | 890 | .mknod = hostfs_mknod, |
896 | .rename = hostfs_rename, | 891 | .rename = hostfs_rename, |
897 | .truncate = hostfs_truncate, | ||
898 | .permission = hostfs_permission, | 892 | .permission = hostfs_permission, |
899 | .setattr = hostfs_setattr, | 893 | .setattr = hostfs_setattr, |
900 | .getattr = hostfs_getattr, | 894 | .getattr = hostfs_getattr, |
@@ -910,7 +904,6 @@ static struct inode_operations hostfs_dir_iops = { | |||
910 | .rmdir = hostfs_rmdir, | 904 | .rmdir = hostfs_rmdir, |
911 | .mknod = hostfs_mknod, | 905 | .mknod = hostfs_mknod, |
912 | .rename = hostfs_rename, | 906 | .rename = hostfs_rename, |
913 | .truncate = hostfs_truncate, | ||
914 | .permission = hostfs_permission, | 907 | .permission = hostfs_permission, |
915 | .setattr = hostfs_setattr, | 908 | .setattr = hostfs_setattr, |
916 | .getattr = hostfs_getattr, | 909 | .getattr = hostfs_getattr, |
diff --git a/fs/mpage.c b/fs/mpage.c index bb9aebe93862..c5adcdddf3cc 100644 --- a/fs/mpage.c +++ b/fs/mpage.c | |||
@@ -102,7 +102,7 @@ static struct bio *mpage_bio_submit(int rw, struct bio *bio) | |||
102 | static struct bio * | 102 | static struct bio * |
103 | mpage_alloc(struct block_device *bdev, | 103 | mpage_alloc(struct block_device *bdev, |
104 | sector_t first_sector, int nr_vecs, | 104 | sector_t first_sector, int nr_vecs, |
105 | unsigned int __nocast gfp_flags) | 105 | gfp_t gfp_flags) |
106 | { | 106 | { |
107 | struct bio *bio; | 107 | struct bio *bio; |
108 | 108 | ||
diff --git a/fs/namei.c b/fs/namei.c index 043d587216b5..aa62dbda93ac 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1551,19 +1551,19 @@ do_link: | |||
1551 | if (nd->last_type != LAST_NORM) | 1551 | if (nd->last_type != LAST_NORM) |
1552 | goto exit; | 1552 | goto exit; |
1553 | if (nd->last.name[nd->last.len]) { | 1553 | if (nd->last.name[nd->last.len]) { |
1554 | putname(nd->last.name); | 1554 | __putname(nd->last.name); |
1555 | goto exit; | 1555 | goto exit; |
1556 | } | 1556 | } |
1557 | error = -ELOOP; | 1557 | error = -ELOOP; |
1558 | if (count++==32) { | 1558 | if (count++==32) { |
1559 | putname(nd->last.name); | 1559 | __putname(nd->last.name); |
1560 | goto exit; | 1560 | goto exit; |
1561 | } | 1561 | } |
1562 | dir = nd->dentry; | 1562 | dir = nd->dentry; |
1563 | down(&dir->d_inode->i_sem); | 1563 | down(&dir->d_inode->i_sem); |
1564 | path.dentry = __lookup_hash(&nd->last, nd->dentry, nd); | 1564 | path.dentry = __lookup_hash(&nd->last, nd->dentry, nd); |
1565 | path.mnt = nd->mnt; | 1565 | path.mnt = nd->mnt; |
1566 | putname(nd->last.name); | 1566 | __putname(nd->last.name); |
1567 | goto do_last; | 1567 | goto do_last; |
1568 | } | 1568 | } |
1569 | 1569 | ||
diff --git a/fs/nfs_common/nfsacl.c b/fs/nfs_common/nfsacl.c index 251e5a1bb1c4..0c2be8c0307d 100644 --- a/fs/nfs_common/nfsacl.c +++ b/fs/nfs_common/nfsacl.c | |||
@@ -48,43 +48,26 @@ xdr_nfsace_encode(struct xdr_array2_desc *desc, void *elem) | |||
48 | (struct nfsacl_encode_desc *) desc; | 48 | (struct nfsacl_encode_desc *) desc; |
49 | u32 *p = (u32 *) elem; | 49 | u32 *p = (u32 *) elem; |
50 | 50 | ||
51 | if (nfsacl_desc->count < nfsacl_desc->acl->a_count) { | 51 | struct posix_acl_entry *entry = |
52 | struct posix_acl_entry *entry = | 52 | &nfsacl_desc->acl->a_entries[nfsacl_desc->count++]; |
53 | &nfsacl_desc->acl->a_entries[nfsacl_desc->count++]; | ||
54 | 53 | ||
55 | *p++ = htonl(entry->e_tag | nfsacl_desc->typeflag); | 54 | *p++ = htonl(entry->e_tag | nfsacl_desc->typeflag); |
56 | switch(entry->e_tag) { | 55 | switch(entry->e_tag) { |
57 | case ACL_USER_OBJ: | 56 | case ACL_USER_OBJ: |
58 | *p++ = htonl(nfsacl_desc->uid); | 57 | *p++ = htonl(nfsacl_desc->uid); |
59 | break; | 58 | break; |
60 | case ACL_GROUP_OBJ: | 59 | case ACL_GROUP_OBJ: |
61 | *p++ = htonl(nfsacl_desc->gid); | 60 | *p++ = htonl(nfsacl_desc->gid); |
62 | break; | 61 | break; |
63 | case ACL_USER: | 62 | case ACL_USER: |
64 | case ACL_GROUP: | 63 | case ACL_GROUP: |
65 | *p++ = htonl(entry->e_id); | 64 | *p++ = htonl(entry->e_id); |
66 | break; | 65 | break; |
67 | default: /* Solaris depends on that! */ | 66 | default: /* Solaris depends on that! */ |
68 | *p++ = 0; | 67 | *p++ = 0; |
69 | break; | 68 | break; |
70 | } | ||
71 | *p++ = htonl(entry->e_perm & S_IRWXO); | ||
72 | } else { | ||
73 | const struct posix_acl_entry *pa, *pe; | ||
74 | int group_obj_perm = ACL_READ|ACL_WRITE|ACL_EXECUTE; | ||
75 | |||
76 | FOREACH_ACL_ENTRY(pa, nfsacl_desc->acl, pe) { | ||
77 | if (pa->e_tag == ACL_GROUP_OBJ) { | ||
78 | group_obj_perm = pa->e_perm & S_IRWXO; | ||
79 | break; | ||
80 | } | ||
81 | } | ||
82 | /* fake up ACL_MASK entry */ | ||
83 | *p++ = htonl(ACL_MASK | nfsacl_desc->typeflag); | ||
84 | *p++ = htonl(0); | ||
85 | *p++ = htonl(group_obj_perm); | ||
86 | } | 69 | } |
87 | 70 | *p++ = htonl(entry->e_perm & S_IRWXO); | |
88 | return 0; | 71 | return 0; |
89 | } | 72 | } |
90 | 73 | ||
@@ -105,11 +88,28 @@ nfsacl_encode(struct xdr_buf *buf, unsigned int base, struct inode *inode, | |||
105 | .gid = inode->i_gid, | 88 | .gid = inode->i_gid, |
106 | }; | 89 | }; |
107 | int err; | 90 | int err; |
91 | struct posix_acl *acl2 = NULL; | ||
108 | 92 | ||
109 | if (entries > NFS_ACL_MAX_ENTRIES || | 93 | if (entries > NFS_ACL_MAX_ENTRIES || |
110 | xdr_encode_word(buf, base, entries)) | 94 | xdr_encode_word(buf, base, entries)) |
111 | return -EINVAL; | 95 | return -EINVAL; |
96 | if (encode_entries && acl && acl->a_count == 3) { | ||
97 | /* Fake up an ACL_MASK entry. */ | ||
98 | acl2 = posix_acl_alloc(4, GFP_KERNEL); | ||
99 | if (!acl2) | ||
100 | return -ENOMEM; | ||
101 | /* Insert entries in canonical order: other orders seem | ||
102 | to confuse Solaris VxFS. */ | ||
103 | acl2->a_entries[0] = acl->a_entries[0]; /* ACL_USER_OBJ */ | ||
104 | acl2->a_entries[1] = acl->a_entries[1]; /* ACL_GROUP_OBJ */ | ||
105 | acl2->a_entries[2] = acl->a_entries[1]; /* ACL_MASK */ | ||
106 | acl2->a_entries[2].e_tag = ACL_MASK; | ||
107 | acl2->a_entries[3] = acl->a_entries[2]; /* ACL_OTHER */ | ||
108 | nfsacl_desc.acl = acl2; | ||
109 | } | ||
112 | err = xdr_encode_array2(buf, base + 4, &nfsacl_desc.desc); | 110 | err = xdr_encode_array2(buf, base + 4, &nfsacl_desc.desc); |
111 | if (acl2) | ||
112 | posix_acl_release(acl2); | ||
113 | if (!err) | 113 | if (!err) |
114 | err = 8 + nfsacl_desc.desc.elem_size * | 114 | err = 8 + nfsacl_desc.desc.elem_size * |
115 | nfsacl_desc.desc.array_len; | 115 | nfsacl_desc.desc.array_len; |
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog index 83f3322765cd..de58579a1d0e 100644 --- a/fs/ntfs/ChangeLog +++ b/fs/ntfs/ChangeLog | |||
@@ -102,6 +102,9 @@ ToDo/Notes: | |||
102 | inode instead of a vfs inode as parameter. | 102 | inode instead of a vfs inode as parameter. |
103 | - Fix the definition of the CHKD ntfs record magic. It had an off by | 103 | - Fix the definition of the CHKD ntfs record magic. It had an off by |
104 | two error causing it to be CHKB instead of CHKD. | 104 | two error causing it to be CHKB instead of CHKD. |
105 | - Fix a stupid bug in __ntfs_bitmap_set_bits_in_run() which caused the | ||
106 | count to become negative and hence we had a wild memset() scribbling | ||
107 | all over the system's ram. | ||
105 | 108 | ||
106 | 2.1.23 - Implement extension of resident files and make writing safe as well as | 109 | 2.1.23 - Implement extension of resident files and make writing safe as well as |
107 | many bug fixes, cleanups, and enhancements... | 110 | many bug fixes, cleanups, and enhancements... |
diff --git a/fs/ntfs/bitmap.c b/fs/ntfs/bitmap.c index 12cf2e30c7dd..7a190cdc60e2 100644 --- a/fs/ntfs/bitmap.c +++ b/fs/ntfs/bitmap.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * bitmap.c - NTFS kernel bitmap handling. Part of the Linux-NTFS project. | 2 | * bitmap.c - NTFS kernel bitmap handling. Part of the Linux-NTFS project. |
3 | * | 3 | * |
4 | * Copyright (c) 2004 Anton Altaparmakov | 4 | * Copyright (c) 2004-2005 Anton Altaparmakov |
5 | * | 5 | * |
6 | * This program/include file is free software; you can redistribute it and/or | 6 | * This program/include file is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU General Public License as published | 7 | * modify it under the terms of the GNU General Public License as published |
@@ -90,7 +90,8 @@ int __ntfs_bitmap_set_bits_in_run(struct inode *vi, const s64 start_bit, | |||
90 | /* If the first byte is partial, modify the appropriate bits in it. */ | 90 | /* If the first byte is partial, modify the appropriate bits in it. */ |
91 | if (bit) { | 91 | if (bit) { |
92 | u8 *byte = kaddr + pos; | 92 | u8 *byte = kaddr + pos; |
93 | while ((bit & 7) && cnt--) { | 93 | while ((bit & 7) && cnt) { |
94 | cnt--; | ||
94 | if (value) | 95 | if (value) |
95 | *byte |= 1 << bit++; | 96 | *byte |= 1 << bit++; |
96 | else | 97 | else |
diff --git a/fs/ntfs/layout.h b/fs/ntfs/layout.h index 01f2dfa39cec..5c248d404f05 100644 --- a/fs/ntfs/layout.h +++ b/fs/ntfs/layout.h | |||
@@ -309,7 +309,7 @@ typedef le16 MFT_RECORD_FLAGS; | |||
309 | * Note: The _LE versions will return a CPU endian formatted value! | 309 | * Note: The _LE versions will return a CPU endian formatted value! |
310 | */ | 310 | */ |
311 | #define MFT_REF_MASK_CPU 0x0000ffffffffffffULL | 311 | #define MFT_REF_MASK_CPU 0x0000ffffffffffffULL |
312 | #define MFT_REF_MASK_LE const_cpu_to_le64(0x0000ffffffffffffULL) | 312 | #define MFT_REF_MASK_LE const_cpu_to_le64(MFT_REF_MASK_CPU) |
313 | 313 | ||
314 | typedef u64 MFT_REF; | 314 | typedef u64 MFT_REF; |
315 | typedef le64 leMFT_REF; | 315 | typedef le64 leMFT_REF; |
diff --git a/fs/ntfs/malloc.h b/fs/ntfs/malloc.h index 006946efca8c..590887b943f5 100644 --- a/fs/ntfs/malloc.h +++ b/fs/ntfs/malloc.h | |||
@@ -40,7 +40,7 @@ | |||
40 | * Depending on @gfp_mask the allocation may be guaranteed to succeed. | 40 | * Depending on @gfp_mask the allocation may be guaranteed to succeed. |
41 | */ | 41 | */ |
42 | static inline void *__ntfs_malloc(unsigned long size, | 42 | static inline void *__ntfs_malloc(unsigned long size, |
43 | unsigned int __nocast gfp_mask) | 43 | gfp_t gfp_mask) |
44 | { | 44 | { |
45 | if (likely(size <= PAGE_SIZE)) { | 45 | if (likely(size <= PAGE_SIZE)) { |
46 | BUG_ON(!size); | 46 | BUG_ON(!size); |
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index 247586d1d5dc..b011369b5956 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c | |||
@@ -58,7 +58,8 @@ static inline MFT_RECORD *map_mft_record_page(ntfs_inode *ni) | |||
58 | * overflowing the unsigned long, but I don't think we would ever get | 58 | * overflowing the unsigned long, but I don't think we would ever get |
59 | * here if the volume was that big... | 59 | * here if the volume was that big... |
60 | */ | 60 | */ |
61 | index = ni->mft_no << vol->mft_record_size_bits >> PAGE_CACHE_SHIFT; | 61 | index = (u64)ni->mft_no << vol->mft_record_size_bits >> |
62 | PAGE_CACHE_SHIFT; | ||
62 | ofs = (ni->mft_no << vol->mft_record_size_bits) & ~PAGE_CACHE_MASK; | 63 | ofs = (ni->mft_no << vol->mft_record_size_bits) & ~PAGE_CACHE_MASK; |
63 | 64 | ||
64 | i_size = i_size_read(mft_vi); | 65 | i_size = i_size_read(mft_vi); |
diff --git a/fs/ntfs/unistr.c b/fs/ntfs/unistr.c index a389a5a16c84..0ea887fc859c 100644 --- a/fs/ntfs/unistr.c +++ b/fs/ntfs/unistr.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * unistr.c - NTFS Unicode string handling. Part of the Linux-NTFS project. | 2 | * unistr.c - NTFS Unicode string handling. Part of the Linux-NTFS project. |
3 | * | 3 | * |
4 | * Copyright (c) 2001-2004 Anton Altaparmakov | 4 | * Copyright (c) 2001-2005 Anton Altaparmakov |
5 | * | 5 | * |
6 | * This program/include file is free software; you can redistribute it and/or | 6 | * This program/include file is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU General Public License as published | 7 | * modify it under the terms of the GNU General Public License as published |
diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 296480e96dd5..6c8dcf7613fd 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c | |||
@@ -35,7 +35,7 @@ EXPORT_SYMBOL(posix_acl_permission); | |||
35 | * Allocate a new ACL with the specified number of entries. | 35 | * Allocate a new ACL with the specified number of entries. |
36 | */ | 36 | */ |
37 | struct posix_acl * | 37 | struct posix_acl * |
38 | posix_acl_alloc(int count, unsigned int __nocast flags) | 38 | posix_acl_alloc(int count, gfp_t flags) |
39 | { | 39 | { |
40 | const size_t size = sizeof(struct posix_acl) + | 40 | const size_t size = sizeof(struct posix_acl) + |
41 | count * sizeof(struct posix_acl_entry); | 41 | count * sizeof(struct posix_acl_entry); |
@@ -51,7 +51,7 @@ posix_acl_alloc(int count, unsigned int __nocast flags) | |||
51 | * Clone an ACL. | 51 | * Clone an ACL. |
52 | */ | 52 | */ |
53 | struct posix_acl * | 53 | struct posix_acl * |
54 | posix_acl_clone(const struct posix_acl *acl, unsigned int __nocast flags) | 54 | posix_acl_clone(const struct posix_acl *acl, gfp_t flags) |
55 | { | 55 | { |
56 | struct posix_acl *clone = NULL; | 56 | struct posix_acl *clone = NULL; |
57 | 57 | ||
@@ -185,7 +185,7 @@ posix_acl_equiv_mode(const struct posix_acl *acl, mode_t *mode_p) | |||
185 | * Create an ACL representing the file mode permission bits of an inode. | 185 | * Create an ACL representing the file mode permission bits of an inode. |
186 | */ | 186 | */ |
187 | struct posix_acl * | 187 | struct posix_acl * |
188 | posix_acl_from_mode(mode_t mode, unsigned int __nocast flags) | 188 | posix_acl_from_mode(mode_t mode, gfp_t flags) |
189 | { | 189 | { |
190 | struct posix_acl *acl = posix_acl_alloc(3, flags); | 190 | struct posix_acl *acl = posix_acl_alloc(3, flags); |
191 | if (!acl) | 191 | if (!acl) |
diff --git a/fs/read_write.c b/fs/read_write.c index b60324aaa2b6..a091ee4f430d 100644 --- a/fs/read_write.c +++ b/fs/read_write.c | |||
@@ -499,6 +499,9 @@ static ssize_t do_readv_writev(int type, struct file *file, | |||
499 | ret = rw_verify_area(type, file, pos, tot_len); | 499 | ret = rw_verify_area(type, file, pos, tot_len); |
500 | if (ret) | 500 | if (ret) |
501 | goto out; | 501 | goto out; |
502 | ret = security_file_permission(file, type == READ ? MAY_READ : MAY_WRITE); | ||
503 | if (ret) | ||
504 | goto out; | ||
502 | 505 | ||
503 | fnv = NULL; | 506 | fnv = NULL; |
504 | if (type == READ) { | 507 | if (type == READ) { |
diff --git a/fs/relayfs/buffers.c b/fs/relayfs/buffers.c index 2aa8e2719999..84e21ffa5ca8 100644 --- a/fs/relayfs/buffers.c +++ b/fs/relayfs/buffers.c | |||
@@ -109,7 +109,7 @@ static void *relay_alloc_buf(struct rchan_buf *buf, unsigned long size) | |||
109 | if (unlikely(!buf->page_array[i])) | 109 | if (unlikely(!buf->page_array[i])) |
110 | goto depopulate; | 110 | goto depopulate; |
111 | } | 111 | } |
112 | mem = vmap(buf->page_array, n_pages, GFP_KERNEL, PAGE_KERNEL); | 112 | mem = vmap(buf->page_array, n_pages, VM_MAP, PAGE_KERNEL); |
113 | if (!mem) | 113 | if (!mem) |
114 | goto depopulate; | 114 | goto depopulate; |
115 | 115 | ||
diff --git a/fs/xfs/linux-2.6/kmem.c b/fs/xfs/linux-2.6/kmem.c index 4b184559f231..d2653b589b1c 100644 --- a/fs/xfs/linux-2.6/kmem.c +++ b/fs/xfs/linux-2.6/kmem.c | |||
@@ -45,7 +45,7 @@ | |||
45 | 45 | ||
46 | 46 | ||
47 | void * | 47 | void * |
48 | kmem_alloc(size_t size, unsigned int __nocast flags) | 48 | kmem_alloc(size_t size, gfp_t flags) |
49 | { | 49 | { |
50 | int retries = 0; | 50 | int retries = 0; |
51 | unsigned int lflags = kmem_flags_convert(flags); | 51 | unsigned int lflags = kmem_flags_convert(flags); |
@@ -67,7 +67,7 @@ kmem_alloc(size_t size, unsigned int __nocast flags) | |||
67 | } | 67 | } |
68 | 68 | ||
69 | void * | 69 | void * |
70 | kmem_zalloc(size_t size, unsigned int __nocast flags) | 70 | kmem_zalloc(size_t size, gfp_t flags) |
71 | { | 71 | { |
72 | void *ptr; | 72 | void *ptr; |
73 | 73 | ||
@@ -90,7 +90,7 @@ kmem_free(void *ptr, size_t size) | |||
90 | 90 | ||
91 | void * | 91 | void * |
92 | kmem_realloc(void *ptr, size_t newsize, size_t oldsize, | 92 | kmem_realloc(void *ptr, size_t newsize, size_t oldsize, |
93 | unsigned int __nocast flags) | 93 | gfp_t flags) |
94 | { | 94 | { |
95 | void *new; | 95 | void *new; |
96 | 96 | ||
@@ -105,7 +105,7 @@ kmem_realloc(void *ptr, size_t newsize, size_t oldsize, | |||
105 | } | 105 | } |
106 | 106 | ||
107 | void * | 107 | void * |
108 | kmem_zone_alloc(kmem_zone_t *zone, unsigned int __nocast flags) | 108 | kmem_zone_alloc(kmem_zone_t *zone, gfp_t flags) |
109 | { | 109 | { |
110 | int retries = 0; | 110 | int retries = 0; |
111 | unsigned int lflags = kmem_flags_convert(flags); | 111 | unsigned int lflags = kmem_flags_convert(flags); |
@@ -124,7 +124,7 @@ kmem_zone_alloc(kmem_zone_t *zone, unsigned int __nocast flags) | |||
124 | } | 124 | } |
125 | 125 | ||
126 | void * | 126 | void * |
127 | kmem_zone_zalloc(kmem_zone_t *zone, unsigned int __nocast flags) | 127 | kmem_zone_zalloc(kmem_zone_t *zone, gfp_t flags) |
128 | { | 128 | { |
129 | void *ptr; | 129 | void *ptr; |
130 | 130 | ||
diff --git a/fs/xfs/linux-2.6/kmem.h b/fs/xfs/linux-2.6/kmem.h index 109fcf27e256..ee7010f085bc 100644 --- a/fs/xfs/linux-2.6/kmem.h +++ b/fs/xfs/linux-2.6/kmem.h | |||
@@ -81,7 +81,7 @@ typedef unsigned long xfs_pflags_t; | |||
81 | *(NSTATEP) = *(OSTATEP); \ | 81 | *(NSTATEP) = *(OSTATEP); \ |
82 | } while (0) | 82 | } while (0) |
83 | 83 | ||
84 | static __inline unsigned int kmem_flags_convert(unsigned int __nocast flags) | 84 | static __inline unsigned int kmem_flags_convert(gfp_t flags) |
85 | { | 85 | { |
86 | unsigned int lflags = __GFP_NOWARN; /* we'll report problems, if need be */ | 86 | unsigned int lflags = __GFP_NOWARN; /* we'll report problems, if need be */ |
87 | 87 | ||
@@ -125,13 +125,12 @@ kmem_zone_destroy(kmem_zone_t *zone) | |||
125 | BUG(); | 125 | BUG(); |
126 | } | 126 | } |
127 | 127 | ||
128 | extern void *kmem_zone_zalloc(kmem_zone_t *, unsigned int __nocast); | 128 | extern void *kmem_zone_zalloc(kmem_zone_t *, gfp_t); |
129 | extern void *kmem_zone_alloc(kmem_zone_t *, unsigned int __nocast); | 129 | extern void *kmem_zone_alloc(kmem_zone_t *, gfp_t); |
130 | 130 | ||
131 | extern void *kmem_alloc(size_t, unsigned int __nocast); | 131 | extern void *kmem_alloc(size_t, gfp_t); |
132 | extern void *kmem_realloc(void *, size_t, size_t, | 132 | extern void *kmem_realloc(void *, size_t, size_t, gfp_t); |
133 | unsigned int __nocast); | 133 | extern void *kmem_zalloc(size_t, gfp_t); |
134 | extern void *kmem_zalloc(size_t, unsigned int __nocast); | ||
135 | extern void kmem_free(void *, size_t); | 134 | extern void kmem_free(void *, size_t); |
136 | 135 | ||
137 | typedef struct shrinker *kmem_shaker_t; | 136 | typedef struct shrinker *kmem_shaker_t; |