diff options
Diffstat (limited to 'fs/xfs/linux-2.6')
| -rw-r--r-- | fs/xfs/linux-2.6/mutex.h | 10 | ||||
| -rw-r--r-- | fs/xfs/linux-2.6/xfs_iops.c | 2 | ||||
| -rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.c | 18 | 
3 files changed, 13 insertions, 17 deletions
| diff --git a/fs/xfs/linux-2.6/mutex.h b/fs/xfs/linux-2.6/mutex.h index ce773d89a923..d3369b6ca168 100644 --- a/fs/xfs/linux-2.6/mutex.h +++ b/fs/xfs/linux-2.6/mutex.h | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | #define __XFS_SUPPORT_MUTEX_H__ | 19 | #define __XFS_SUPPORT_MUTEX_H__ | 
| 20 | 20 | ||
| 21 | #include <linux/spinlock.h> | 21 | #include <linux/spinlock.h> | 
| 22 | #include <asm/semaphore.h> | 22 | #include <linux/mutex.h> | 
| 23 | 23 | ||
| 24 | /* | 24 | /* | 
| 25 | * Map the mutex'es from IRIX to Linux semaphores. | 25 | * Map the mutex'es from IRIX to Linux semaphores. | 
| @@ -28,12 +28,8 @@ | |||
| 28 | * callers. | 28 | * callers. | 
| 29 | */ | 29 | */ | 
| 30 | #define MUTEX_DEFAULT 0x0 | 30 | #define MUTEX_DEFAULT 0x0 | 
| 31 | typedef struct semaphore mutex_t; | ||
| 32 | 31 | ||
| 33 | #define mutex_init(lock, type, name) sema_init(lock, 1) | 32 | typedef struct mutex mutex_t; | 
| 34 | #define mutex_destroy(lock) sema_init(lock, -99) | 33 | //#define mutex_destroy(lock) do{}while(0) | 
| 35 | #define mutex_lock(lock, num) down(lock) | ||
| 36 | #define mutex_trylock(lock) (down_trylock(lock) ? 0 : 1) | ||
| 37 | #define mutex_unlock(lock) up(lock) | ||
| 38 | 34 | ||
| 39 | #endif /* __XFS_SUPPORT_MUTEX_H__ */ | 35 | #endif /* __XFS_SUPPORT_MUTEX_H__ */ | 
| diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 14215a7db59f..41c478bb1ffc 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
| @@ -203,7 +203,7 @@ validate_fields( | |||
| 203 | ip->i_nlink = va.va_nlink; | 203 | ip->i_nlink = va.va_nlink; | 
| 204 | ip->i_blocks = va.va_nblocks; | 204 | ip->i_blocks = va.va_nblocks; | 
| 205 | 205 | ||
| 206 | /* we're under i_sem so i_size can't change under us */ | 206 | /* we're under i_mutex so i_size can't change under us */ | 
| 207 | if (i_size_read(ip) != va.va_size) | 207 | if (i_size_read(ip) != va.va_size) | 
| 208 | i_size_write(ip, va.va_size); | 208 | i_size_write(ip, va.va_size); | 
| 209 | } | 209 | } | 
| diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 279e9bc92aba..5675117ef227 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c | |||
| @@ -254,7 +254,7 @@ xfs_read( | |||
| 254 | } | 254 | } | 
| 255 | 255 | ||
| 256 | if (unlikely(ioflags & IO_ISDIRECT)) | 256 | if (unlikely(ioflags & IO_ISDIRECT)) | 
| 257 | down(&inode->i_sem); | 257 | mutex_lock(&inode->i_mutex); | 
| 258 | xfs_ilock(ip, XFS_IOLOCK_SHARED); | 258 | xfs_ilock(ip, XFS_IOLOCK_SHARED); | 
| 259 | 259 | ||
| 260 | if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ) && | 260 | if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ) && | 
| @@ -286,7 +286,7 @@ xfs_read( | |||
| 286 | 286 | ||
| 287 | unlock_isem: | 287 | unlock_isem: | 
| 288 | if (unlikely(ioflags & IO_ISDIRECT)) | 288 | if (unlikely(ioflags & IO_ISDIRECT)) | 
| 289 | up(&inode->i_sem); | 289 | mutex_unlock(&inode->i_mutex); | 
| 290 | return ret; | 290 | return ret; | 
| 291 | } | 291 | } | 
| 292 | 292 | ||
| @@ -655,7 +655,7 @@ relock: | |||
| 655 | iolock = XFS_IOLOCK_EXCL; | 655 | iolock = XFS_IOLOCK_EXCL; | 
| 656 | locktype = VRWLOCK_WRITE; | 656 | locktype = VRWLOCK_WRITE; | 
| 657 | 657 | ||
| 658 | down(&inode->i_sem); | 658 | mutex_lock(&inode->i_mutex); | 
| 659 | } else { | 659 | } else { | 
| 660 | iolock = XFS_IOLOCK_SHARED; | 660 | iolock = XFS_IOLOCK_SHARED; | 
| 661 | locktype = VRWLOCK_WRITE_DIRECT; | 661 | locktype = VRWLOCK_WRITE_DIRECT; | 
| @@ -686,7 +686,7 @@ start: | |||
| 686 | int dmflags = FILP_DELAY_FLAG(file); | 686 | int dmflags = FILP_DELAY_FLAG(file); | 
| 687 | 687 | ||
| 688 | if (need_isem) | 688 | if (need_isem) | 
| 689 | dmflags |= DM_FLAGS_ISEM; | 689 | dmflags |= DM_FLAGS_IMUX; | 
| 690 | 690 | ||
| 691 | xfs_iunlock(xip, XFS_ILOCK_EXCL); | 691 | xfs_iunlock(xip, XFS_ILOCK_EXCL); | 
| 692 | error = XFS_SEND_DATA(xip->i_mount, DM_EVENT_WRITE, vp, | 692 | error = XFS_SEND_DATA(xip->i_mount, DM_EVENT_WRITE, vp, | 
| @@ -772,7 +772,7 @@ retry: | |||
| 772 | if (need_isem) { | 772 | if (need_isem) { | 
| 773 | /* demote the lock now the cached pages are gone */ | 773 | /* demote the lock now the cached pages are gone */ | 
| 774 | XFS_ILOCK_DEMOTE(mp, io, XFS_IOLOCK_EXCL); | 774 | XFS_ILOCK_DEMOTE(mp, io, XFS_IOLOCK_EXCL); | 
| 775 | up(&inode->i_sem); | 775 | mutex_unlock(&inode->i_mutex); | 
| 776 | 776 | ||
| 777 | iolock = XFS_IOLOCK_SHARED; | 777 | iolock = XFS_IOLOCK_SHARED; | 
| 778 | locktype = VRWLOCK_WRITE_DIRECT; | 778 | locktype = VRWLOCK_WRITE_DIRECT; | 
| @@ -817,14 +817,14 @@ retry: | |||
| 817 | 817 | ||
| 818 | xfs_rwunlock(bdp, locktype); | 818 | xfs_rwunlock(bdp, locktype); | 
| 819 | if (need_isem) | 819 | if (need_isem) | 
| 820 | up(&inode->i_sem); | 820 | mutex_unlock(&inode->i_mutex); | 
| 821 | error = XFS_SEND_NAMESP(xip->i_mount, DM_EVENT_NOSPACE, vp, | 821 | error = XFS_SEND_NAMESP(xip->i_mount, DM_EVENT_NOSPACE, vp, | 
| 822 | DM_RIGHT_NULL, vp, DM_RIGHT_NULL, NULL, NULL, | 822 | DM_RIGHT_NULL, vp, DM_RIGHT_NULL, NULL, NULL, | 
| 823 | 0, 0, 0); /* Delay flag intentionally unused */ | 823 | 0, 0, 0); /* Delay flag intentionally unused */ | 
| 824 | if (error) | 824 | if (error) | 
| 825 | goto out_nounlocks; | 825 | goto out_nounlocks; | 
| 826 | if (need_isem) | 826 | if (need_isem) | 
| 827 | down(&inode->i_sem); | 827 | mutex_lock(&inode->i_mutex); | 
| 828 | xfs_rwlock(bdp, locktype); | 828 | xfs_rwlock(bdp, locktype); | 
| 829 | pos = xip->i_d.di_size; | 829 | pos = xip->i_d.di_size; | 
| 830 | ret = 0; | 830 | ret = 0; | 
| @@ -926,7 +926,7 @@ retry: | |||
| 926 | 926 | ||
| 927 | xfs_rwunlock(bdp, locktype); | 927 | xfs_rwunlock(bdp, locktype); | 
| 928 | if (need_isem) | 928 | if (need_isem) | 
| 929 | up(&inode->i_sem); | 929 | mutex_unlock(&inode->i_mutex); | 
| 930 | 930 | ||
| 931 | error = sync_page_range(inode, mapping, pos, ret); | 931 | error = sync_page_range(inode, mapping, pos, ret); | 
| 932 | if (!error) | 932 | if (!error) | 
| @@ -938,7 +938,7 @@ retry: | |||
| 938 | xfs_rwunlock(bdp, locktype); | 938 | xfs_rwunlock(bdp, locktype); | 
| 939 | out_unlock_isem: | 939 | out_unlock_isem: | 
| 940 | if (need_isem) | 940 | if (need_isem) | 
| 941 | up(&inode->i_sem); | 941 | mutex_unlock(&inode->i_mutex); | 
| 942 | out_nounlocks: | 942 | out_nounlocks: | 
| 943 | return -error; | 943 | return -error; | 
| 944 | } | 944 | } | 
