diff options
author | Steve French <sfrench@us.ibm.com> | 2005-11-13 23:28:58 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2005-11-13 23:28:58 -0500 |
commit | 7b0a65f9923ffe7885a5473648baaa3a1a701726 (patch) | |
tree | b9be4a0504b4e637b86bdc92d88268ff57ea1bc5 /fs | |
parent | 1b98a8221e3c9c86ae7e292ba7542d2dd6f10eb9 (diff) | |
parent | ee90f62b3e69d0cd9f8edc6b95f07b1a8c38aaf4 (diff) |
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'fs')
-rw-r--r-- | fs/aio.c | 44 | ||||
-rw-r--r-- | fs/ext2/super.c | 2 | ||||
-rw-r--r-- | fs/ext3/inode.c | 4 | ||||
-rw-r--r-- | fs/jffs2/scan.c | 3 | ||||
-rw-r--r-- | fs/locks.c | 3 | ||||
-rw-r--r-- | fs/proc/task_mmu.c | 2 |
6 files changed, 27 insertions, 31 deletions
@@ -457,6 +457,8 @@ static inline struct kiocb *aio_get_req(struct kioctx *ctx) | |||
457 | 457 | ||
458 | static inline void really_put_req(struct kioctx *ctx, struct kiocb *req) | 458 | static inline void really_put_req(struct kioctx *ctx, struct kiocb *req) |
459 | { | 459 | { |
460 | assert_spin_locked(&ctx->ctx_lock); | ||
461 | |||
460 | if (req->ki_dtor) | 462 | if (req->ki_dtor) |
461 | req->ki_dtor(req); | 463 | req->ki_dtor(req); |
462 | kmem_cache_free(kiocb_cachep, req); | 464 | kmem_cache_free(kiocb_cachep, req); |
@@ -498,6 +500,8 @@ static int __aio_put_req(struct kioctx *ctx, struct kiocb *req) | |||
498 | dprintk(KERN_DEBUG "aio_put(%p): f_count=%d\n", | 500 | dprintk(KERN_DEBUG "aio_put(%p): f_count=%d\n", |
499 | req, atomic_read(&req->ki_filp->f_count)); | 501 | req, atomic_read(&req->ki_filp->f_count)); |
500 | 502 | ||
503 | assert_spin_locked(&ctx->ctx_lock); | ||
504 | |||
501 | req->ki_users --; | 505 | req->ki_users --; |
502 | if (unlikely(req->ki_users < 0)) | 506 | if (unlikely(req->ki_users < 0)) |
503 | BUG(); | 507 | BUG(); |
@@ -619,14 +623,13 @@ static void unuse_mm(struct mm_struct *mm) | |||
619 | * the kiocb (to tell the caller to activate the work | 623 | * the kiocb (to tell the caller to activate the work |
620 | * queue to process it), or 0, if it found that it was | 624 | * queue to process it), or 0, if it found that it was |
621 | * already queued. | 625 | * already queued. |
622 | * | ||
623 | * Should be called with the spin lock iocb->ki_ctx->ctx_lock | ||
624 | * held | ||
625 | */ | 626 | */ |
626 | static inline int __queue_kicked_iocb(struct kiocb *iocb) | 627 | static inline int __queue_kicked_iocb(struct kiocb *iocb) |
627 | { | 628 | { |
628 | struct kioctx *ctx = iocb->ki_ctx; | 629 | struct kioctx *ctx = iocb->ki_ctx; |
629 | 630 | ||
631 | assert_spin_locked(&ctx->ctx_lock); | ||
632 | |||
630 | if (list_empty(&iocb->ki_run_list)) { | 633 | if (list_empty(&iocb->ki_run_list)) { |
631 | list_add_tail(&iocb->ki_run_list, | 634 | list_add_tail(&iocb->ki_run_list, |
632 | &ctx->run_list); | 635 | &ctx->run_list); |
@@ -771,13 +774,15 @@ out: | |||
771 | * Process all pending retries queued on the ioctx | 774 | * Process all pending retries queued on the ioctx |
772 | * run list. | 775 | * run list. |
773 | * Assumes it is operating within the aio issuer's mm | 776 | * Assumes it is operating within the aio issuer's mm |
774 | * context. Expects to be called with ctx->ctx_lock held | 777 | * context. |
775 | */ | 778 | */ |
776 | static int __aio_run_iocbs(struct kioctx *ctx) | 779 | static int __aio_run_iocbs(struct kioctx *ctx) |
777 | { | 780 | { |
778 | struct kiocb *iocb; | 781 | struct kiocb *iocb; |
779 | LIST_HEAD(run_list); | 782 | LIST_HEAD(run_list); |
780 | 783 | ||
784 | assert_spin_locked(&ctx->ctx_lock); | ||
785 | |||
781 | list_splice_init(&ctx->run_list, &run_list); | 786 | list_splice_init(&ctx->run_list, &run_list); |
782 | while (!list_empty(&run_list)) { | 787 | while (!list_empty(&run_list)) { |
783 | iocb = list_entry(run_list.next, struct kiocb, | 788 | iocb = list_entry(run_list.next, struct kiocb, |
@@ -937,28 +942,19 @@ int fastcall aio_complete(struct kiocb *iocb, long res, long res2) | |||
937 | unsigned long tail; | 942 | unsigned long tail; |
938 | int ret; | 943 | int ret; |
939 | 944 | ||
940 | /* Special case handling for sync iocbs: events go directly | 945 | /* |
941 | * into the iocb for fast handling. Note that this will not | 946 | * Special case handling for sync iocbs: |
942 | * work if we allow sync kiocbs to be cancelled. in which | 947 | * - events go directly into the iocb for fast handling |
943 | * case the usage count checks will have to move under ctx_lock | 948 | * - the sync task with the iocb in its stack holds the single iocb |
944 | * for all cases. | 949 | * ref, no other paths have a way to get another ref |
950 | * - the sync task helpfully left a reference to itself in the iocb | ||
945 | */ | 951 | */ |
946 | if (is_sync_kiocb(iocb)) { | 952 | if (is_sync_kiocb(iocb)) { |
947 | int ret; | 953 | BUG_ON(iocb->ki_users != 1); |
948 | |||
949 | iocb->ki_user_data = res; | 954 | iocb->ki_user_data = res; |
950 | if (iocb->ki_users == 1) { | 955 | iocb->ki_users = 0; |
951 | iocb->ki_users = 0; | ||
952 | ret = 1; | ||
953 | } else { | ||
954 | spin_lock_irq(&ctx->ctx_lock); | ||
955 | iocb->ki_users--; | ||
956 | ret = (0 == iocb->ki_users); | ||
957 | spin_unlock_irq(&ctx->ctx_lock); | ||
958 | } | ||
959 | /* sync iocbs put the task here for us */ | ||
960 | wake_up_process(iocb->ki_obj.tsk); | 956 | wake_up_process(iocb->ki_obj.tsk); |
961 | return ret; | 957 | return 1; |
962 | } | 958 | } |
963 | 959 | ||
964 | info = &ctx->ring_info; | 960 | info = &ctx->ring_info; |
@@ -1613,12 +1609,14 @@ asmlinkage long sys_io_submit(aio_context_t ctx_id, long nr, | |||
1613 | 1609 | ||
1614 | /* lookup_kiocb | 1610 | /* lookup_kiocb |
1615 | * Finds a given iocb for cancellation. | 1611 | * Finds a given iocb for cancellation. |
1616 | * MUST be called with ctx->ctx_lock held. | ||
1617 | */ | 1612 | */ |
1618 | static struct kiocb *lookup_kiocb(struct kioctx *ctx, struct iocb __user *iocb, | 1613 | static struct kiocb *lookup_kiocb(struct kioctx *ctx, struct iocb __user *iocb, |
1619 | u32 key) | 1614 | u32 key) |
1620 | { | 1615 | { |
1621 | struct list_head *pos; | 1616 | struct list_head *pos; |
1617 | |||
1618 | assert_spin_locked(&ctx->ctx_lock); | ||
1619 | |||
1622 | /* TODO: use a hash or array, this sucks. */ | 1620 | /* TODO: use a hash or array, this sucks. */ |
1623 | list_for_each(pos, &ctx->active_reqs) { | 1621 | list_for_each(pos, &ctx->active_reqs) { |
1624 | struct kiocb *kiocb = list_kiocb(pos); | 1622 | struct kiocb *kiocb = list_kiocb(pos); |
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index e4ed4b31a433..522fa70dd8ea 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
@@ -881,7 +881,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) | |||
881 | } | 881 | } |
882 | if (EXT2_HAS_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_HAS_JOURNAL)) | 882 | if (EXT2_HAS_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_HAS_JOURNAL)) |
883 | ext2_warning(sb, __FUNCTION__, | 883 | ext2_warning(sb, __FUNCTION__, |
884 | "mounting ext3 filesystem as ext2\n"); | 884 | "mounting ext3 filesystem as ext2"); |
885 | ext2_setup_super (sb, es, sb->s_flags & MS_RDONLY); | 885 | ext2_setup_super (sb, es, sb->s_flags & MS_RDONLY); |
886 | percpu_counter_mod(&sbi->s_freeblocks_counter, | 886 | percpu_counter_mod(&sbi->s_freeblocks_counter, |
887 | ext2_count_free_blocks(sb)); | 887 | ext2_count_free_blocks(sb)); |
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 5d9b00e28837..8824e84f8a56 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -1384,8 +1384,10 @@ static int ext3_journalled_writepage(struct page *page, | |||
1384 | ClearPageChecked(page); | 1384 | ClearPageChecked(page); |
1385 | ret = block_prepare_write(page, 0, PAGE_CACHE_SIZE, | 1385 | ret = block_prepare_write(page, 0, PAGE_CACHE_SIZE, |
1386 | ext3_get_block); | 1386 | ext3_get_block); |
1387 | if (ret != 0) | 1387 | if (ret != 0) { |
1388 | ext3_journal_stop(handle); | ||
1388 | goto out_unlock; | 1389 | goto out_unlock; |
1390 | } | ||
1389 | ret = walk_page_buffers(handle, page_buffers(page), 0, | 1391 | ret = walk_page_buffers(handle, page_buffers(page), 0, |
1390 | PAGE_CACHE_SIZE, NULL, do_journal_get_write_access); | 1392 | PAGE_CACHE_SIZE, NULL, do_journal_get_write_access); |
1391 | 1393 | ||
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c index 0e7456ec99fd..3e51dd1da8aa 100644 --- a/fs/jffs2/scan.c +++ b/fs/jffs2/scan.c | |||
@@ -284,9 +284,6 @@ int jffs2_fill_scan_buf (struct jffs2_sb_info *c, void *buf, | |||
284 | D1(printk(KERN_WARNING "Read at 0x%x gave only 0x%zx bytes\n", ofs, retlen)); | 284 | D1(printk(KERN_WARNING "Read at 0x%x gave only 0x%zx bytes\n", ofs, retlen)); |
285 | return -EIO; | 285 | return -EIO; |
286 | } | 286 | } |
287 | D2(printk(KERN_DEBUG "Read 0x%x bytes from 0x%08x into buf\n", len, ofs)); | ||
288 | D2(printk(KERN_DEBUG "000: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", | ||
289 | buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7], buf[8], buf[9], buf[10], buf[11], buf[12], buf[13], buf[14], buf[15])); | ||
290 | return 0; | 287 | return 0; |
291 | } | 288 | } |
292 | 289 | ||
diff --git a/fs/locks.c b/fs/locks.c index a1e8b2248014..250ef53d25ef 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -1105,7 +1105,6 @@ static void time_out_leases(struct inode *inode) | |||
1105 | before = &fl->fl_next; | 1105 | before = &fl->fl_next; |
1106 | continue; | 1106 | continue; |
1107 | } | 1107 | } |
1108 | printk(KERN_INFO "lease broken - owner pid = %d\n", fl->fl_pid); | ||
1109 | lease_modify(before, fl->fl_type & ~F_INPROGRESS); | 1108 | lease_modify(before, fl->fl_type & ~F_INPROGRESS); |
1110 | if (fl == *before) /* lease_modify may have freed fl */ | 1109 | if (fl == *before) /* lease_modify may have freed fl */ |
1111 | before = &fl->fl_next; | 1110 | before = &fl->fl_next; |
@@ -1430,7 +1429,7 @@ int fcntl_setlease(unsigned int fd, struct file *filp, long arg) | |||
1430 | lock_kernel(); | 1429 | lock_kernel(); |
1431 | 1430 | ||
1432 | error = __setlease(filp, arg, &flp); | 1431 | error = __setlease(filp, arg, &flp); |
1433 | if (error) | 1432 | if (error || arg == F_UNLCK) |
1434 | goto out_unlock; | 1433 | goto out_unlock; |
1435 | 1434 | ||
1436 | error = fasync_helper(fd, filp, 1, &flp->fl_fasync); | 1435 | error = fasync_helper(fd, filp, 1, &flp->fl_fasync); |
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index d2fa42006d8f..9ab97cef0daa 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -195,7 +195,7 @@ static int show_map_internal(struct seq_file *m, void *v, struct mem_size_stats | |||
195 | 195 | ||
196 | static int show_map(struct seq_file *m, void *v) | 196 | static int show_map(struct seq_file *m, void *v) |
197 | { | 197 | { |
198 | return show_map_internal(m, v, 0); | 198 | return show_map_internal(m, v, NULL); |
199 | } | 199 | } |
200 | 200 | ||
201 | static void smaps_pte_range(struct vm_area_struct *vma, pmd_t *pmd, | 201 | static void smaps_pte_range(struct vm_area_struct *vma, pmd_t *pmd, |