diff options
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r-- | fs/xfs/linux-2.6/mrlock.h | 60 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_export.c | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_file.c | 75 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl.c | 8 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_iops.c | 3 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_linux.h | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.c | 21 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.h | 1 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vnode.h | 24 |
11 files changed, 43 insertions, 157 deletions
diff --git a/fs/xfs/linux-2.6/mrlock.h b/fs/xfs/linux-2.6/mrlock.h index c110bb002665..ff6a19873e5c 100644 --- a/fs/xfs/linux-2.6/mrlock.h +++ b/fs/xfs/linux-2.6/mrlock.h | |||
@@ -20,29 +20,24 @@ | |||
20 | 20 | ||
21 | #include <linux/rwsem.h> | 21 | #include <linux/rwsem.h> |
22 | 22 | ||
23 | enum { MR_NONE, MR_ACCESS, MR_UPDATE }; | ||
24 | |||
25 | typedef struct { | 23 | typedef struct { |
26 | struct rw_semaphore mr_lock; | 24 | struct rw_semaphore mr_lock; |
25 | #ifdef DEBUG | ||
27 | int mr_writer; | 26 | int mr_writer; |
27 | #endif | ||
28 | } mrlock_t; | 28 | } mrlock_t; |
29 | 29 | ||
30 | #ifdef DEBUG | ||
30 | #define mrinit(mrp, name) \ | 31 | #define mrinit(mrp, name) \ |
31 | do { (mrp)->mr_writer = 0; init_rwsem(&(mrp)->mr_lock); } while (0) | 32 | do { (mrp)->mr_writer = 0; init_rwsem(&(mrp)->mr_lock); } while (0) |
33 | #else | ||
34 | #define mrinit(mrp, name) \ | ||
35 | do { init_rwsem(&(mrp)->mr_lock); } while (0) | ||
36 | #endif | ||
37 | |||
32 | #define mrlock_init(mrp, t,n,s) mrinit(mrp, n) | 38 | #define mrlock_init(mrp, t,n,s) mrinit(mrp, n) |
33 | #define mrfree(mrp) do { } while (0) | 39 | #define mrfree(mrp) do { } while (0) |
34 | 40 | ||
35 | static inline void mraccess(mrlock_t *mrp) | ||
36 | { | ||
37 | down_read(&mrp->mr_lock); | ||
38 | } | ||
39 | |||
40 | static inline void mrupdate(mrlock_t *mrp) | ||
41 | { | ||
42 | down_write(&mrp->mr_lock); | ||
43 | mrp->mr_writer = 1; | ||
44 | } | ||
45 | |||
46 | static inline void mraccess_nested(mrlock_t *mrp, int subclass) | 41 | static inline void mraccess_nested(mrlock_t *mrp, int subclass) |
47 | { | 42 | { |
48 | down_read_nested(&mrp->mr_lock, subclass); | 43 | down_read_nested(&mrp->mr_lock, subclass); |
@@ -51,10 +46,11 @@ static inline void mraccess_nested(mrlock_t *mrp, int subclass) | |||
51 | static inline void mrupdate_nested(mrlock_t *mrp, int subclass) | 46 | static inline void mrupdate_nested(mrlock_t *mrp, int subclass) |
52 | { | 47 | { |
53 | down_write_nested(&mrp->mr_lock, subclass); | 48 | down_write_nested(&mrp->mr_lock, subclass); |
49 | #ifdef DEBUG | ||
54 | mrp->mr_writer = 1; | 50 | mrp->mr_writer = 1; |
51 | #endif | ||
55 | } | 52 | } |
56 | 53 | ||
57 | |||
58 | static inline int mrtryaccess(mrlock_t *mrp) | 54 | static inline int mrtryaccess(mrlock_t *mrp) |
59 | { | 55 | { |
60 | return down_read_trylock(&mrp->mr_lock); | 56 | return down_read_trylock(&mrp->mr_lock); |
@@ -64,39 +60,31 @@ static inline int mrtryupdate(mrlock_t *mrp) | |||
64 | { | 60 | { |
65 | if (!down_write_trylock(&mrp->mr_lock)) | 61 | if (!down_write_trylock(&mrp->mr_lock)) |
66 | return 0; | 62 | return 0; |
63 | #ifdef DEBUG | ||
67 | mrp->mr_writer = 1; | 64 | mrp->mr_writer = 1; |
65 | #endif | ||
68 | return 1; | 66 | return 1; |
69 | } | 67 | } |
70 | 68 | ||
71 | static inline void mrunlock(mrlock_t *mrp) | 69 | static inline void mrunlock_excl(mrlock_t *mrp) |
72 | { | 70 | { |
73 | if (mrp->mr_writer) { | 71 | #ifdef DEBUG |
74 | mrp->mr_writer = 0; | 72 | mrp->mr_writer = 0; |
75 | up_write(&mrp->mr_lock); | 73 | #endif |
76 | } else { | 74 | up_write(&mrp->mr_lock); |
77 | up_read(&mrp->mr_lock); | ||
78 | } | ||
79 | } | 75 | } |
80 | 76 | ||
81 | static inline void mrdemote(mrlock_t *mrp) | 77 | static inline void mrunlock_shared(mrlock_t *mrp) |
82 | { | 78 | { |
83 | mrp->mr_writer = 0; | 79 | up_read(&mrp->mr_lock); |
84 | downgrade_write(&mrp->mr_lock); | ||
85 | } | 80 | } |
86 | 81 | ||
87 | #ifdef DEBUG | 82 | static inline void mrdemote(mrlock_t *mrp) |
88 | /* | ||
89 | * Debug-only routine, without some platform-specific asm code, we can | ||
90 | * now only answer requests regarding whether we hold the lock for write | ||
91 | * (reader state is outside our visibility, we only track writer state). | ||
92 | * Note: means !ismrlocked would give false positives, so don't do that. | ||
93 | */ | ||
94 | static inline int ismrlocked(mrlock_t *mrp, int type) | ||
95 | { | 83 | { |
96 | if (mrp && type == MR_UPDATE) | 84 | #ifdef DEBUG |
97 | return mrp->mr_writer; | 85 | mrp->mr_writer = 0; |
98 | return 1; | ||
99 | } | ||
100 | #endif | 86 | #endif |
87 | downgrade_write(&mrp->mr_lock); | ||
88 | } | ||
101 | 89 | ||
102 | #endif /* __XFS_SUPPORT_MRLOCK_H__ */ | 90 | #endif /* __XFS_SUPPORT_MRLOCK_H__ */ |
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index 52f6846101d5..5105015a75ad 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -886,7 +886,7 @@ int | |||
886 | xfs_buf_lock_value( | 886 | xfs_buf_lock_value( |
887 | xfs_buf_t *bp) | 887 | xfs_buf_t *bp) |
888 | { | 888 | { |
889 | return atomic_read(&bp->b_sema.count); | 889 | return bp->b_sema.count; |
890 | } | 890 | } |
891 | #endif | 891 | #endif |
892 | 892 | ||
diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c index 265f0168ab76..c672b3238b14 100644 --- a/fs/xfs/linux-2.6/xfs_export.c +++ b/fs/xfs/linux-2.6/xfs_export.c | |||
@@ -133,7 +133,7 @@ xfs_nfs_get_inode( | |||
133 | if (!ip) | 133 | if (!ip) |
134 | return ERR_PTR(-EIO); | 134 | return ERR_PTR(-EIO); |
135 | 135 | ||
136 | if (!ip->i_d.di_mode || ip->i_d.di_gen != generation) { | 136 | if (ip->i_d.di_gen != generation) { |
137 | xfs_iput_new(ip, XFS_ILOCK_SHARED); | 137 | xfs_iput_new(ip, XFS_ILOCK_SHARED); |
138 | return ERR_PTR(-ENOENT); | 138 | return ERR_PTR(-ENOENT); |
139 | } | 139 | } |
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c index 05905246434d..65e78c13d4ae 100644 --- a/fs/xfs/linux-2.6/xfs_file.c +++ b/fs/xfs/linux-2.6/xfs_file.c | |||
@@ -43,9 +43,6 @@ | |||
43 | #include <linux/smp_lock.h> | 43 | #include <linux/smp_lock.h> |
44 | 44 | ||
45 | static struct vm_operations_struct xfs_file_vm_ops; | 45 | static struct vm_operations_struct xfs_file_vm_ops; |
46 | #ifdef CONFIG_XFS_DMAPI | ||
47 | static struct vm_operations_struct xfs_dmapi_file_vm_ops; | ||
48 | #endif | ||
49 | 46 | ||
50 | STATIC_INLINE ssize_t | 47 | STATIC_INLINE ssize_t |
51 | __xfs_file_read( | 48 | __xfs_file_read( |
@@ -202,22 +199,6 @@ xfs_file_fsync( | |||
202 | (xfs_off_t)0, (xfs_off_t)-1); | 199 | (xfs_off_t)0, (xfs_off_t)-1); |
203 | } | 200 | } |
204 | 201 | ||
205 | #ifdef CONFIG_XFS_DMAPI | ||
206 | STATIC int | ||
207 | xfs_vm_fault( | ||
208 | struct vm_area_struct *vma, | ||
209 | struct vm_fault *vmf) | ||
210 | { | ||
211 | struct inode *inode = vma->vm_file->f_path.dentry->d_inode; | ||
212 | bhv_vnode_t *vp = vn_from_inode(inode); | ||
213 | |||
214 | ASSERT_ALWAYS(vp->v_vfsp->vfs_flag & VFS_DMI); | ||
215 | if (XFS_SEND_MMAP(XFS_VFSTOM(vp->v_vfsp), vma, 0)) | ||
216 | return VM_FAULT_SIGBUS; | ||
217 | return filemap_fault(vma, vmf); | ||
218 | } | ||
219 | #endif /* CONFIG_XFS_DMAPI */ | ||
220 | |||
221 | /* | 202 | /* |
222 | * Unfortunately we can't just use the clean and simple readdir implementation | 203 | * Unfortunately we can't just use the clean and simple readdir implementation |
223 | * below, because nfs might call back into ->lookup from the filldir callback | 204 | * below, because nfs might call back into ->lookup from the filldir callback |
@@ -386,11 +367,6 @@ xfs_file_mmap( | |||
386 | vma->vm_ops = &xfs_file_vm_ops; | 367 | vma->vm_ops = &xfs_file_vm_ops; |
387 | vma->vm_flags |= VM_CAN_NONLINEAR; | 368 | vma->vm_flags |= VM_CAN_NONLINEAR; |
388 | 369 | ||
389 | #ifdef CONFIG_XFS_DMAPI | ||
390 | if (XFS_M(filp->f_path.dentry->d_inode->i_sb)->m_flags & XFS_MOUNT_DMAPI) | ||
391 | vma->vm_ops = &xfs_dmapi_file_vm_ops; | ||
392 | #endif /* CONFIG_XFS_DMAPI */ | ||
393 | |||
394 | file_accessed(filp); | 370 | file_accessed(filp); |
395 | return 0; | 371 | return 0; |
396 | } | 372 | } |
@@ -437,47 +413,6 @@ xfs_file_ioctl_invis( | |||
437 | return error; | 413 | return error; |
438 | } | 414 | } |
439 | 415 | ||
440 | #ifdef CONFIG_XFS_DMAPI | ||
441 | #ifdef HAVE_VMOP_MPROTECT | ||
442 | STATIC int | ||
443 | xfs_vm_mprotect( | ||
444 | struct vm_area_struct *vma, | ||
445 | unsigned int newflags) | ||
446 | { | ||
447 | struct inode *inode = vma->vm_file->f_path.dentry->d_inode; | ||
448 | struct xfs_mount *mp = XFS_M(inode->i_sb); | ||
449 | int error = 0; | ||
450 | |||
451 | if (mp->m_flags & XFS_MOUNT_DMAPI) { | ||
452 | if ((vma->vm_flags & VM_MAYSHARE) && | ||
453 | (newflags & VM_WRITE) && !(vma->vm_flags & VM_WRITE)) | ||
454 | error = XFS_SEND_MMAP(mp, vma, VM_WRITE); | ||
455 | } | ||
456 | return error; | ||
457 | } | ||
458 | #endif /* HAVE_VMOP_MPROTECT */ | ||
459 | #endif /* CONFIG_XFS_DMAPI */ | ||
460 | |||
461 | #ifdef HAVE_FOP_OPEN_EXEC | ||
462 | /* If the user is attempting to execute a file that is offline then | ||
463 | * we have to trigger a DMAPI READ event before the file is marked as busy | ||
464 | * otherwise the invisible I/O will not be able to write to the file to bring | ||
465 | * it back online. | ||
466 | */ | ||
467 | STATIC int | ||
468 | xfs_file_open_exec( | ||
469 | struct inode *inode) | ||
470 | { | ||
471 | struct xfs_mount *mp = XFS_M(inode->i_sb); | ||
472 | struct xfs_inode *ip = XFS_I(inode); | ||
473 | |||
474 | if (unlikely(mp->m_flags & XFS_MOUNT_DMAPI) && | ||
475 | DM_EVENT_ENABLED(ip, DM_EVENT_READ)) | ||
476 | return -XFS_SEND_DATA(mp, DM_EVENT_READ, ip, 0, 0, 0, NULL); | ||
477 | return 0; | ||
478 | } | ||
479 | #endif /* HAVE_FOP_OPEN_EXEC */ | ||
480 | |||
481 | /* | 416 | /* |
482 | * mmap()d file has taken write protection fault and is being made | 417 | * mmap()d file has taken write protection fault and is being made |
483 | * writable. We can set the page state up correctly for a writable | 418 | * writable. We can set the page state up correctly for a writable |
@@ -546,13 +481,3 @@ static struct vm_operations_struct xfs_file_vm_ops = { | |||
546 | .fault = filemap_fault, | 481 | .fault = filemap_fault, |
547 | .page_mkwrite = xfs_vm_page_mkwrite, | 482 | .page_mkwrite = xfs_vm_page_mkwrite, |
548 | }; | 483 | }; |
549 | |||
550 | #ifdef CONFIG_XFS_DMAPI | ||
551 | static struct vm_operations_struct xfs_dmapi_file_vm_ops = { | ||
552 | .fault = xfs_vm_fault, | ||
553 | .page_mkwrite = xfs_vm_page_mkwrite, | ||
554 | #ifdef HAVE_VMOP_MPROTECT | ||
555 | .mprotect = xfs_vm_mprotect, | ||
556 | #endif | ||
557 | }; | ||
558 | #endif /* CONFIG_XFS_DMAPI */ | ||
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c index 4ddb86b73c6b..a42ba9d71156 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.c +++ b/fs/xfs/linux-2.6/xfs_ioctl.c | |||
@@ -238,7 +238,7 @@ xfs_vget_fsop_handlereq( | |||
238 | return error; | 238 | return error; |
239 | if (ip == NULL) | 239 | if (ip == NULL) |
240 | return XFS_ERROR(EIO); | 240 | return XFS_ERROR(EIO); |
241 | if (ip->i_d.di_mode == 0 || ip->i_d.di_gen != igen) { | 241 | if (ip->i_d.di_gen != igen) { |
242 | xfs_iput_new(ip, XFS_ILOCK_SHARED); | 242 | xfs_iput_new(ip, XFS_ILOCK_SHARED); |
243 | return XFS_ERROR(ENOENT); | 243 | return XFS_ERROR(ENOENT); |
244 | } | 244 | } |
@@ -505,14 +505,14 @@ xfs_attrmulti_attr_get( | |||
505 | { | 505 | { |
506 | char *kbuf; | 506 | char *kbuf; |
507 | int error = EFAULT; | 507 | int error = EFAULT; |
508 | 508 | ||
509 | if (*len > XATTR_SIZE_MAX) | 509 | if (*len > XATTR_SIZE_MAX) |
510 | return EINVAL; | 510 | return EINVAL; |
511 | kbuf = kmalloc(*len, GFP_KERNEL); | 511 | kbuf = kmalloc(*len, GFP_KERNEL); |
512 | if (!kbuf) | 512 | if (!kbuf) |
513 | return ENOMEM; | 513 | return ENOMEM; |
514 | 514 | ||
515 | error = xfs_attr_get(XFS_I(inode), name, kbuf, (int *)len, flags, NULL); | 515 | error = xfs_attr_get(XFS_I(inode), name, kbuf, (int *)len, flags); |
516 | if (error) | 516 | if (error) |
517 | goto out_kfree; | 517 | goto out_kfree; |
518 | 518 | ||
@@ -546,7 +546,7 @@ xfs_attrmulti_attr_set( | |||
546 | 546 | ||
547 | if (copy_from_user(kbuf, ubuf, len)) | 547 | if (copy_from_user(kbuf, ubuf, len)) |
548 | goto out_kfree; | 548 | goto out_kfree; |
549 | 549 | ||
550 | error = xfs_attr_set(XFS_I(inode), name, kbuf, len, flags); | 550 | error = xfs_attr_set(XFS_I(inode), name, kbuf, len, flags); |
551 | 551 | ||
552 | out_kfree: | 552 | out_kfree: |
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index a1237dad6430..2bf287ef5489 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -511,7 +511,8 @@ xfs_vn_rename( | |||
511 | xfs_dentry_to_name(&nname, ndentry); | 511 | xfs_dentry_to_name(&nname, ndentry); |
512 | 512 | ||
513 | error = xfs_rename(XFS_I(odir), &oname, XFS_I(odentry->d_inode), | 513 | error = xfs_rename(XFS_I(odir), &oname, XFS_I(odentry->d_inode), |
514 | XFS_I(ndir), &nname); | 514 | XFS_I(ndir), &nname, new_inode ? |
515 | XFS_I(new_inode) : NULL); | ||
515 | if (likely(!error)) { | 516 | if (likely(!error)) { |
516 | if (new_inode) | 517 | if (new_inode) |
517 | xfs_validate_fields(new_inode); | 518 | xfs_validate_fields(new_inode); |
diff --git a/fs/xfs/linux-2.6/xfs_linux.h b/fs/xfs/linux-2.6/xfs_linux.h index e5143323e71f..4edc46915b57 100644 --- a/fs/xfs/linux-2.6/xfs_linux.h +++ b/fs/xfs/linux-2.6/xfs_linux.h | |||
@@ -75,6 +75,7 @@ | |||
75 | #include <linux/delay.h> | 75 | #include <linux/delay.h> |
76 | #include <linux/log2.h> | 76 | #include <linux/log2.h> |
77 | #include <linux/spinlock.h> | 77 | #include <linux/spinlock.h> |
78 | #include <linux/random.h> | ||
78 | 79 | ||
79 | #include <asm/page.h> | 80 | #include <asm/page.h> |
80 | #include <asm/div64.h> | 81 | #include <asm/div64.h> |
@@ -99,7 +100,6 @@ | |||
99 | /* | 100 | /* |
100 | * Feature macros (disable/enable) | 101 | * Feature macros (disable/enable) |
101 | */ | 102 | */ |
102 | #define HAVE_SPLICE /* a splice(2) exists in 2.6, but not in 2.4 */ | ||
103 | #ifdef CONFIG_SMP | 103 | #ifdef CONFIG_SMP |
104 | #define HAVE_PERCPU_SB /* per cpu superblock counters are a 2.6 feature */ | 104 | #define HAVE_PERCPU_SB /* per cpu superblock counters are a 2.6 feature */ |
105 | #else | 105 | #else |
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 1ebd8004469c..5e3b57516ec7 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c | |||
@@ -394,7 +394,7 @@ xfs_zero_last_block( | |||
394 | int error = 0; | 394 | int error = 0; |
395 | xfs_bmbt_irec_t imap; | 395 | xfs_bmbt_irec_t imap; |
396 | 396 | ||
397 | ASSERT(ismrlocked(&ip->i_lock, MR_UPDATE) != 0); | 397 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); |
398 | 398 | ||
399 | zero_offset = XFS_B_FSB_OFFSET(mp, isize); | 399 | zero_offset = XFS_B_FSB_OFFSET(mp, isize); |
400 | if (zero_offset == 0) { | 400 | if (zero_offset == 0) { |
@@ -425,14 +425,14 @@ xfs_zero_last_block( | |||
425 | * out sync. We need to drop the ilock while we do this so we | 425 | * out sync. We need to drop the ilock while we do this so we |
426 | * don't deadlock when the buffer cache calls back to us. | 426 | * don't deadlock when the buffer cache calls back to us. |
427 | */ | 427 | */ |
428 | xfs_iunlock(ip, XFS_ILOCK_EXCL| XFS_EXTSIZE_RD); | 428 | xfs_iunlock(ip, XFS_ILOCK_EXCL); |
429 | 429 | ||
430 | zero_len = mp->m_sb.sb_blocksize - zero_offset; | 430 | zero_len = mp->m_sb.sb_blocksize - zero_offset; |
431 | if (isize + zero_len > offset) | 431 | if (isize + zero_len > offset) |
432 | zero_len = offset - isize; | 432 | zero_len = offset - isize; |
433 | error = xfs_iozero(ip, isize, zero_len); | 433 | error = xfs_iozero(ip, isize, zero_len); |
434 | 434 | ||
435 | xfs_ilock(ip, XFS_ILOCK_EXCL|XFS_EXTSIZE_RD); | 435 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
436 | ASSERT(error >= 0); | 436 | ASSERT(error >= 0); |
437 | return error; | 437 | return error; |
438 | } | 438 | } |
@@ -465,8 +465,7 @@ xfs_zero_eof( | |||
465 | int error = 0; | 465 | int error = 0; |
466 | xfs_bmbt_irec_t imap; | 466 | xfs_bmbt_irec_t imap; |
467 | 467 | ||
468 | ASSERT(ismrlocked(&ip->i_lock, MR_UPDATE)); | 468 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_IOLOCK_EXCL)); |
469 | ASSERT(ismrlocked(&ip->i_iolock, MR_UPDATE)); | ||
470 | ASSERT(offset > isize); | 469 | ASSERT(offset > isize); |
471 | 470 | ||
472 | /* | 471 | /* |
@@ -475,8 +474,7 @@ xfs_zero_eof( | |||
475 | */ | 474 | */ |
476 | error = xfs_zero_last_block(ip, offset, isize); | 475 | error = xfs_zero_last_block(ip, offset, isize); |
477 | if (error) { | 476 | if (error) { |
478 | ASSERT(ismrlocked(&ip->i_lock, MR_UPDATE)); | 477 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_IOLOCK_EXCL)); |
479 | ASSERT(ismrlocked(&ip->i_iolock, MR_UPDATE)); | ||
480 | return error; | 478 | return error; |
481 | } | 479 | } |
482 | 480 | ||
@@ -507,8 +505,7 @@ xfs_zero_eof( | |||
507 | error = xfs_bmapi(NULL, ip, start_zero_fsb, zero_count_fsb, | 505 | error = xfs_bmapi(NULL, ip, start_zero_fsb, zero_count_fsb, |
508 | 0, NULL, 0, &imap, &nimaps, NULL, NULL); | 506 | 0, NULL, 0, &imap, &nimaps, NULL, NULL); |
509 | if (error) { | 507 | if (error) { |
510 | ASSERT(ismrlocked(&ip->i_lock, MR_UPDATE)); | 508 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_IOLOCK_EXCL)); |
511 | ASSERT(ismrlocked(&ip->i_iolock, MR_UPDATE)); | ||
512 | return error; | 509 | return error; |
513 | } | 510 | } |
514 | ASSERT(nimaps > 0); | 511 | ASSERT(nimaps > 0); |
@@ -532,7 +529,7 @@ xfs_zero_eof( | |||
532 | * Drop the inode lock while we're doing the I/O. | 529 | * Drop the inode lock while we're doing the I/O. |
533 | * We'll still have the iolock to protect us. | 530 | * We'll still have the iolock to protect us. |
534 | */ | 531 | */ |
535 | xfs_iunlock(ip, XFS_ILOCK_EXCL|XFS_EXTSIZE_RD); | 532 | xfs_iunlock(ip, XFS_ILOCK_EXCL); |
536 | 533 | ||
537 | zero_off = XFS_FSB_TO_B(mp, start_zero_fsb); | 534 | zero_off = XFS_FSB_TO_B(mp, start_zero_fsb); |
538 | zero_len = XFS_FSB_TO_B(mp, imap.br_blockcount); | 535 | zero_len = XFS_FSB_TO_B(mp, imap.br_blockcount); |
@@ -548,13 +545,13 @@ xfs_zero_eof( | |||
548 | start_zero_fsb = imap.br_startoff + imap.br_blockcount; | 545 | start_zero_fsb = imap.br_startoff + imap.br_blockcount; |
549 | ASSERT(start_zero_fsb <= (end_zero_fsb + 1)); | 546 | ASSERT(start_zero_fsb <= (end_zero_fsb + 1)); |
550 | 547 | ||
551 | xfs_ilock(ip, XFS_ILOCK_EXCL|XFS_EXTSIZE_RD); | 548 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
552 | } | 549 | } |
553 | 550 | ||
554 | return 0; | 551 | return 0; |
555 | 552 | ||
556 | out_lock: | 553 | out_lock: |
557 | xfs_ilock(ip, XFS_ILOCK_EXCL|XFS_EXTSIZE_RD); | 554 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
558 | ASSERT(error >= 0); | 555 | ASSERT(error >= 0); |
559 | return error; | 556 | return error; |
560 | } | 557 | } |
diff --git a/fs/xfs/linux-2.6/xfs_lrw.h b/fs/xfs/linux-2.6/xfs_lrw.h index e1d498b4ba7a..e6be37dbd0e9 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.h +++ b/fs/xfs/linux-2.6/xfs_lrw.h | |||
@@ -50,7 +50,6 @@ struct xfs_iomap; | |||
50 | #define XFS_INVAL_CACHED 18 | 50 | #define XFS_INVAL_CACHED 18 |
51 | #define XFS_DIORD_ENTER 19 | 51 | #define XFS_DIORD_ENTER 19 |
52 | #define XFS_DIOWR_ENTER 20 | 52 | #define XFS_DIOWR_ENTER 20 |
53 | #define XFS_SENDFILE_ENTER 21 | ||
54 | #define XFS_WRITEPAGE_ENTER 22 | 53 | #define XFS_WRITEPAGE_ENTER 22 |
55 | #define XFS_RELEASEPAGE_ENTER 23 | 54 | #define XFS_RELEASEPAGE_ENTER 23 |
56 | #define XFS_INVALIDPAGE_ENTER 24 | 55 | #define XFS_INVALIDPAGE_ENTER 24 |
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 865eb708aa95..742b2c7852c1 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -1181,7 +1181,7 @@ xfs_fs_statfs( | |||
1181 | statp->f_fsid.val[0] = (u32)id; | 1181 | statp->f_fsid.val[0] = (u32)id; |
1182 | statp->f_fsid.val[1] = (u32)(id >> 32); | 1182 | statp->f_fsid.val[1] = (u32)(id >> 32); |
1183 | 1183 | ||
1184 | xfs_icsb_sync_counters_flags(mp, XFS_ICSB_LAZY_COUNT); | 1184 | xfs_icsb_sync_counters(mp, XFS_ICSB_LAZY_COUNT); |
1185 | 1185 | ||
1186 | spin_lock(&mp->m_sb_lock); | 1186 | spin_lock(&mp->m_sb_lock); |
1187 | statp->f_bsize = sbp->sb_blocksize; | 1187 | statp->f_bsize = sbp->sb_blocksize; |
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h index 8b4d63ce8694..9d73cb5c0fc7 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.h +++ b/fs/xfs/linux-2.6/xfs_vnode.h | |||
@@ -25,12 +25,6 @@ struct attrlist_cursor_kern; | |||
25 | 25 | ||
26 | typedef struct inode bhv_vnode_t; | 26 | typedef struct inode bhv_vnode_t; |
27 | 27 | ||
28 | #define VN_ISLNK(vp) S_ISLNK((vp)->i_mode) | ||
29 | #define VN_ISREG(vp) S_ISREG((vp)->i_mode) | ||
30 | #define VN_ISDIR(vp) S_ISDIR((vp)->i_mode) | ||
31 | #define VN_ISCHR(vp) S_ISCHR((vp)->i_mode) | ||
32 | #define VN_ISBLK(vp) S_ISBLK((vp)->i_mode) | ||
33 | |||
34 | /* | 28 | /* |
35 | * Vnode to Linux inode mapping. | 29 | * Vnode to Linux inode mapping. |
36 | */ | 30 | */ |
@@ -151,24 +145,6 @@ typedef struct bhv_vattr { | |||
151 | XFS_AT_TYPE|XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|\ | 145 | XFS_AT_TYPE|XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|\ |
152 | XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_GENCOUNT) | 146 | XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_GENCOUNT) |
153 | 147 | ||
154 | /* | ||
155 | * Modes. | ||
156 | */ | ||
157 | #define VSUID S_ISUID /* set user id on execution */ | ||
158 | #define VSGID S_ISGID /* set group id on execution */ | ||
159 | #define VSVTX S_ISVTX /* save swapped text even after use */ | ||
160 | #define VREAD S_IRUSR /* read, write, execute permissions */ | ||
161 | #define VWRITE S_IWUSR | ||
162 | #define VEXEC S_IXUSR | ||
163 | |||
164 | #define MODEMASK S_IALLUGO /* mode bits plus permission bits */ | ||
165 | |||
166 | /* | ||
167 | * Check whether mandatory file locking is enabled. | ||
168 | */ | ||
169 | #define MANDLOCK(vp, mode) \ | ||
170 | (VN_ISREG(vp) && ((mode) & (VSGID|(VEXEC>>3))) == VSGID) | ||
171 | |||
172 | extern void vn_init(void); | 148 | extern void vn_init(void); |
173 | extern int vn_revalidate(bhv_vnode_t *); | 149 | extern int vn_revalidate(bhv_vnode_t *); |
174 | 150 | ||