diff options
author | Anton Altaparmakov <aia21@cantab.net> | 2005-10-19 07:13:58 -0400 |
---|---|---|
committer | Anton Altaparmakov <aia21@cantab.net> | 2005-10-19 07:13:58 -0400 |
commit | e087a412b45543a87497f0a213dbd5d55099f267 (patch) | |
tree | 8892cc84dbee2b4387c9f2604a7892b6ef3aab25 /fs | |
parent | 7946ada30bc45546cefc85809ba0fd07879eff52 (diff) | |
parent | bb7e257ef8d8ba43cab356aa1cc1b20d0106d45f (diff) |
Merge branch 'master' of /usr/src/ntfs-2.6/
Diffstat (limited to 'fs')
-rw-r--r-- | fs/aio.c | 26 | ||||
-rw-r--r-- | fs/nfs/delegation.c | 4 | ||||
-rw-r--r-- | fs/nfs/file.c | 3 | ||||
-rw-r--r-- | fs/nfs/inode.c | 9 | ||||
-rw-r--r-- | fs/proc/nommu.c | 1 |
5 files changed, 10 insertions, 33 deletions
@@ -398,7 +398,7 @@ static struct kiocb fastcall *__aio_get_req(struct kioctx *ctx) | |||
398 | if (unlikely(!req)) | 398 | if (unlikely(!req)) |
399 | return NULL; | 399 | return NULL; |
400 | 400 | ||
401 | req->ki_flags = 1 << KIF_LOCKED; | 401 | req->ki_flags = 0; |
402 | req->ki_users = 2; | 402 | req->ki_users = 2; |
403 | req->ki_key = 0; | 403 | req->ki_key = 0; |
404 | req->ki_ctx = ctx; | 404 | req->ki_ctx = ctx; |
@@ -547,25 +547,6 @@ struct kioctx *lookup_ioctx(unsigned long ctx_id) | |||
547 | return ioctx; | 547 | return ioctx; |
548 | } | 548 | } |
549 | 549 | ||
550 | static int lock_kiocb_action(void *param) | ||
551 | { | ||
552 | schedule(); | ||
553 | return 0; | ||
554 | } | ||
555 | |||
556 | static inline void lock_kiocb(struct kiocb *iocb) | ||
557 | { | ||
558 | wait_on_bit_lock(&iocb->ki_flags, KIF_LOCKED, lock_kiocb_action, | ||
559 | TASK_UNINTERRUPTIBLE); | ||
560 | } | ||
561 | |||
562 | static inline void unlock_kiocb(struct kiocb *iocb) | ||
563 | { | ||
564 | kiocbClearLocked(iocb); | ||
565 | smp_mb__after_clear_bit(); | ||
566 | wake_up_bit(&iocb->ki_flags, KIF_LOCKED); | ||
567 | } | ||
568 | |||
569 | /* | 550 | /* |
570 | * use_mm | 551 | * use_mm |
571 | * Makes the calling kernel thread take on the specified | 552 | * Makes the calling kernel thread take on the specified |
@@ -796,9 +777,7 @@ static int __aio_run_iocbs(struct kioctx *ctx) | |||
796 | * Hold an extra reference while retrying i/o. | 777 | * Hold an extra reference while retrying i/o. |
797 | */ | 778 | */ |
798 | iocb->ki_users++; /* grab extra reference */ | 779 | iocb->ki_users++; /* grab extra reference */ |
799 | lock_kiocb(iocb); | ||
800 | aio_run_iocb(iocb); | 780 | aio_run_iocb(iocb); |
801 | unlock_kiocb(iocb); | ||
802 | if (__aio_put_req(ctx, iocb)) /* drop extra ref */ | 781 | if (__aio_put_req(ctx, iocb)) /* drop extra ref */ |
803 | put_ioctx(ctx); | 782 | put_ioctx(ctx); |
804 | } | 783 | } |
@@ -1542,7 +1521,6 @@ int fastcall io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, | |||
1542 | 1521 | ||
1543 | spin_lock_irq(&ctx->ctx_lock); | 1522 | spin_lock_irq(&ctx->ctx_lock); |
1544 | aio_run_iocb(req); | 1523 | aio_run_iocb(req); |
1545 | unlock_kiocb(req); | ||
1546 | if (!list_empty(&ctx->run_list)) { | 1524 | if (!list_empty(&ctx->run_list)) { |
1547 | /* drain the run list */ | 1525 | /* drain the run list */ |
1548 | while (__aio_run_iocbs(ctx)) | 1526 | while (__aio_run_iocbs(ctx)) |
@@ -1674,7 +1652,6 @@ asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, | |||
1674 | if (NULL != cancel) { | 1652 | if (NULL != cancel) { |
1675 | struct io_event tmp; | 1653 | struct io_event tmp; |
1676 | pr_debug("calling cancel\n"); | 1654 | pr_debug("calling cancel\n"); |
1677 | lock_kiocb(kiocb); | ||
1678 | memset(&tmp, 0, sizeof(tmp)); | 1655 | memset(&tmp, 0, sizeof(tmp)); |
1679 | tmp.obj = (u64)(unsigned long)kiocb->ki_obj.user; | 1656 | tmp.obj = (u64)(unsigned long)kiocb->ki_obj.user; |
1680 | tmp.data = kiocb->ki_user_data; | 1657 | tmp.data = kiocb->ki_user_data; |
@@ -1686,7 +1663,6 @@ asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, | |||
1686 | if (copy_to_user(result, &tmp, sizeof(tmp))) | 1663 | if (copy_to_user(result, &tmp, sizeof(tmp))) |
1687 | ret = -EFAULT; | 1664 | ret = -EFAULT; |
1688 | } | 1665 | } |
1689 | unlock_kiocb(kiocb); | ||
1690 | } else | 1666 | } else |
1691 | ret = -EINVAL; | 1667 | ret = -EINVAL; |
1692 | 1668 | ||
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index d7f7eb669d03..4a36839f0bbd 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c | |||
@@ -85,6 +85,10 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct | |||
85 | struct nfs_delegation *delegation; | 85 | struct nfs_delegation *delegation; |
86 | int status = 0; | 86 | int status = 0; |
87 | 87 | ||
88 | /* Ensure we first revalidate the attributes and page cache! */ | ||
89 | if ((nfsi->cache_validity & (NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_ATTR))) | ||
90 | __nfs_revalidate_inode(NFS_SERVER(inode), inode); | ||
91 | |||
88 | delegation = nfs_alloc_delegation(); | 92 | delegation = nfs_alloc_delegation(); |
89 | if (delegation == NULL) | 93 | if (delegation == NULL) |
90 | return -ENOMEM; | 94 | return -ENOMEM; |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index f6b9eda925c5..6bdcfa95de94 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -137,7 +137,8 @@ static int nfs_revalidate_file(struct inode *inode, struct file *filp) | |||
137 | struct nfs_inode *nfsi = NFS_I(inode); | 137 | struct nfs_inode *nfsi = NFS_I(inode); |
138 | int retval = 0; | 138 | int retval = 0; |
139 | 139 | ||
140 | if ((nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE) || nfs_attribute_timeout(inode)) | 140 | if ((nfsi->cache_validity & (NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_ATTR)) |
141 | || nfs_attribute_timeout(inode)) | ||
141 | retval = __nfs_revalidate_inode(NFS_SERVER(inode), inode); | 142 | retval = __nfs_revalidate_inode(NFS_SERVER(inode), inode); |
142 | nfs_revalidate_mapping(inode, filp->f_mapping); | 143 | nfs_revalidate_mapping(inode, filp->f_mapping); |
143 | return 0; | 144 | return 0; |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 6922469d6fc5..d4eadeea128e 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -877,12 +877,10 @@ static int nfs_wait_on_inode(struct inode *inode) | |||
877 | sigset_t oldmask; | 877 | sigset_t oldmask; |
878 | int error; | 878 | int error; |
879 | 879 | ||
880 | atomic_inc(&inode->i_count); | ||
881 | rpc_clnt_sigmask(clnt, &oldmask); | 880 | rpc_clnt_sigmask(clnt, &oldmask); |
882 | error = wait_on_bit_lock(&nfsi->flags, NFS_INO_REVALIDATING, | 881 | error = wait_on_bit_lock(&nfsi->flags, NFS_INO_REVALIDATING, |
883 | nfs_wait_schedule, TASK_INTERRUPTIBLE); | 882 | nfs_wait_schedule, TASK_INTERRUPTIBLE); |
884 | rpc_clnt_sigunmask(clnt, &oldmask); | 883 | rpc_clnt_sigunmask(clnt, &oldmask); |
885 | iput(inode); | ||
886 | 884 | ||
887 | return error; | 885 | return error; |
888 | } | 886 | } |
@@ -1226,10 +1224,6 @@ int nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1226 | loff_t cur_size, new_isize; | 1224 | loff_t cur_size, new_isize; |
1227 | int data_unstable; | 1225 | int data_unstable; |
1228 | 1226 | ||
1229 | /* Do we hold a delegation? */ | ||
1230 | if (nfs_have_delegation(inode, FMODE_READ)) | ||
1231 | return 0; | ||
1232 | |||
1233 | spin_lock(&inode->i_lock); | 1227 | spin_lock(&inode->i_lock); |
1234 | 1228 | ||
1235 | /* Are we in the process of updating data on the server? */ | 1229 | /* Are we in the process of updating data on the server? */ |
@@ -1350,7 +1344,8 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr, unsign | |||
1350 | nfsi->read_cache_jiffies = fattr->timestamp; | 1344 | nfsi->read_cache_jiffies = fattr->timestamp; |
1351 | 1345 | ||
1352 | /* Are we racing with known updates of the metadata on the server? */ | 1346 | /* Are we racing with known updates of the metadata on the server? */ |
1353 | data_unstable = ! nfs_verify_change_attribute(inode, verifier); | 1347 | data_unstable = ! (nfs_verify_change_attribute(inode, verifier) || |
1348 | (nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE)); | ||
1354 | 1349 | ||
1355 | /* Check if our cached file size is stale */ | 1350 | /* Check if our cached file size is stale */ |
1356 | new_isize = nfs_size_to_loff_t(fattr->size); | 1351 | new_isize = nfs_size_to_loff_t(fattr->size); |
diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c index f3bf016d5ee3..cff10ab1af63 100644 --- a/fs/proc/nommu.c +++ b/fs/proc/nommu.c | |||
@@ -91,6 +91,7 @@ static void *nommu_vma_list_start(struct seq_file *m, loff_t *_pos) | |||
91 | next = _rb; | 91 | next = _rb; |
92 | break; | 92 | break; |
93 | } | 93 | } |
94 | pos--; | ||
94 | } | 95 | } |
95 | 96 | ||
96 | return next; | 97 | return next; |