diff options
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/linux-2.6/mutex.h | 10 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_fs_subr.c | 3 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl.c | 5 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl32.c | 1 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_iops.c | 5 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.c | 20 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_dquot.c | 4 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_qm.c | 10 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_qm.h | 2 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_qm_bhv.c | 2 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_qm_syscalls.c | 8 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_quota_priv.h | 2 | ||||
-rw-r--r-- | fs/xfs/support/uuid.c | 6 | ||||
-rw-r--r-- | fs/xfs/xfs_attr.c | 29 | ||||
-rw-r--r-- | fs/xfs/xfs_dmapi.h | 14 | ||||
-rw-r--r-- | fs/xfs/xfs_log.h | 8 | ||||
-rw-r--r-- | fs/xfs/xfs_mount.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_mount.h | 2 |
18 files changed, 53 insertions, 80 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_fs_subr.c b/fs/xfs/linux-2.6/xfs_fs_subr.c index f89340c61bf2..4fa4b1a5187e 100644 --- a/fs/xfs/linux-2.6/xfs_fs_subr.c +++ b/fs/xfs/linux-2.6/xfs_fs_subr.c | |||
@@ -79,8 +79,7 @@ fs_flushinval_pages( | |||
79 | struct inode *ip = LINVFS_GET_IP(vp); | 79 | struct inode *ip = LINVFS_GET_IP(vp); |
80 | 80 | ||
81 | if (VN_CACHED(vp)) { | 81 | if (VN_CACHED(vp)) { |
82 | filemap_fdatawrite(ip->i_mapping); | 82 | filemap_write_and_wait(ip->i_mapping); |
83 | filemap_fdatawait(ip->i_mapping); | ||
84 | 83 | ||
85 | truncate_inode_pages(ip->i_mapping, first); | 84 | truncate_inode_pages(ip->i_mapping, first); |
86 | } | 85 | } |
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c index b78b5eb9e96c..f98c5be3dfe7 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.c +++ b/fs/xfs/linux-2.6/xfs_ioctl.c | |||
@@ -530,6 +530,8 @@ xfs_attrmulti_attr_set( | |||
530 | char *kbuf; | 530 | char *kbuf; |
531 | int error = EFAULT; | 531 | int error = EFAULT; |
532 | 532 | ||
533 | if (IS_RDONLY(&vp->v_inode)) | ||
534 | return -EROFS; | ||
533 | if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode)) | 535 | if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode)) |
534 | return EPERM; | 536 | return EPERM; |
535 | if (len > XATTR_SIZE_MAX) | 537 | if (len > XATTR_SIZE_MAX) |
@@ -557,6 +559,9 @@ xfs_attrmulti_attr_remove( | |||
557 | { | 559 | { |
558 | int error; | 560 | int error; |
559 | 561 | ||
562 | |||
563 | if (IS_RDONLY(&vp->v_inode)) | ||
564 | return -EROFS; | ||
560 | if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode)) | 565 | if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode)) |
561 | return EPERM; | 566 | return EPERM; |
562 | 567 | ||
diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c index c83ae15bb0e6..a7c9ba1a9f7b 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl32.c +++ b/fs/xfs/linux-2.6/xfs_ioctl32.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/compat.h> | 19 | #include <linux/compat.h> |
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/ioctl.h> | 21 | #include <linux/ioctl.h> |
22 | #include <linux/ioctl32.h> | ||
23 | #include <linux/syscalls.h> | 22 | #include <linux/syscalls.h> |
24 | #include <linux/types.h> | 23 | #include <linux/types.h> |
25 | #include <linux/fs.h> | 24 | #include <linux/fs.h> |
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 14215a7db59f..97fb1470cf28 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -54,6 +54,9 @@ | |||
54 | #include <linux/xattr.h> | 54 | #include <linux/xattr.h> |
55 | #include <linux/namei.h> | 55 | #include <linux/namei.h> |
56 | 56 | ||
57 | #define IS_NOATIME(inode) ((inode->i_sb->s_flags & MS_NOATIME) || \ | ||
58 | (S_ISDIR(inode->i_mode) && inode->i_sb->s_flags & MS_NODIRATIME)) | ||
59 | |||
57 | /* | 60 | /* |
58 | * Change the requested timestamp in the given inode. | 61 | * Change the requested timestamp in the given inode. |
59 | * We don't lock across timestamp updates, and we don't log them but | 62 | * We don't lock across timestamp updates, and we don't log them but |
@@ -203,7 +206,7 @@ validate_fields( | |||
203 | ip->i_nlink = va.va_nlink; | 206 | ip->i_nlink = va.va_nlink; |
204 | ip->i_blocks = va.va_nblocks; | 207 | ip->i_blocks = va.va_nblocks; |
205 | 208 | ||
206 | /* we're under i_sem so i_size can't change under us */ | 209 | /* we're under i_mutex so i_size can't change under us */ |
207 | if (i_size_read(ip) != va.va_size) | 210 | if (i_size_read(ip) != va.va_size) |
208 | i_size_write(ip, va.va_size); | 211 | i_size_write(ip, va.va_size); |
209 | } | 212 | } |
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 279e9bc92aba..885dfafeabee 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, |
@@ -713,7 +713,7 @@ start: | |||
713 | } | 713 | } |
714 | 714 | ||
715 | if (likely(!(ioflags & IO_INVIS))) { | 715 | if (likely(!(ioflags & IO_INVIS))) { |
716 | inode_update_time(inode, 1); | 716 | file_update_time(file); |
717 | xfs_ichgtime_fast(xip, inode, | 717 | xfs_ichgtime_fast(xip, inode, |
718 | XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); | 718 | XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); |
719 | } | 719 | } |
@@ -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 | } |
diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c index 00b5043dfa5a..772ac48329ea 100644 --- a/fs/xfs/quota/xfs_dquot.c +++ b/fs/xfs/quota/xfs_dquot.c | |||
@@ -104,7 +104,7 @@ xfs_qm_dqinit( | |||
104 | */ | 104 | */ |
105 | if (brandnewdquot) { | 105 | if (brandnewdquot) { |
106 | dqp->dq_flnext = dqp->dq_flprev = dqp; | 106 | dqp->dq_flnext = dqp->dq_flprev = dqp; |
107 | mutex_init(&dqp->q_qlock, MUTEX_DEFAULT, "xdq"); | 107 | mutex_init(&dqp->q_qlock); |
108 | initnsema(&dqp->q_flock, 1, "fdq"); | 108 | initnsema(&dqp->q_flock, 1, "fdq"); |
109 | sv_init(&dqp->q_pinwait, SV_DEFAULT, "pdq"); | 109 | sv_init(&dqp->q_pinwait, SV_DEFAULT, "pdq"); |
110 | 110 | ||
@@ -1382,7 +1382,7 @@ void | |||
1382 | xfs_dqlock( | 1382 | xfs_dqlock( |
1383 | xfs_dquot_t *dqp) | 1383 | xfs_dquot_t *dqp) |
1384 | { | 1384 | { |
1385 | mutex_lock(&(dqp->q_qlock), PINOD); | 1385 | mutex_lock(&(dqp->q_qlock)); |
1386 | } | 1386 | } |
1387 | 1387 | ||
1388 | void | 1388 | void |
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c index 5328a2937127..bb6991a7a617 100644 --- a/fs/xfs/quota/xfs_qm.c +++ b/fs/xfs/quota/xfs_qm.c | |||
@@ -167,7 +167,7 @@ xfs_Gqm_init(void) | |||
167 | xqm->qm_dqfree_ratio = XFS_QM_DQFREE_RATIO; | 167 | xqm->qm_dqfree_ratio = XFS_QM_DQFREE_RATIO; |
168 | xqm->qm_nrefs = 0; | 168 | xqm->qm_nrefs = 0; |
169 | #ifdef DEBUG | 169 | #ifdef DEBUG |
170 | mutex_init(&qcheck_lock, MUTEX_DEFAULT, "qchk"); | 170 | xfs_mutex_init(&qcheck_lock, MUTEX_DEFAULT, "qchk"); |
171 | #endif | 171 | #endif |
172 | return xqm; | 172 | return xqm; |
173 | } | 173 | } |
@@ -1166,7 +1166,7 @@ xfs_qm_init_quotainfo( | |||
1166 | qinf->qi_dqreclaims = 0; | 1166 | qinf->qi_dqreclaims = 0; |
1167 | 1167 | ||
1168 | /* mutex used to serialize quotaoffs */ | 1168 | /* mutex used to serialize quotaoffs */ |
1169 | mutex_init(&qinf->qi_quotaofflock, MUTEX_DEFAULT, "qoff"); | 1169 | mutex_init(&qinf->qi_quotaofflock); |
1170 | 1170 | ||
1171 | /* Precalc some constants */ | 1171 | /* Precalc some constants */ |
1172 | qinf->qi_dqchunklen = XFS_FSB_TO_BB(mp, XFS_DQUOT_CLUSTER_SIZE_FSB); | 1172 | qinf->qi_dqchunklen = XFS_FSB_TO_BB(mp, XFS_DQUOT_CLUSTER_SIZE_FSB); |
@@ -1285,7 +1285,7 @@ xfs_qm_list_init( | |||
1285 | char *str, | 1285 | char *str, |
1286 | int n) | 1286 | int n) |
1287 | { | 1287 | { |
1288 | mutex_init(&list->qh_lock, MUTEX_DEFAULT, str); | 1288 | mutex_init(&list->qh_lock); |
1289 | list->qh_next = NULL; | 1289 | list->qh_next = NULL; |
1290 | list->qh_version = 0; | 1290 | list->qh_version = 0; |
1291 | list->qh_nelems = 0; | 1291 | list->qh_nelems = 0; |
@@ -2762,7 +2762,7 @@ STATIC void | |||
2762 | xfs_qm_freelist_init(xfs_frlist_t *ql) | 2762 | xfs_qm_freelist_init(xfs_frlist_t *ql) |
2763 | { | 2763 | { |
2764 | ql->qh_next = ql->qh_prev = (xfs_dquot_t *) ql; | 2764 | ql->qh_next = ql->qh_prev = (xfs_dquot_t *) ql; |
2765 | mutex_init(&ql->qh_lock, MUTEX_DEFAULT, "dqf"); | 2765 | mutex_init(&ql->qh_lock); |
2766 | ql->qh_version = 0; | 2766 | ql->qh_version = 0; |
2767 | ql->qh_nelems = 0; | 2767 | ql->qh_nelems = 0; |
2768 | } | 2768 | } |
@@ -2772,7 +2772,7 @@ xfs_qm_freelist_destroy(xfs_frlist_t *ql) | |||
2772 | { | 2772 | { |
2773 | xfs_dquot_t *dqp, *nextdqp; | 2773 | xfs_dquot_t *dqp, *nextdqp; |
2774 | 2774 | ||
2775 | mutex_lock(&ql->qh_lock, PINOD); | 2775 | mutex_lock(&ql->qh_lock); |
2776 | for (dqp = ql->qh_next; | 2776 | for (dqp = ql->qh_next; |
2777 | dqp != (xfs_dquot_t *)ql; ) { | 2777 | dqp != (xfs_dquot_t *)ql; ) { |
2778 | xfs_dqlock(dqp); | 2778 | xfs_dqlock(dqp); |
diff --git a/fs/xfs/quota/xfs_qm.h b/fs/xfs/quota/xfs_qm.h index 12da259f2fcb..4568deb6da86 100644 --- a/fs/xfs/quota/xfs_qm.h +++ b/fs/xfs/quota/xfs_qm.h | |||
@@ -165,7 +165,7 @@ typedef struct xfs_dquot_acct { | |||
165 | #define XFS_QM_IWARNLIMIT 5 | 165 | #define XFS_QM_IWARNLIMIT 5 |
166 | #define XFS_QM_RTBWARNLIMIT 5 | 166 | #define XFS_QM_RTBWARNLIMIT 5 |
167 | 167 | ||
168 | #define XFS_QM_LOCK(xqm) (mutex_lock(&xqm##_lock, PINOD)) | 168 | #define XFS_QM_LOCK(xqm) (mutex_lock(&xqm##_lock)) |
169 | #define XFS_QM_UNLOCK(xqm) (mutex_unlock(&xqm##_lock)) | 169 | #define XFS_QM_UNLOCK(xqm) (mutex_unlock(&xqm##_lock)) |
170 | #define XFS_QM_HOLD(xqm) ((xqm)->qm_nrefs++) | 170 | #define XFS_QM_HOLD(xqm) ((xqm)->qm_nrefs++) |
171 | #define XFS_QM_RELE(xqm) ((xqm)->qm_nrefs--) | 171 | #define XFS_QM_RELE(xqm) ((xqm)->qm_nrefs--) |
diff --git a/fs/xfs/quota/xfs_qm_bhv.c b/fs/xfs/quota/xfs_qm_bhv.c index d9d2993de435..90402a1c3983 100644 --- a/fs/xfs/quota/xfs_qm_bhv.c +++ b/fs/xfs/quota/xfs_qm_bhv.c | |||
@@ -363,7 +363,7 @@ xfs_qm_init(void) | |||
363 | KERN_INFO "SGI XFS Quota Management subsystem\n"; | 363 | KERN_INFO "SGI XFS Quota Management subsystem\n"; |
364 | 364 | ||
365 | printk(message); | 365 | printk(message); |
366 | mutex_init(&xfs_Gqm_lock, MUTEX_DEFAULT, "xfs_qmlock"); | 366 | mutex_init(&xfs_Gqm_lock); |
367 | vfs_bhv_set_custom(&xfs_qmops, &xfs_qmcore_xfs); | 367 | vfs_bhv_set_custom(&xfs_qmops, &xfs_qmcore_xfs); |
368 | xfs_qm_init_procfs(); | 368 | xfs_qm_init_procfs(); |
369 | } | 369 | } |
diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c index 24690e1af659..86a1d09f48d5 100644 --- a/fs/xfs/quota/xfs_qm_syscalls.c +++ b/fs/xfs/quota/xfs_qm_syscalls.c | |||
@@ -233,7 +233,7 @@ xfs_qm_scall_quotaoff( | |||
233 | */ | 233 | */ |
234 | ASSERT(mp->m_quotainfo); | 234 | ASSERT(mp->m_quotainfo); |
235 | if (mp->m_quotainfo) | 235 | if (mp->m_quotainfo) |
236 | mutex_lock(&(XFS_QI_QOFFLOCK(mp)), PINOD); | 236 | mutex_lock(&(XFS_QI_QOFFLOCK(mp))); |
237 | 237 | ||
238 | ASSERT(mp->m_quotainfo); | 238 | ASSERT(mp->m_quotainfo); |
239 | 239 | ||
@@ -508,7 +508,7 @@ xfs_qm_scall_quotaon( | |||
508 | /* | 508 | /* |
509 | * Switch on quota enforcement in core. | 509 | * Switch on quota enforcement in core. |
510 | */ | 510 | */ |
511 | mutex_lock(&(XFS_QI_QOFFLOCK(mp)), PINOD); | 511 | mutex_lock(&(XFS_QI_QOFFLOCK(mp))); |
512 | mp->m_qflags |= (flags & XFS_ALL_QUOTA_ENFD); | 512 | mp->m_qflags |= (flags & XFS_ALL_QUOTA_ENFD); |
513 | mutex_unlock(&(XFS_QI_QOFFLOCK(mp))); | 513 | mutex_unlock(&(XFS_QI_QOFFLOCK(mp))); |
514 | 514 | ||
@@ -617,7 +617,7 @@ xfs_qm_scall_setqlim( | |||
617 | * a quotaoff from happening). (XXXThis doesn't currently happen | 617 | * a quotaoff from happening). (XXXThis doesn't currently happen |
618 | * because we take the vfslock before calling xfs_qm_sysent). | 618 | * because we take the vfslock before calling xfs_qm_sysent). |
619 | */ | 619 | */ |
620 | mutex_lock(&(XFS_QI_QOFFLOCK(mp)), PINOD); | 620 | mutex_lock(&(XFS_QI_QOFFLOCK(mp))); |
621 | 621 | ||
622 | /* | 622 | /* |
623 | * Get the dquot (locked), and join it to the transaction. | 623 | * Get the dquot (locked), and join it to the transaction. |
@@ -1426,7 +1426,7 @@ xfs_qm_internalqcheck( | |||
1426 | xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE | XFS_LOG_SYNC); | 1426 | xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE | XFS_LOG_SYNC); |
1427 | XFS_bflush(mp->m_ddev_targp); | 1427 | XFS_bflush(mp->m_ddev_targp); |
1428 | 1428 | ||
1429 | mutex_lock(&qcheck_lock, PINOD); | 1429 | mutex_lock(&qcheck_lock); |
1430 | /* There should be absolutely no quota activity while this | 1430 | /* There should be absolutely no quota activity while this |
1431 | is going on. */ | 1431 | is going on. */ |
1432 | qmtest_udqtab = kmem_zalloc(qmtest_hashmask * | 1432 | qmtest_udqtab = kmem_zalloc(qmtest_hashmask * |
diff --git a/fs/xfs/quota/xfs_quota_priv.h b/fs/xfs/quota/xfs_quota_priv.h index 7a9f3beb818c..b7ddd04aae32 100644 --- a/fs/xfs/quota/xfs_quota_priv.h +++ b/fs/xfs/quota/xfs_quota_priv.h | |||
@@ -51,7 +51,7 @@ | |||
51 | #define XFS_QI_MPLNEXT(mp) ((mp)->m_quotainfo->qi_dqlist.qh_next) | 51 | #define XFS_QI_MPLNEXT(mp) ((mp)->m_quotainfo->qi_dqlist.qh_next) |
52 | #define XFS_QI_MPLNDQUOTS(mp) ((mp)->m_quotainfo->qi_dqlist.qh_nelems) | 52 | #define XFS_QI_MPLNDQUOTS(mp) ((mp)->m_quotainfo->qi_dqlist.qh_nelems) |
53 | 53 | ||
54 | #define XQMLCK(h) (mutex_lock(&((h)->qh_lock), PINOD)) | 54 | #define XQMLCK(h) (mutex_lock(&((h)->qh_lock))) |
55 | #define XQMUNLCK(h) (mutex_unlock(&((h)->qh_lock))) | 55 | #define XQMUNLCK(h) (mutex_unlock(&((h)->qh_lock))) |
56 | #ifdef DEBUG | 56 | #ifdef DEBUG |
57 | struct xfs_dqhash; | 57 | struct xfs_dqhash; |
diff --git a/fs/xfs/support/uuid.c b/fs/xfs/support/uuid.c index 70ce40914c8a..69ec4f540c3a 100644 --- a/fs/xfs/support/uuid.c +++ b/fs/xfs/support/uuid.c | |||
@@ -24,7 +24,7 @@ static uuid_t *uuid_table; | |||
24 | void | 24 | void |
25 | uuid_init(void) | 25 | uuid_init(void) |
26 | { | 26 | { |
27 | mutex_init(&uuid_monitor, MUTEX_DEFAULT, "uuid_monitor"); | 27 | mutex_init(&uuid_monitor); |
28 | } | 28 | } |
29 | 29 | ||
30 | /* | 30 | /* |
@@ -94,7 +94,7 @@ uuid_table_insert(uuid_t *uuid) | |||
94 | { | 94 | { |
95 | int i, hole; | 95 | int i, hole; |
96 | 96 | ||
97 | mutex_lock(&uuid_monitor, PVFS); | 97 | mutex_lock(&uuid_monitor); |
98 | for (i = 0, hole = -1; i < uuid_table_size; i++) { | 98 | for (i = 0, hole = -1; i < uuid_table_size; i++) { |
99 | if (uuid_is_nil(&uuid_table[i])) { | 99 | if (uuid_is_nil(&uuid_table[i])) { |
100 | hole = i; | 100 | hole = i; |
@@ -122,7 +122,7 @@ uuid_table_remove(uuid_t *uuid) | |||
122 | { | 122 | { |
123 | int i; | 123 | int i; |
124 | 124 | ||
125 | mutex_lock(&uuid_monitor, PVFS); | 125 | mutex_lock(&uuid_monitor); |
126 | for (i = 0; i < uuid_table_size; i++) { | 126 | for (i = 0; i < uuid_table_size; i++) { |
127 | if (uuid_is_nil(&uuid_table[i])) | 127 | if (uuid_is_nil(&uuid_table[i])) |
128 | continue; | 128 | continue; |
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c index 5484eeb460c8..1a11c2b51701 100644 --- a/fs/xfs/xfs_attr.c +++ b/fs/xfs/xfs_attr.c | |||
@@ -117,11 +117,6 @@ xfs_attr_fetch(xfs_inode_t *ip, const char *name, int namelen, | |||
117 | ip->i_d.di_anextents == 0)) | 117 | ip->i_d.di_anextents == 0)) |
118 | return(ENOATTR); | 118 | return(ENOATTR); |
119 | 119 | ||
120 | if (!(flags & (ATTR_KERNACCESS|ATTR_SECURE))) { | ||
121 | if ((error = xfs_iaccess(ip, S_IRUSR, cred))) | ||
122 | return(XFS_ERROR(error)); | ||
123 | } | ||
124 | |||
125 | /* | 120 | /* |
126 | * Fill in the arg structure for this request. | 121 | * Fill in the arg structure for this request. |
127 | */ | 122 | */ |
@@ -425,7 +420,7 @@ xfs_attr_set(bhv_desc_t *bdp, const char *name, char *value, int valuelen, int f | |||
425 | struct cred *cred) | 420 | struct cred *cred) |
426 | { | 421 | { |
427 | xfs_inode_t *dp; | 422 | xfs_inode_t *dp; |
428 | int namelen, error; | 423 | int namelen; |
429 | 424 | ||
430 | namelen = strlen(name); | 425 | namelen = strlen(name); |
431 | if (namelen >= MAXNAMELEN) | 426 | if (namelen >= MAXNAMELEN) |
@@ -437,14 +432,6 @@ xfs_attr_set(bhv_desc_t *bdp, const char *name, char *value, int valuelen, int f | |||
437 | if (XFS_FORCED_SHUTDOWN(dp->i_mount)) | 432 | if (XFS_FORCED_SHUTDOWN(dp->i_mount)) |
438 | return (EIO); | 433 | return (EIO); |
439 | 434 | ||
440 | xfs_ilock(dp, XFS_ILOCK_SHARED); | ||
441 | if (!(flags & ATTR_SECURE) && | ||
442 | (error = xfs_iaccess(dp, S_IWUSR, cred))) { | ||
443 | xfs_iunlock(dp, XFS_ILOCK_SHARED); | ||
444 | return(XFS_ERROR(error)); | ||
445 | } | ||
446 | xfs_iunlock(dp, XFS_ILOCK_SHARED); | ||
447 | |||
448 | return xfs_attr_set_int(dp, name, namelen, value, valuelen, flags); | 435 | return xfs_attr_set_int(dp, name, namelen, value, valuelen, flags); |
449 | } | 436 | } |
450 | 437 | ||
@@ -579,7 +566,7 @@ int | |||
579 | xfs_attr_remove(bhv_desc_t *bdp, const char *name, int flags, struct cred *cred) | 566 | xfs_attr_remove(bhv_desc_t *bdp, const char *name, int flags, struct cred *cred) |
580 | { | 567 | { |
581 | xfs_inode_t *dp; | 568 | xfs_inode_t *dp; |
582 | int namelen, error; | 569 | int namelen; |
583 | 570 | ||
584 | namelen = strlen(name); | 571 | namelen = strlen(name); |
585 | if (namelen >= MAXNAMELEN) | 572 | if (namelen >= MAXNAMELEN) |
@@ -592,11 +579,7 @@ xfs_attr_remove(bhv_desc_t *bdp, const char *name, int flags, struct cred *cred) | |||
592 | return (EIO); | 579 | return (EIO); |
593 | 580 | ||
594 | xfs_ilock(dp, XFS_ILOCK_SHARED); | 581 | xfs_ilock(dp, XFS_ILOCK_SHARED); |
595 | if (!(flags & ATTR_SECURE) && | 582 | if (XFS_IFORK_Q(dp) == 0 || |
596 | (error = xfs_iaccess(dp, S_IWUSR, cred))) { | ||
597 | xfs_iunlock(dp, XFS_ILOCK_SHARED); | ||
598 | return(XFS_ERROR(error)); | ||
599 | } else if (XFS_IFORK_Q(dp) == 0 || | ||
600 | (dp->i_d.di_aformat == XFS_DINODE_FMT_EXTENTS && | 583 | (dp->i_d.di_aformat == XFS_DINODE_FMT_EXTENTS && |
601 | dp->i_d.di_anextents == 0)) { | 584 | dp->i_d.di_anextents == 0)) { |
602 | xfs_iunlock(dp, XFS_ILOCK_SHARED); | 585 | xfs_iunlock(dp, XFS_ILOCK_SHARED); |
@@ -668,12 +651,6 @@ xfs_attr_list(bhv_desc_t *bdp, char *buffer, int bufsize, int flags, | |||
668 | return (EIO); | 651 | return (EIO); |
669 | 652 | ||
670 | xfs_ilock(dp, XFS_ILOCK_SHARED); | 653 | xfs_ilock(dp, XFS_ILOCK_SHARED); |
671 | if (!(flags & ATTR_SECURE) && | ||
672 | (error = xfs_iaccess(dp, S_IRUSR, cred))) { | ||
673 | xfs_iunlock(dp, XFS_ILOCK_SHARED); | ||
674 | return(XFS_ERROR(error)); | ||
675 | } | ||
676 | |||
677 | /* | 654 | /* |
678 | * Decide on what work routines to call based on the inode size. | 655 | * Decide on what work routines to call based on the inode size. |
679 | */ | 656 | */ |
diff --git a/fs/xfs/xfs_dmapi.h b/fs/xfs/xfs_dmapi.h index 864bf6955689..b4c7f2bc55a0 100644 --- a/fs/xfs/xfs_dmapi.h +++ b/fs/xfs/xfs_dmapi.h | |||
@@ -152,7 +152,7 @@ typedef enum { | |||
152 | 152 | ||
153 | #define DM_FLAGS_NDELAY 0x001 /* return EAGAIN after dm_pending() */ | 153 | #define DM_FLAGS_NDELAY 0x001 /* return EAGAIN after dm_pending() */ |
154 | #define DM_FLAGS_UNWANTED 0x002 /* event not in fsys dm_eventset_t */ | 154 | #define DM_FLAGS_UNWANTED 0x002 /* event not in fsys dm_eventset_t */ |
155 | #define DM_FLAGS_ISEM 0x004 /* thread holds i_sem */ | 155 | #define DM_FLAGS_IMUX 0x004 /* thread holds i_mutex */ |
156 | #define DM_FLAGS_IALLOCSEM_RD 0x010 /* thread holds i_alloc_sem rd */ | 156 | #define DM_FLAGS_IALLOCSEM_RD 0x010 /* thread holds i_alloc_sem rd */ |
157 | #define DM_FLAGS_IALLOCSEM_WR 0x020 /* thread holds i_alloc_sem wr */ | 157 | #define DM_FLAGS_IALLOCSEM_WR 0x020 /* thread holds i_alloc_sem wr */ |
158 | 158 | ||
@@ -161,21 +161,21 @@ typedef enum { | |||
161 | */ | 161 | */ |
162 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) | 162 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) |
163 | #define DM_SEM_FLAG_RD(ioflags) (((ioflags) & IO_ISDIRECT) ? \ | 163 | #define DM_SEM_FLAG_RD(ioflags) (((ioflags) & IO_ISDIRECT) ? \ |
164 | DM_FLAGS_ISEM : 0) | 164 | DM_FLAGS_IMUX : 0) |
165 | #define DM_SEM_FLAG_WR (DM_FLAGS_IALLOCSEM_WR | DM_FLAGS_ISEM) | 165 | #define DM_SEM_FLAG_WR (DM_FLAGS_IALLOCSEM_WR | DM_FLAGS_IMUX) |
166 | #endif | 166 | #endif |
167 | 167 | ||
168 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) && \ | 168 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) && \ |
169 | (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,22)) | 169 | (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,22)) |
170 | #define DM_SEM_FLAG_RD(ioflags) (((ioflags) & IO_ISDIRECT) ? \ | 170 | #define DM_SEM_FLAG_RD(ioflags) (((ioflags) & IO_ISDIRECT) ? \ |
171 | DM_FLAGS_IALLOCSEM_RD : DM_FLAGS_ISEM) | 171 | DM_FLAGS_IALLOCSEM_RD : DM_FLAGS_IMUX) |
172 | #define DM_SEM_FLAG_WR (DM_FLAGS_IALLOCSEM_WR | DM_FLAGS_ISEM) | 172 | #define DM_SEM_FLAG_WR (DM_FLAGS_IALLOCSEM_WR | DM_FLAGS_IMUX) |
173 | #endif | 173 | #endif |
174 | 174 | ||
175 | #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,21) | 175 | #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,21) |
176 | #define DM_SEM_FLAG_RD(ioflags) (((ioflags) & IO_ISDIRECT) ? \ | 176 | #define DM_SEM_FLAG_RD(ioflags) (((ioflags) & IO_ISDIRECT) ? \ |
177 | 0 : DM_FLAGS_ISEM) | 177 | 0 : DM_FLAGS_IMUX) |
178 | #define DM_SEM_FLAG_WR (DM_FLAGS_ISEM) | 178 | #define DM_SEM_FLAG_WR (DM_FLAGS_IMUX) |
179 | #endif | 179 | #endif |
180 | 180 | ||
181 | 181 | ||
diff --git a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h index 158829ca56f6..f40d4391fcfc 100644 --- a/fs/xfs/xfs_log.h +++ b/fs/xfs/xfs_log.h | |||
@@ -30,13 +30,7 @@ | |||
30 | * By comparing each compnent, we don't have to worry about extra | 30 | * By comparing each compnent, we don't have to worry about extra |
31 | * endian issues in treating two 32 bit numbers as one 64 bit number | 31 | * endian issues in treating two 32 bit numbers as one 64 bit number |
32 | */ | 32 | */ |
33 | static | 33 | static inline xfs_lsn_t _lsn_cmp(xfs_lsn_t lsn1, xfs_lsn_t lsn2) |
34 | #if defined(__GNUC__) && (__GNUC__ == 2) && ( (__GNUC_MINOR__ == 95) || (__GNUC_MINOR__ == 96)) | ||
35 | __attribute__((unused)) /* gcc 2.95, 2.96 miscompile this when inlined */ | ||
36 | #else | ||
37 | __inline__ | ||
38 | #endif | ||
39 | xfs_lsn_t _lsn_cmp(xfs_lsn_t lsn1, xfs_lsn_t lsn2) | ||
40 | { | 34 | { |
41 | if (CYCLE_LSN(lsn1) != CYCLE_LSN(lsn2)) | 35 | if (CYCLE_LSN(lsn1) != CYCLE_LSN(lsn2)) |
42 | return (CYCLE_LSN(lsn1)<CYCLE_LSN(lsn2))? -999 : 999; | 36 | return (CYCLE_LSN(lsn1)<CYCLE_LSN(lsn2))? -999 : 999; |
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 541d5dd474be..303af86739bf 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -117,7 +117,7 @@ xfs_mount_init(void) | |||
117 | 117 | ||
118 | AIL_LOCKINIT(&mp->m_ail_lock, "xfs_ail"); | 118 | AIL_LOCKINIT(&mp->m_ail_lock, "xfs_ail"); |
119 | spinlock_init(&mp->m_sb_lock, "xfs_sb"); | 119 | spinlock_init(&mp->m_sb_lock, "xfs_sb"); |
120 | mutex_init(&mp->m_ilock, MUTEX_DEFAULT, "xfs_ilock"); | 120 | mutex_init(&mp->m_ilock); |
121 | initnsema(&mp->m_growlock, 1, "xfs_grow"); | 121 | initnsema(&mp->m_growlock, 1, "xfs_grow"); |
122 | /* | 122 | /* |
123 | * Initialize the AIL. | 123 | * Initialize the AIL. |
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 08b2e0a5d807..3432fd5a3986 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h | |||
@@ -533,7 +533,7 @@ typedef struct xfs_mod_sb { | |||
533 | int msb_delta; /* Change to make to specified field */ | 533 | int msb_delta; /* Change to make to specified field */ |
534 | } xfs_mod_sb_t; | 534 | } xfs_mod_sb_t; |
535 | 535 | ||
536 | #define XFS_MOUNT_ILOCK(mp) mutex_lock(&((mp)->m_ilock), PINOD) | 536 | #define XFS_MOUNT_ILOCK(mp) mutex_lock(&((mp)->m_ilock)) |
537 | #define XFS_MOUNT_IUNLOCK(mp) mutex_unlock(&((mp)->m_ilock)) | 537 | #define XFS_MOUNT_IUNLOCK(mp) mutex_unlock(&((mp)->m_ilock)) |
538 | #define XFS_SB_LOCK(mp) mutex_spinlock(&(mp)->m_sb_lock) | 538 | #define XFS_SB_LOCK(mp) mutex_spinlock(&(mp)->m_sb_lock) |
539 | #define XFS_SB_UNLOCK(mp,s) mutex_spinunlock(&(mp)->m_sb_lock,(s)) | 539 | #define XFS_SB_UNLOCK(mp,s) mutex_spinunlock(&(mp)->m_sb_lock,(s)) |