aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
diff options
context:
space:
mode:
authorDean Roehrich <roehrich@sgi.com>2005-06-21 20:20:44 -0400
committerNathan Scott <nathans@sgi.com>2005-06-21 20:20:44 -0400
commite1a40fa907498030b6e432c0dbcb06d7a9f14ee3 (patch)
tree8f6ad8643346358ef39d7d28d1e001af81eb6e9a /fs/xfs/linux-2.6
parentad89d0212e32c5cf27dfcbad67b91a32b9878529 (diff)
[XFS] Handle inode semaphores properly for dmapi queues
SGI-PV: 931572 SGI-Modid: xfs-linux-melb:xfs-kern:189560a Signed-off-by: Dean Roehrich <roehrich@sgi.com> Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c
index 46b61a859af4..acab58c48043 100644
--- a/fs/xfs/linux-2.6/xfs_lrw.c
+++ b/fs/xfs/linux-2.6/xfs_lrw.c
@@ -280,10 +280,11 @@ xfs_read(
280 if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ) && 280 if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ) &&
281 !(ioflags & IO_INVIS)) { 281 !(ioflags & IO_INVIS)) {
282 vrwlock_t locktype = VRWLOCK_READ; 282 vrwlock_t locktype = VRWLOCK_READ;
283 int dmflags = FILP_DELAY_FLAG(file) | DM_SEM_FLAG_RD(ioflags);
283 284
284 ret = -XFS_SEND_DATA(mp, DM_EVENT_READ, 285 ret = -XFS_SEND_DATA(mp, DM_EVENT_READ,
285 BHV_TO_VNODE(bdp), *offset, size, 286 BHV_TO_VNODE(bdp), *offset, size,
286 FILP_DELAY_FLAG(file), &locktype); 287 dmflags, &locktype);
287 if (ret) { 288 if (ret) {
288 xfs_iunlock(ip, XFS_IOLOCK_SHARED); 289 xfs_iunlock(ip, XFS_IOLOCK_SHARED);
289 goto unlock_isem; 290 goto unlock_isem;
@@ -843,11 +844,15 @@ retry:
843 !(ioflags & IO_INVIS)) { 844 !(ioflags & IO_INVIS)) {
844 845
845 xfs_rwunlock(bdp, locktype); 846 xfs_rwunlock(bdp, locktype);
847 if (need_isem)
848 up(&inode->i_sem);
846 error = XFS_SEND_NAMESP(xip->i_mount, DM_EVENT_NOSPACE, vp, 849 error = XFS_SEND_NAMESP(xip->i_mount, DM_EVENT_NOSPACE, vp,
847 DM_RIGHT_NULL, vp, DM_RIGHT_NULL, NULL, NULL, 850 DM_RIGHT_NULL, vp, DM_RIGHT_NULL, NULL, NULL,
848 0, 0, 0); /* Delay flag intentionally unused */ 851 0, 0, 0); /* Delay flag intentionally unused */
849 if (error) 852 if (error)
850 goto out_unlock_isem; 853 goto out_nounlocks;
854 if (need_isem)
855 down(&inode->i_sem);
851 xfs_rwlock(bdp, locktype); 856 xfs_rwlock(bdp, locktype);
852 pos = xip->i_d.di_size; 857 pos = xip->i_d.di_size;
853 ret = 0; 858 ret = 0;
@@ -962,6 +967,7 @@ retry:
962 out_unlock_isem: 967 out_unlock_isem:
963 if (need_isem) 968 if (need_isem)
964 up(&inode->i_sem); 969 up(&inode->i_sem);
970 out_nounlocks:
965 return -error; 971 return -error;
966} 972}
967 973