diff options
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_aops.c | 4 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 157 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.h | 1 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_file.c | 34 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl.c | 11 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl32.c | 29 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl32.h | 6 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_linux.h | 12 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.c | 34 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.h | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 17 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vfs.h | 1 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vnode.c | 4 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vnode.h | 2 |
14 files changed, 169 insertions, 145 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index 9278e9aba9ba..a3a4b5aaf5d9 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c | |||
@@ -149,11 +149,12 @@ linvfs_unwritten_convert( | |||
149 | */ | 149 | */ |
150 | STATIC void | 150 | STATIC void |
151 | linvfs_unwritten_convert_direct( | 151 | linvfs_unwritten_convert_direct( |
152 | struct inode *inode, | 152 | struct kiocb *iocb, |
153 | loff_t offset, | 153 | loff_t offset, |
154 | ssize_t size, | 154 | ssize_t size, |
155 | void *private) | 155 | void *private) |
156 | { | 156 | { |
157 | struct inode *inode = iocb->ki_filp->f_dentry->d_inode; | ||
157 | ASSERT(!private || inode == (struct inode *)private); | 158 | ASSERT(!private || inode == (struct inode *)private); |
158 | 159 | ||
159 | /* private indicates an unwritten extent lay beneath this IO */ | 160 | /* private indicates an unwritten extent lay beneath this IO */ |
@@ -886,7 +887,6 @@ xfs_page_state_convert( | |||
886 | SetPageUptodate(page); | 887 | SetPageUptodate(page); |
887 | 888 | ||
888 | if (startio) { | 889 | if (startio) { |
889 | WARN_ON(page_dirty); | ||
890 | xfs_submit_page(page, wbc, bh_arr, cnt, 0, !page_dirty); | 890 | xfs_submit_page(page, wbc, bh_arr, cnt, 0, !page_dirty); |
891 | } | 891 | } |
892 | 892 | ||
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index 997963e53622..df0cba239dd5 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -61,12 +61,13 @@ | |||
61 | * File wide globals | 61 | * File wide globals |
62 | */ | 62 | */ |
63 | 63 | ||
64 | STATIC kmem_cache_t *pagebuf_cache; | 64 | STATIC kmem_cache_t *pagebuf_zone; |
65 | STATIC kmem_shaker_t pagebuf_shake; | 65 | STATIC kmem_shaker_t pagebuf_shake; |
66 | STATIC int pagebuf_daemon_wakeup(int, unsigned int); | 66 | STATIC int xfsbufd_wakeup(int, unsigned int); |
67 | STATIC void pagebuf_delwri_queue(xfs_buf_t *, int); | 67 | STATIC void pagebuf_delwri_queue(xfs_buf_t *, int); |
68 | STATIC struct workqueue_struct *pagebuf_logio_workqueue; | 68 | |
69 | STATIC struct workqueue_struct *pagebuf_dataio_workqueue; | 69 | STATIC struct workqueue_struct *xfslogd_workqueue; |
70 | STATIC struct workqueue_struct *xfsdatad_workqueue; | ||
70 | 71 | ||
71 | /* | 72 | /* |
72 | * Pagebuf debugging | 73 | * Pagebuf debugging |
@@ -123,9 +124,9 @@ ktrace_t *pagebuf_trace_buf; | |||
123 | 124 | ||
124 | 125 | ||
125 | #define pagebuf_allocate(flags) \ | 126 | #define pagebuf_allocate(flags) \ |
126 | kmem_zone_alloc(pagebuf_cache, pb_to_km(flags)) | 127 | kmem_zone_alloc(pagebuf_zone, pb_to_km(flags)) |
127 | #define pagebuf_deallocate(pb) \ | 128 | #define pagebuf_deallocate(pb) \ |
128 | kmem_zone_free(pagebuf_cache, (pb)); | 129 | kmem_zone_free(pagebuf_zone, (pb)); |
129 | 130 | ||
130 | /* | 131 | /* |
131 | * Page Region interfaces. | 132 | * Page Region interfaces. |
@@ -425,7 +426,7 @@ _pagebuf_lookup_pages( | |||
425 | __FUNCTION__, gfp_mask); | 426 | __FUNCTION__, gfp_mask); |
426 | 427 | ||
427 | XFS_STATS_INC(pb_page_retries); | 428 | XFS_STATS_INC(pb_page_retries); |
428 | pagebuf_daemon_wakeup(0, gfp_mask); | 429 | xfsbufd_wakeup(0, gfp_mask); |
429 | blk_congestion_wait(WRITE, HZ/50); | 430 | blk_congestion_wait(WRITE, HZ/50); |
430 | goto retry; | 431 | goto retry; |
431 | } | 432 | } |
@@ -1136,8 +1137,8 @@ pagebuf_iodone( | |||
1136 | if ((pb->pb_iodone) || (pb->pb_flags & PBF_ASYNC)) { | 1137 | if ((pb->pb_iodone) || (pb->pb_flags & PBF_ASYNC)) { |
1137 | if (schedule) { | 1138 | if (schedule) { |
1138 | INIT_WORK(&pb->pb_iodone_work, pagebuf_iodone_work, pb); | 1139 | INIT_WORK(&pb->pb_iodone_work, pagebuf_iodone_work, pb); |
1139 | queue_work(dataio ? pagebuf_dataio_workqueue : | 1140 | queue_work(dataio ? xfsdatad_workqueue : |
1140 | pagebuf_logio_workqueue, &pb->pb_iodone_work); | 1141 | xfslogd_workqueue, &pb->pb_iodone_work); |
1141 | } else { | 1142 | } else { |
1142 | pagebuf_iodone_work(pb); | 1143 | pagebuf_iodone_work(pb); |
1143 | } | 1144 | } |
@@ -1562,16 +1563,6 @@ xfs_free_buftarg( | |||
1562 | kmem_free(btp, sizeof(*btp)); | 1563 | kmem_free(btp, sizeof(*btp)); |
1563 | } | 1564 | } |
1564 | 1565 | ||
1565 | void | ||
1566 | xfs_incore_relse( | ||
1567 | xfs_buftarg_t *btp, | ||
1568 | int delwri_only, | ||
1569 | int wait) | ||
1570 | { | ||
1571 | invalidate_bdev(btp->pbr_bdev, 1); | ||
1572 | truncate_inode_pages(btp->pbr_mapping, 0LL); | ||
1573 | } | ||
1574 | |||
1575 | STATIC int | 1566 | STATIC int |
1576 | xfs_setsize_buftarg_flags( | 1567 | xfs_setsize_buftarg_flags( |
1577 | xfs_buftarg_t *btp, | 1568 | xfs_buftarg_t *btp, |
@@ -1742,27 +1733,27 @@ pagebuf_runall_queues( | |||
1742 | } | 1733 | } |
1743 | 1734 | ||
1744 | /* Defines for pagebuf daemon */ | 1735 | /* Defines for pagebuf daemon */ |
1745 | STATIC DECLARE_COMPLETION(pagebuf_daemon_done); | 1736 | STATIC DECLARE_COMPLETION(xfsbufd_done); |
1746 | STATIC struct task_struct *pagebuf_daemon_task; | 1737 | STATIC struct task_struct *xfsbufd_task; |
1747 | STATIC int pagebuf_daemon_active; | 1738 | STATIC int xfsbufd_active; |
1748 | STATIC int force_flush; | 1739 | STATIC int xfsbufd_force_flush; |
1749 | STATIC int force_sleep; | 1740 | STATIC int xfsbufd_force_sleep; |
1750 | 1741 | ||
1751 | STATIC int | 1742 | STATIC int |
1752 | pagebuf_daemon_wakeup( | 1743 | xfsbufd_wakeup( |
1753 | int priority, | 1744 | int priority, |
1754 | unsigned int mask) | 1745 | unsigned int mask) |
1755 | { | 1746 | { |
1756 | if (force_sleep) | 1747 | if (xfsbufd_force_sleep) |
1757 | return 0; | 1748 | return 0; |
1758 | force_flush = 1; | 1749 | xfsbufd_force_flush = 1; |
1759 | barrier(); | 1750 | barrier(); |
1760 | wake_up_process(pagebuf_daemon_task); | 1751 | wake_up_process(xfsbufd_task); |
1761 | return 0; | 1752 | return 0; |
1762 | } | 1753 | } |
1763 | 1754 | ||
1764 | STATIC int | 1755 | STATIC int |
1765 | pagebuf_daemon( | 1756 | xfsbufd( |
1766 | void *data) | 1757 | void *data) |
1767 | { | 1758 | { |
1768 | struct list_head tmp; | 1759 | struct list_head tmp; |
@@ -1774,17 +1765,17 @@ pagebuf_daemon( | |||
1774 | daemonize("xfsbufd"); | 1765 | daemonize("xfsbufd"); |
1775 | current->flags |= PF_MEMALLOC; | 1766 | current->flags |= PF_MEMALLOC; |
1776 | 1767 | ||
1777 | pagebuf_daemon_task = current; | 1768 | xfsbufd_task = current; |
1778 | pagebuf_daemon_active = 1; | 1769 | xfsbufd_active = 1; |
1779 | barrier(); | 1770 | barrier(); |
1780 | 1771 | ||
1781 | INIT_LIST_HEAD(&tmp); | 1772 | INIT_LIST_HEAD(&tmp); |
1782 | do { | 1773 | do { |
1783 | if (unlikely(current->flags & PF_FREEZE)) { | 1774 | if (unlikely(freezing(current))) { |
1784 | force_sleep = 1; | 1775 | xfsbufd_force_sleep = 1; |
1785 | refrigerator(PF_FREEZE); | 1776 | refrigerator(); |
1786 | } else { | 1777 | } else { |
1787 | force_sleep = 0; | 1778 | xfsbufd_force_sleep = 0; |
1788 | } | 1779 | } |
1789 | 1780 | ||
1790 | set_current_state(TASK_INTERRUPTIBLE); | 1781 | set_current_state(TASK_INTERRUPTIBLE); |
@@ -1797,7 +1788,7 @@ pagebuf_daemon( | |||
1797 | ASSERT(pb->pb_flags & PBF_DELWRI); | 1788 | ASSERT(pb->pb_flags & PBF_DELWRI); |
1798 | 1789 | ||
1799 | if (!pagebuf_ispin(pb) && !pagebuf_cond_lock(pb)) { | 1790 | if (!pagebuf_ispin(pb) && !pagebuf_cond_lock(pb)) { |
1800 | if (!force_flush && | 1791 | if (!xfsbufd_force_flush && |
1801 | time_before(jiffies, | 1792 | time_before(jiffies, |
1802 | pb->pb_queuetime + age)) { | 1793 | pb->pb_queuetime + age)) { |
1803 | pagebuf_unlock(pb); | 1794 | pagebuf_unlock(pb); |
@@ -1824,10 +1815,10 @@ pagebuf_daemon( | |||
1824 | if (as_list_len > 0) | 1815 | if (as_list_len > 0) |
1825 | purge_addresses(); | 1816 | purge_addresses(); |
1826 | 1817 | ||
1827 | force_flush = 0; | 1818 | xfsbufd_force_flush = 0; |
1828 | } while (pagebuf_daemon_active); | 1819 | } while (xfsbufd_active); |
1829 | 1820 | ||
1830 | complete_and_exit(&pagebuf_daemon_done, 0); | 1821 | complete_and_exit(&xfsbufd_done, 0); |
1831 | } | 1822 | } |
1832 | 1823 | ||
1833 | /* | 1824 | /* |
@@ -1844,8 +1835,8 @@ xfs_flush_buftarg( | |||
1844 | xfs_buf_t *pb, *n; | 1835 | xfs_buf_t *pb, *n; |
1845 | int pincount = 0; | 1836 | int pincount = 0; |
1846 | 1837 | ||
1847 | pagebuf_runall_queues(pagebuf_dataio_workqueue); | 1838 | pagebuf_runall_queues(xfsdatad_workqueue); |
1848 | pagebuf_runall_queues(pagebuf_logio_workqueue); | 1839 | pagebuf_runall_queues(xfslogd_workqueue); |
1849 | 1840 | ||
1850 | INIT_LIST_HEAD(&tmp); | 1841 | INIT_LIST_HEAD(&tmp); |
1851 | spin_lock(&pbd_delwrite_lock); | 1842 | spin_lock(&pbd_delwrite_lock); |
@@ -1898,43 +1889,43 @@ xfs_flush_buftarg( | |||
1898 | } | 1889 | } |
1899 | 1890 | ||
1900 | STATIC int | 1891 | STATIC int |
1901 | pagebuf_daemon_start(void) | 1892 | xfs_buf_daemons_start(void) |
1902 | { | 1893 | { |
1903 | int rval; | 1894 | int error = -ENOMEM; |
1904 | 1895 | ||
1905 | pagebuf_logio_workqueue = create_workqueue("xfslogd"); | 1896 | xfslogd_workqueue = create_workqueue("xfslogd"); |
1906 | if (!pagebuf_logio_workqueue) | 1897 | if (!xfslogd_workqueue) |
1907 | return -ENOMEM; | 1898 | goto out; |
1908 | 1899 | ||
1909 | pagebuf_dataio_workqueue = create_workqueue("xfsdatad"); | 1900 | xfsdatad_workqueue = create_workqueue("xfsdatad"); |
1910 | if (!pagebuf_dataio_workqueue) { | 1901 | if (!xfsdatad_workqueue) |
1911 | destroy_workqueue(pagebuf_logio_workqueue); | 1902 | goto out_destroy_xfslogd_workqueue; |
1912 | return -ENOMEM; | ||
1913 | } | ||
1914 | 1903 | ||
1915 | rval = kernel_thread(pagebuf_daemon, NULL, CLONE_FS|CLONE_FILES); | 1904 | error = kernel_thread(xfsbufd, NULL, CLONE_FS|CLONE_FILES); |
1916 | if (rval < 0) { | 1905 | if (error < 0) |
1917 | destroy_workqueue(pagebuf_logio_workqueue); | 1906 | goto out_destroy_xfsdatad_workqueue; |
1918 | destroy_workqueue(pagebuf_dataio_workqueue); | 1907 | return 0; |
1919 | } | ||
1920 | 1908 | ||
1921 | return rval; | 1909 | out_destroy_xfsdatad_workqueue: |
1910 | destroy_workqueue(xfsdatad_workqueue); | ||
1911 | out_destroy_xfslogd_workqueue: | ||
1912 | destroy_workqueue(xfslogd_workqueue); | ||
1913 | out: | ||
1914 | return error; | ||
1922 | } | 1915 | } |
1923 | 1916 | ||
1924 | /* | 1917 | /* |
1925 | * pagebuf_daemon_stop | ||
1926 | * | ||
1927 | * Note: do not mark as __exit, it is called from pagebuf_terminate. | 1918 | * Note: do not mark as __exit, it is called from pagebuf_terminate. |
1928 | */ | 1919 | */ |
1929 | STATIC void | 1920 | STATIC void |
1930 | pagebuf_daemon_stop(void) | 1921 | xfs_buf_daemons_stop(void) |
1931 | { | 1922 | { |
1932 | pagebuf_daemon_active = 0; | 1923 | xfsbufd_active = 0; |
1933 | barrier(); | 1924 | barrier(); |
1934 | wait_for_completion(&pagebuf_daemon_done); | 1925 | wait_for_completion(&xfsbufd_done); |
1935 | 1926 | ||
1936 | destroy_workqueue(pagebuf_logio_workqueue); | 1927 | destroy_workqueue(xfslogd_workqueue); |
1937 | destroy_workqueue(pagebuf_dataio_workqueue); | 1928 | destroy_workqueue(xfsdatad_workqueue); |
1938 | } | 1929 | } |
1939 | 1930 | ||
1940 | /* | 1931 | /* |
@@ -1944,27 +1935,37 @@ pagebuf_daemon_stop(void) | |||
1944 | int __init | 1935 | int __init |
1945 | pagebuf_init(void) | 1936 | pagebuf_init(void) |
1946 | { | 1937 | { |
1947 | pagebuf_cache = kmem_cache_create("xfs_buf_t", sizeof(xfs_buf_t), 0, | 1938 | int error = -ENOMEM; |
1948 | SLAB_HWCACHE_ALIGN, NULL, NULL); | 1939 | |
1949 | if (pagebuf_cache == NULL) { | 1940 | pagebuf_zone = kmem_zone_init(sizeof(xfs_buf_t), "xfs_buf"); |
1950 | printk("XFS: couldn't init xfs_buf_t cache\n"); | 1941 | if (!pagebuf_zone) |
1951 | pagebuf_terminate(); | 1942 | goto out; |
1952 | return -ENOMEM; | ||
1953 | } | ||
1954 | 1943 | ||
1955 | #ifdef PAGEBUF_TRACE | 1944 | #ifdef PAGEBUF_TRACE |
1956 | pagebuf_trace_buf = ktrace_alloc(PAGEBUF_TRACE_SIZE, KM_SLEEP); | 1945 | pagebuf_trace_buf = ktrace_alloc(PAGEBUF_TRACE_SIZE, KM_SLEEP); |
1957 | #endif | 1946 | #endif |
1958 | 1947 | ||
1959 | pagebuf_daemon_start(); | 1948 | error = xfs_buf_daemons_start(); |
1949 | if (error) | ||
1950 | goto out_free_buf_zone; | ||
1960 | 1951 | ||
1961 | pagebuf_shake = kmem_shake_register(pagebuf_daemon_wakeup); | 1952 | pagebuf_shake = kmem_shake_register(xfsbufd_wakeup); |
1962 | if (pagebuf_shake == NULL) { | 1953 | if (!pagebuf_shake) { |
1963 | pagebuf_terminate(); | 1954 | error = -ENOMEM; |
1964 | return -ENOMEM; | 1955 | goto out_stop_daemons; |
1965 | } | 1956 | } |
1966 | 1957 | ||
1967 | return 0; | 1958 | return 0; |
1959 | |||
1960 | out_stop_daemons: | ||
1961 | xfs_buf_daemons_stop(); | ||
1962 | out_free_buf_zone: | ||
1963 | #ifdef PAGEBUF_TRACE | ||
1964 | ktrace_free(pagebuf_trace_buf); | ||
1965 | #endif | ||
1966 | kmem_zone_destroy(pagebuf_zone); | ||
1967 | out: | ||
1968 | return error; | ||
1968 | } | 1969 | } |
1969 | 1970 | ||
1970 | 1971 | ||
@@ -1976,12 +1977,12 @@ pagebuf_init(void) | |||
1976 | void | 1977 | void |
1977 | pagebuf_terminate(void) | 1978 | pagebuf_terminate(void) |
1978 | { | 1979 | { |
1979 | pagebuf_daemon_stop(); | 1980 | xfs_buf_daemons_stop(); |
1980 | 1981 | ||
1981 | #ifdef PAGEBUF_TRACE | 1982 | #ifdef PAGEBUF_TRACE |
1982 | ktrace_free(pagebuf_trace_buf); | 1983 | ktrace_free(pagebuf_trace_buf); |
1983 | #endif | 1984 | #endif |
1984 | 1985 | ||
1985 | kmem_zone_destroy(pagebuf_cache); | 1986 | kmem_zone_destroy(pagebuf_zone); |
1986 | kmem_shake_deregister(pagebuf_shake); | 1987 | kmem_shake_deregister(pagebuf_shake); |
1987 | } | 1988 | } |
diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h index 74deed8e6d90..3f8f69a66aea 100644 --- a/fs/xfs/linux-2.6/xfs_buf.h +++ b/fs/xfs/linux-2.6/xfs_buf.h | |||
@@ -576,7 +576,6 @@ extern xfs_buftarg_t *xfs_alloc_buftarg(struct block_device *, int); | |||
576 | extern void xfs_free_buftarg(xfs_buftarg_t *, int); | 576 | extern void xfs_free_buftarg(xfs_buftarg_t *, int); |
577 | extern void xfs_wait_buftarg(xfs_buftarg_t *); | 577 | extern void xfs_wait_buftarg(xfs_buftarg_t *); |
578 | extern int xfs_setsize_buftarg(xfs_buftarg_t *, unsigned int, unsigned int); | 578 | extern int xfs_setsize_buftarg(xfs_buftarg_t *, unsigned int, unsigned int); |
579 | extern void xfs_incore_relse(xfs_buftarg_t *, int, int); | ||
580 | extern int xfs_flush_buftarg(xfs_buftarg_t *, int); | 579 | extern int xfs_flush_buftarg(xfs_buftarg_t *, int); |
581 | 580 | ||
582 | #define xfs_getsize_buftarg(buftarg) \ | 581 | #define xfs_getsize_buftarg(buftarg) \ |
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c index d0d412afd261..f1ce4323f56e 100644 --- a/fs/xfs/linux-2.6/xfs_file.c +++ b/fs/xfs/linux-2.6/xfs_file.c | |||
@@ -57,7 +57,9 @@ | |||
57 | #include <linux/smp_lock.h> | 57 | #include <linux/smp_lock.h> |
58 | 58 | ||
59 | static struct vm_operations_struct linvfs_file_vm_ops; | 59 | static struct vm_operations_struct linvfs_file_vm_ops; |
60 | 60 | #ifdef CONFIG_XFS_DMAPI | |
61 | static struct vm_operations_struct linvfs_dmapi_file_vm_ops; | ||
62 | #endif | ||
61 | 63 | ||
62 | STATIC inline ssize_t | 64 | STATIC inline ssize_t |
63 | __linvfs_read( | 65 | __linvfs_read( |
@@ -388,6 +390,14 @@ done: | |||
388 | return -error; | 390 | return -error; |
389 | } | 391 | } |
390 | 392 | ||
393 | #ifdef CONFIG_XFS_DMAPI | ||
394 | STATIC void | ||
395 | linvfs_mmap_close( | ||
396 | struct vm_area_struct *vma) | ||
397 | { | ||
398 | xfs_dm_mm_put(vma); | ||
399 | } | ||
400 | #endif /* CONFIG_XFS_DMAPI */ | ||
391 | 401 | ||
392 | STATIC int | 402 | STATIC int |
393 | linvfs_file_mmap( | 403 | linvfs_file_mmap( |
@@ -399,16 +409,19 @@ linvfs_file_mmap( | |||
399 | vattr_t va = { .va_mask = XFS_AT_UPDATIME }; | 409 | vattr_t va = { .va_mask = XFS_AT_UPDATIME }; |
400 | int error; | 410 | int error; |
401 | 411 | ||
412 | vma->vm_ops = &linvfs_file_vm_ops; | ||
413 | |||
402 | if (vp->v_vfsp->vfs_flag & VFS_DMI) { | 414 | if (vp->v_vfsp->vfs_flag & VFS_DMI) { |
403 | xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp); | 415 | xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp); |
404 | 416 | ||
405 | error = -XFS_SEND_MMAP(mp, vma, 0); | 417 | error = -XFS_SEND_MMAP(mp, vma, 0); |
406 | if (error) | 418 | if (error) |
407 | return error; | 419 | return error; |
420 | #ifdef CONFIG_XFS_DMAPI | ||
421 | vma->vm_ops = &linvfs_dmapi_file_vm_ops; | ||
422 | #endif | ||
408 | } | 423 | } |
409 | 424 | ||
410 | vma->vm_ops = &linvfs_file_vm_ops; | ||
411 | |||
412 | VOP_SETATTR(vp, &va, XFS_AT_UPDATIME, NULL, error); | 425 | VOP_SETATTR(vp, &va, XFS_AT_UPDATIME, NULL, error); |
413 | if (!error) | 426 | if (!error) |
414 | vn_revalidate(vp); /* update Linux inode flags */ | 427 | vn_revalidate(vp); /* update Linux inode flags */ |
@@ -565,7 +578,7 @@ struct file_operations linvfs_file_operations = { | |||
565 | .sendfile = linvfs_sendfile, | 578 | .sendfile = linvfs_sendfile, |
566 | .unlocked_ioctl = linvfs_ioctl, | 579 | .unlocked_ioctl = linvfs_ioctl, |
567 | #ifdef CONFIG_COMPAT | 580 | #ifdef CONFIG_COMPAT |
568 | .compat_ioctl = xfs_compat_ioctl, | 581 | .compat_ioctl = linvfs_compat_ioctl, |
569 | #endif | 582 | #endif |
570 | .mmap = linvfs_file_mmap, | 583 | .mmap = linvfs_file_mmap, |
571 | .open = linvfs_open, | 584 | .open = linvfs_open, |
@@ -587,7 +600,7 @@ struct file_operations linvfs_invis_file_operations = { | |||
587 | .sendfile = linvfs_sendfile, | 600 | .sendfile = linvfs_sendfile, |
588 | .unlocked_ioctl = linvfs_ioctl_invis, | 601 | .unlocked_ioctl = linvfs_ioctl_invis, |
589 | #ifdef CONFIG_COMPAT | 602 | #ifdef CONFIG_COMPAT |
590 | .compat_ioctl = xfs_compat_invis_ioctl, | 603 | .compat_ioctl = linvfs_compat_invis_ioctl, |
591 | #endif | 604 | #endif |
592 | .mmap = linvfs_file_mmap, | 605 | .mmap = linvfs_file_mmap, |
593 | .open = linvfs_open, | 606 | .open = linvfs_open, |
@@ -600,13 +613,24 @@ struct file_operations linvfs_dir_operations = { | |||
600 | .read = generic_read_dir, | 613 | .read = generic_read_dir, |
601 | .readdir = linvfs_readdir, | 614 | .readdir = linvfs_readdir, |
602 | .unlocked_ioctl = linvfs_ioctl, | 615 | .unlocked_ioctl = linvfs_ioctl, |
616 | #ifdef CONFIG_COMPAT | ||
617 | .compat_ioctl = linvfs_compat_ioctl, | ||
618 | #endif | ||
603 | .fsync = linvfs_fsync, | 619 | .fsync = linvfs_fsync, |
604 | }; | 620 | }; |
605 | 621 | ||
606 | static struct vm_operations_struct linvfs_file_vm_ops = { | 622 | static struct vm_operations_struct linvfs_file_vm_ops = { |
607 | .nopage = filemap_nopage, | 623 | .nopage = filemap_nopage, |
608 | .populate = filemap_populate, | 624 | .populate = filemap_populate, |
625 | }; | ||
626 | |||
627 | #ifdef CONFIG_XFS_DMAPI | ||
628 | static struct vm_operations_struct linvfs_dmapi_file_vm_ops = { | ||
629 | .close = linvfs_mmap_close, | ||
630 | .nopage = filemap_nopage, | ||
631 | .populate = filemap_populate, | ||
609 | #ifdef HAVE_VMOP_MPROTECT | 632 | #ifdef HAVE_VMOP_MPROTECT |
610 | .mprotect = linvfs_mprotect, | 633 | .mprotect = linvfs_mprotect, |
611 | #endif | 634 | #endif |
612 | }; | 635 | }; |
636 | #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 69809eef8a54..05a447e51cc0 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.c +++ b/fs/xfs/linux-2.6/xfs_ioctl.c | |||
@@ -1174,7 +1174,8 @@ xfs_ioc_xattr( | |||
1174 | 1174 | ||
1175 | switch (cmd) { | 1175 | switch (cmd) { |
1176 | case XFS_IOC_FSGETXATTR: { | 1176 | case XFS_IOC_FSGETXATTR: { |
1177 | va.va_mask = XFS_AT_XFLAGS|XFS_AT_EXTSIZE|XFS_AT_NEXTENTS; | 1177 | va.va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \ |
1178 | XFS_AT_NEXTENTS | XFS_AT_PROJID; | ||
1178 | VOP_GETATTR(vp, &va, 0, NULL, error); | 1179 | VOP_GETATTR(vp, &va, 0, NULL, error); |
1179 | if (error) | 1180 | if (error) |
1180 | return -error; | 1181 | return -error; |
@@ -1182,6 +1183,7 @@ xfs_ioc_xattr( | |||
1182 | fa.fsx_xflags = va.va_xflags; | 1183 | fa.fsx_xflags = va.va_xflags; |
1183 | fa.fsx_extsize = va.va_extsize; | 1184 | fa.fsx_extsize = va.va_extsize; |
1184 | fa.fsx_nextents = va.va_nextents; | 1185 | fa.fsx_nextents = va.va_nextents; |
1186 | fa.fsx_projid = va.va_projid; | ||
1185 | 1187 | ||
1186 | if (copy_to_user(arg, &fa, sizeof(fa))) | 1188 | if (copy_to_user(arg, &fa, sizeof(fa))) |
1187 | return -XFS_ERROR(EFAULT); | 1189 | return -XFS_ERROR(EFAULT); |
@@ -1196,9 +1198,10 @@ xfs_ioc_xattr( | |||
1196 | if (filp->f_flags & (O_NDELAY|O_NONBLOCK)) | 1198 | if (filp->f_flags & (O_NDELAY|O_NONBLOCK)) |
1197 | attr_flags |= ATTR_NONBLOCK; | 1199 | attr_flags |= ATTR_NONBLOCK; |
1198 | 1200 | ||
1199 | va.va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE; | 1201 | va.va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | XFS_AT_PROJID; |
1200 | va.va_xflags = fa.fsx_xflags; | 1202 | va.va_xflags = fa.fsx_xflags; |
1201 | va.va_extsize = fa.fsx_extsize; | 1203 | va.va_extsize = fa.fsx_extsize; |
1204 | va.va_projid = fa.fsx_projid; | ||
1202 | 1205 | ||
1203 | VOP_SETATTR(vp, &va, attr_flags, NULL, error); | 1206 | VOP_SETATTR(vp, &va, attr_flags, NULL, error); |
1204 | if (!error) | 1207 | if (!error) |
@@ -1207,7 +1210,8 @@ xfs_ioc_xattr( | |||
1207 | } | 1210 | } |
1208 | 1211 | ||
1209 | case XFS_IOC_FSGETXATTRA: { | 1212 | case XFS_IOC_FSGETXATTRA: { |
1210 | va.va_mask = XFS_AT_XFLAGS|XFS_AT_EXTSIZE|XFS_AT_ANEXTENTS; | 1213 | va.va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \ |
1214 | XFS_AT_ANEXTENTS | XFS_AT_PROJID; | ||
1211 | VOP_GETATTR(vp, &va, 0, NULL, error); | 1215 | VOP_GETATTR(vp, &va, 0, NULL, error); |
1212 | if (error) | 1216 | if (error) |
1213 | return -error; | 1217 | return -error; |
@@ -1215,6 +1219,7 @@ xfs_ioc_xattr( | |||
1215 | fa.fsx_xflags = va.va_xflags; | 1219 | fa.fsx_xflags = va.va_xflags; |
1216 | fa.fsx_extsize = va.va_extsize; | 1220 | fa.fsx_extsize = va.va_extsize; |
1217 | fa.fsx_nextents = va.va_anextents; | 1221 | fa.fsx_nextents = va.va_anextents; |
1222 | fa.fsx_projid = va.va_projid; | ||
1218 | 1223 | ||
1219 | if (copy_to_user(arg, &fa, sizeof(fa))) | 1224 | if (copy_to_user(arg, &fa, sizeof(fa))) |
1220 | return -XFS_ERROR(EFAULT); | 1225 | return -XFS_ERROR(EFAULT); |
diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c index 7a12c83184f5..0f8f1384eb36 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl32.c +++ b/fs/xfs/linux-2.6/xfs_ioctl32.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2004 Silicon Graphics, Inc. All Rights Reserved. | 2 | * Copyright (c) 2004-2005 Silicon Graphics, Inc. All Rights Reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms of version 2 of the GNU General Public License as | 5 | * under the terms of version 2 of the GNU General Public License as |
@@ -58,8 +58,9 @@ typedef struct xfs_fsop_bulkreq32 { | |||
58 | __s32 ocount; /* output count pointer */ | 58 | __s32 ocount; /* output count pointer */ |
59 | } xfs_fsop_bulkreq32_t; | 59 | } xfs_fsop_bulkreq32_t; |
60 | 60 | ||
61 | static unsigned long | 61 | STATIC unsigned long |
62 | xfs_ioctl32_bulkstat(unsigned long arg) | 62 | xfs_ioctl32_bulkstat( |
63 | unsigned long arg) | ||
63 | { | 64 | { |
64 | xfs_fsop_bulkreq32_t __user *p32 = (void __user *)arg; | 65 | xfs_fsop_bulkreq32_t __user *p32 = (void __user *)arg; |
65 | xfs_fsop_bulkreq_t __user *p = compat_alloc_user_space(sizeof(*p)); | 66 | xfs_fsop_bulkreq_t __user *p = compat_alloc_user_space(sizeof(*p)); |
@@ -78,11 +79,11 @@ xfs_ioctl32_bulkstat(unsigned long arg) | |||
78 | } | 79 | } |
79 | #endif | 80 | #endif |
80 | 81 | ||
81 | static long | 82 | STATIC long |
82 | __xfs_compat_ioctl(int mode, struct file *f, unsigned cmd, unsigned long arg) | 83 | __linvfs_compat_ioctl(int mode, struct file *f, unsigned cmd, unsigned long arg) |
83 | { | 84 | { |
84 | int error; | 85 | int error; |
85 | struct inode *inode = f->f_dentry->d_inode; | 86 | struct inode *inode = f->f_dentry->d_inode; |
86 | vnode_t *vp = LINVFS_GET_VP(inode); | 87 | vnode_t *vp = LINVFS_GET_VP(inode); |
87 | 88 | ||
88 | switch (cmd) { | 89 | switch (cmd) { |
@@ -152,12 +153,20 @@ __xfs_compat_ioctl(int mode, struct file *f, unsigned cmd, unsigned long arg) | |||
152 | return error; | 153 | return error; |
153 | } | 154 | } |
154 | 155 | ||
155 | long xfs_compat_ioctl(struct file *f, unsigned cmd, unsigned long arg) | 156 | long |
157 | linvfs_compat_ioctl( | ||
158 | struct file *f, | ||
159 | unsigned cmd, | ||
160 | unsigned long arg) | ||
156 | { | 161 | { |
157 | return __xfs_compat_ioctl(0, f, cmd, arg); | 162 | return __linvfs_compat_ioctl(0, f, cmd, arg); |
158 | } | 163 | } |
159 | 164 | ||
160 | long xfs_compat_invis_ioctl(struct file *f, unsigned cmd, unsigned long arg) | 165 | long |
166 | linvfs_compat_invis_ioctl( | ||
167 | struct file *f, | ||
168 | unsigned cmd, | ||
169 | unsigned long arg) | ||
161 | { | 170 | { |
162 | return __xfs_compat_ioctl(IO_INVIS, f, cmd, arg); | 171 | return __linvfs_compat_ioctl(IO_INVIS, f, cmd, arg); |
163 | } | 172 | } |
diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.h b/fs/xfs/linux-2.6/xfs_ioctl32.h index 779f69a48116..c874793a1dc9 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl32.h +++ b/fs/xfs/linux-2.6/xfs_ioctl32.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2004 Silicon Graphics, Inc. All Rights Reserved. | 2 | * Copyright (c) 2004-2005 Silicon Graphics, Inc. All Rights Reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms of version 2 of the GNU General Public License as | 5 | * under the terms of version 2 of the GNU General Public License as |
@@ -30,5 +30,5 @@ | |||
30 | * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ | 30 | * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ |
31 | */ | 31 | */ |
32 | 32 | ||
33 | long xfs_compat_ioctl(struct file *f, unsigned cmd, unsigned long arg); | 33 | long linvfs_compat_ioctl(struct file *f, unsigned cmd, unsigned long arg); |
34 | long xfs_compat_invis_ioctl(struct file *f, unsigned cmd, unsigned long arg); | 34 | long linvfs_compat_invis_ioctl(struct file *f, unsigned cmd, unsigned long arg); |
diff --git a/fs/xfs/linux-2.6/xfs_linux.h b/fs/xfs/linux-2.6/xfs_linux.h index 71bb41019a12..42dc5e4662ed 100644 --- a/fs/xfs/linux-2.6/xfs_linux.h +++ b/fs/xfs/linux-2.6/xfs_linux.h | |||
@@ -145,10 +145,10 @@ static inline void set_buffer_unwritten_io(struct buffer_head *bh) | |||
145 | #define xfs_inherit_nosymlinks xfs_params.inherit_nosym.val | 145 | #define xfs_inherit_nosymlinks xfs_params.inherit_nosym.val |
146 | #define xfs_rotorstep xfs_params.rotorstep.val | 146 | #define xfs_rotorstep xfs_params.rotorstep.val |
147 | 147 | ||
148 | #ifndef __smp_processor_id | 148 | #ifndef raw_smp_processor_id |
149 | #define __smp_processor_id() smp_processor_id() | 149 | #define raw_smp_processor_id() smp_processor_id() |
150 | #endif | 150 | #endif |
151 | #define current_cpu() __smp_processor_id() | 151 | #define current_cpu() raw_smp_processor_id() |
152 | #define current_pid() (current->pid) | 152 | #define current_pid() (current->pid) |
153 | #define current_fsuid(cred) (current->fsuid) | 153 | #define current_fsuid(cred) (current->fsuid) |
154 | #define current_fsgid(cred) (current->fsgid) | 154 | #define current_fsgid(cred) (current->fsgid) |
@@ -230,8 +230,10 @@ static inline void set_buffer_unwritten_io(struct buffer_head *bh) | |||
230 | * field (see the QCMD macro in quota.h). These macros help keep the | 230 | * field (see the QCMD macro in quota.h). These macros help keep the |
231 | * code portable - they are not visible from the syscall interface. | 231 | * code portable - they are not visible from the syscall interface. |
232 | */ | 232 | */ |
233 | #define Q_XSETGQLIM XQM_CMD(0x8) /* set groups disk limits */ | 233 | #define Q_XSETGQLIM XQM_CMD(8) /* set groups disk limits */ |
234 | #define Q_XGETGQUOTA XQM_CMD(0x9) /* get groups disk limits */ | 234 | #define Q_XGETGQUOTA XQM_CMD(9) /* get groups disk limits */ |
235 | #define Q_XSETPQLIM XQM_CMD(10) /* set projects disk limits */ | ||
236 | #define Q_XGETPQUOTA XQM_CMD(11) /* get projects disk limits */ | ||
235 | 237 | ||
236 | /* IRIX uses a dynamic sizing algorithm (ndquot = 200 + numprocs*2) */ | 238 | /* IRIX uses a dynamic sizing algorithm (ndquot = 200 + numprocs*2) */ |
237 | /* we may well need to fine-tune this if it ever becomes an issue. */ | 239 | /* we may well need to fine-tune this if it ever becomes an issue. */ |
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index aa9daaea6c34..acab58c48043 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c | |||
@@ -209,30 +209,6 @@ unlock: | |||
209 | return (-status); | 209 | return (-status); |
210 | } | 210 | } |
211 | 211 | ||
212 | /* | ||
213 | * xfs_inval_cached_pages | ||
214 | * | ||
215 | * This routine is responsible for keeping direct I/O and buffered I/O | ||
216 | * somewhat coherent. From here we make sure that we're at least | ||
217 | * temporarily holding the inode I/O lock exclusively and then call | ||
218 | * the page cache to flush and invalidate any cached pages. If there | ||
219 | * are no cached pages this routine will be very quick. | ||
220 | */ | ||
221 | void | ||
222 | xfs_inval_cached_pages( | ||
223 | vnode_t *vp, | ||
224 | xfs_iocore_t *io, | ||
225 | xfs_off_t offset, | ||
226 | int write, | ||
227 | int relock) | ||
228 | { | ||
229 | if (VN_CACHED(vp)) { | ||
230 | xfs_inval_cached_trace(io, offset, -1, ctooff(offtoct(offset)), -1); | ||
231 | VOP_FLUSHINVAL_PAGES(vp, ctooff(offtoct(offset)), -1, FI_REMAPF_LOCKED); | ||
232 | } | ||
233 | |||
234 | } | ||
235 | |||
236 | ssize_t /* bytes read, or (-) error */ | 212 | ssize_t /* bytes read, or (-) error */ |
237 | xfs_read( | 213 | xfs_read( |
238 | bhv_desc_t *bdp, | 214 | bhv_desc_t *bdp, |
@@ -304,10 +280,11 @@ xfs_read( | |||
304 | if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ) && | 280 | if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ) && |
305 | !(ioflags & IO_INVIS)) { | 281 | !(ioflags & IO_INVIS)) { |
306 | vrwlock_t locktype = VRWLOCK_READ; | 282 | vrwlock_t locktype = VRWLOCK_READ; |
283 | int dmflags = FILP_DELAY_FLAG(file) | DM_SEM_FLAG_RD(ioflags); | ||
307 | 284 | ||
308 | ret = -XFS_SEND_DATA(mp, DM_EVENT_READ, | 285 | ret = -XFS_SEND_DATA(mp, DM_EVENT_READ, |
309 | BHV_TO_VNODE(bdp), *offset, size, | 286 | BHV_TO_VNODE(bdp), *offset, size, |
310 | FILP_DELAY_FLAG(file), &locktype); | 287 | dmflags, &locktype); |
311 | if (ret) { | 288 | if (ret) { |
312 | xfs_iunlock(ip, XFS_IOLOCK_SHARED); | 289 | xfs_iunlock(ip, XFS_IOLOCK_SHARED); |
313 | goto unlock_isem; | 290 | goto unlock_isem; |
@@ -867,11 +844,15 @@ retry: | |||
867 | !(ioflags & IO_INVIS)) { | 844 | !(ioflags & IO_INVIS)) { |
868 | 845 | ||
869 | xfs_rwunlock(bdp, locktype); | 846 | xfs_rwunlock(bdp, locktype); |
847 | if (need_isem) | ||
848 | up(&inode->i_sem); | ||
870 | error = XFS_SEND_NAMESP(xip->i_mount, DM_EVENT_NOSPACE, vp, | 849 | error = XFS_SEND_NAMESP(xip->i_mount, DM_EVENT_NOSPACE, vp, |
871 | DM_RIGHT_NULL, vp, DM_RIGHT_NULL, NULL, NULL, | 850 | DM_RIGHT_NULL, vp, DM_RIGHT_NULL, NULL, NULL, |
872 | 0, 0, 0); /* Delay flag intentionally unused */ | 851 | 0, 0, 0); /* Delay flag intentionally unused */ |
873 | if (error) | 852 | if (error) |
874 | goto out_unlock_isem; | 853 | goto out_nounlocks; |
854 | if (need_isem) | ||
855 | down(&inode->i_sem); | ||
875 | xfs_rwlock(bdp, locktype); | 856 | xfs_rwlock(bdp, locktype); |
876 | pos = xip->i_d.di_size; | 857 | pos = xip->i_d.di_size; |
877 | ret = 0; | 858 | ret = 0; |
@@ -986,6 +967,7 @@ retry: | |||
986 | out_unlock_isem: | 967 | out_unlock_isem: |
987 | if (need_isem) | 968 | if (need_isem) |
988 | up(&inode->i_sem); | 969 | up(&inode->i_sem); |
970 | out_nounlocks: | ||
989 | return -error; | 971 | return -error; |
990 | } | 972 | } |
991 | 973 | ||
diff --git a/fs/xfs/linux-2.6/xfs_lrw.h b/fs/xfs/linux-2.6/xfs_lrw.h index d723e35254a0..f197a720e394 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.h +++ b/fs/xfs/linux-2.6/xfs_lrw.h | |||
@@ -94,8 +94,6 @@ extern int xfs_bdstrat_cb(struct xfs_buf *); | |||
94 | 94 | ||
95 | extern int xfs_zero_eof(struct vnode *, struct xfs_iocore *, xfs_off_t, | 95 | extern int xfs_zero_eof(struct vnode *, struct xfs_iocore *, xfs_off_t, |
96 | xfs_fsize_t, xfs_fsize_t); | 96 | xfs_fsize_t, xfs_fsize_t); |
97 | extern void xfs_inval_cached_pages(struct vnode *, struct xfs_iocore *, | ||
98 | xfs_off_t, int, int); | ||
99 | extern ssize_t xfs_read(struct bhv_desc *, struct kiocb *, | 97 | extern ssize_t xfs_read(struct bhv_desc *, struct kiocb *, |
100 | const struct iovec *, unsigned int, | 98 | const struct iovec *, unsigned int, |
101 | loff_t *, int, struct cred *); | 99 | loff_t *, int, struct cred *); |
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 53dc658cafa6..f6dd7de25927 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved. | 2 | * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms of version 2 of the GNU General Public License as | 5 | * under the terms of version 2 of the GNU General Public License as |
@@ -66,7 +66,6 @@ | |||
66 | #include "xfs_buf_item.h" | 66 | #include "xfs_buf_item.h" |
67 | #include "xfs_utils.h" | 67 | #include "xfs_utils.h" |
68 | #include "xfs_version.h" | 68 | #include "xfs_version.h" |
69 | #include "xfs_ioctl32.h" | ||
70 | 69 | ||
71 | #include <linux/namei.h> | 70 | #include <linux/namei.h> |
72 | #include <linux/init.h> | 71 | #include <linux/init.h> |
@@ -484,7 +483,7 @@ xfssyncd( | |||
484 | set_current_state(TASK_INTERRUPTIBLE); | 483 | set_current_state(TASK_INTERRUPTIBLE); |
485 | timeleft = schedule_timeout(timeleft); | 484 | timeleft = schedule_timeout(timeleft); |
486 | /* swsusp */ | 485 | /* swsusp */ |
487 | try_to_freeze(PF_FREEZE); | 486 | try_to_freeze(); |
488 | if (vfsp->vfs_flag & VFS_UMOUNT) | 487 | if (vfsp->vfs_flag & VFS_UMOUNT) |
489 | break; | 488 | break; |
490 | 489 | ||
@@ -591,8 +590,10 @@ linvfs_sync_super( | |||
591 | int error; | 590 | int error; |
592 | int flags = SYNC_FSDATA; | 591 | int flags = SYNC_FSDATA; |
593 | 592 | ||
594 | if (wait) | 593 | if (unlikely(sb->s_frozen == SB_FREEZE_WRITE)) |
595 | flags |= SYNC_WAIT; | 594 | flags = SYNC_QUIESCE; |
595 | else | ||
596 | flags = SYNC_FSDATA | (wait ? SYNC_WAIT : 0); | ||
596 | 597 | ||
597 | VFS_SYNC(vfsp, flags, NULL, error); | 598 | VFS_SYNC(vfsp, flags, NULL, error); |
598 | sb->s_dirt = 0; | 599 | sb->s_dirt = 0; |
@@ -702,7 +703,8 @@ linvfs_getxquota( | |||
702 | struct vfs *vfsp = LINVFS_GET_VFS(sb); | 703 | struct vfs *vfsp = LINVFS_GET_VFS(sb); |
703 | int error, getmode; | 704 | int error, getmode; |
704 | 705 | ||
705 | getmode = (type == GRPQUOTA) ? Q_XGETGQUOTA : Q_XGETQUOTA; | 706 | getmode = (type == USRQUOTA) ? Q_XGETQUOTA : |
707 | ((type == GRPQUOTA) ? Q_XGETGQUOTA : Q_XGETPQUOTA); | ||
706 | VFS_QUOTACTL(vfsp, getmode, id, (caddr_t)fdq, error); | 708 | VFS_QUOTACTL(vfsp, getmode, id, (caddr_t)fdq, error); |
707 | return -error; | 709 | return -error; |
708 | } | 710 | } |
@@ -717,7 +719,8 @@ linvfs_setxquota( | |||
717 | struct vfs *vfsp = LINVFS_GET_VFS(sb); | 719 | struct vfs *vfsp = LINVFS_GET_VFS(sb); |
718 | int error, setmode; | 720 | int error, setmode; |
719 | 721 | ||
720 | setmode = (type == GRPQUOTA) ? Q_XSETGQLIM : Q_XSETQLIM; | 722 | setmode = (type == USRQUOTA) ? Q_XSETQLIM : |
723 | ((type == GRPQUOTA) ? Q_XSETGQLIM : Q_XSETPQLIM); | ||
721 | VFS_QUOTACTL(vfsp, setmode, id, (caddr_t)fdq, error); | 724 | VFS_QUOTACTL(vfsp, setmode, id, (caddr_t)fdq, error); |
722 | return -error; | 725 | return -error; |
723 | } | 726 | } |
diff --git a/fs/xfs/linux-2.6/xfs_vfs.h b/fs/xfs/linux-2.6/xfs_vfs.h index 76493991578f..7ee1f714e9ba 100644 --- a/fs/xfs/linux-2.6/xfs_vfs.h +++ b/fs/xfs/linux-2.6/xfs_vfs.h | |||
@@ -107,6 +107,7 @@ typedef enum { | |||
107 | #define SYNC_FSDATA 0x0020 /* flush fs data (e.g. superblocks) */ | 107 | #define SYNC_FSDATA 0x0020 /* flush fs data (e.g. superblocks) */ |
108 | #define SYNC_REFCACHE 0x0040 /* prune some of the nfs ref cache */ | 108 | #define SYNC_REFCACHE 0x0040 /* prune some of the nfs ref cache */ |
109 | #define SYNC_REMOUNT 0x0080 /* remount readonly, no dummy LRs */ | 109 | #define SYNC_REMOUNT 0x0080 /* remount readonly, no dummy LRs */ |
110 | #define SYNC_QUIESCE 0x0100 /* quiesce fileystem for a snapshot */ | ||
110 | 111 | ||
111 | typedef int (*vfs_mount_t)(bhv_desc_t *, | 112 | typedef int (*vfs_mount_t)(bhv_desc_t *, |
112 | struct xfs_mount_args *, struct cred *); | 113 | struct xfs_mount_args *, struct cred *); |
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c index a832d165f24f..250cad54e892 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.c +++ b/fs/xfs/linux-2.6/xfs_vnode.c | |||
@@ -411,13 +411,13 @@ vn_remove( | |||
411 | /* 0 */ (void *)(__psint_t)(vk), \ | 411 | /* 0 */ (void *)(__psint_t)(vk), \ |
412 | /* 1 */ (void *)(s), \ | 412 | /* 1 */ (void *)(s), \ |
413 | /* 2 */ (void *)(__psint_t) line, \ | 413 | /* 2 */ (void *)(__psint_t) line, \ |
414 | /* 3 */ (void *)(vn_count(vp)), \ | 414 | /* 3 */ (void *)(__psint_t)(vn_count(vp)), \ |
415 | /* 4 */ (void *)(ra), \ | 415 | /* 4 */ (void *)(ra), \ |
416 | /* 5 */ (void *)(__psunsigned_t)(vp)->v_flag, \ | 416 | /* 5 */ (void *)(__psunsigned_t)(vp)->v_flag, \ |
417 | /* 6 */ (void *)(__psint_t)current_cpu(), \ | 417 | /* 6 */ (void *)(__psint_t)current_cpu(), \ |
418 | /* 7 */ (void *)(__psint_t)current_pid(), \ | 418 | /* 7 */ (void *)(__psint_t)current_pid(), \ |
419 | /* 8 */ (void *)__return_address, \ | 419 | /* 8 */ (void *)__return_address, \ |
420 | /* 9 */ 0, 0, 0, 0, 0, 0, 0) | 420 | /* 9 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
421 | 421 | ||
422 | /* | 422 | /* |
423 | * Vnode tracing code. | 423 | * Vnode tracing code. |
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h index 00466c3194ac..a6e57c647be4 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.h +++ b/fs/xfs/linux-2.6/xfs_vnode.h | |||
@@ -426,7 +426,7 @@ typedef struct vattr { | |||
426 | u_long va_extsize; /* file extent size */ | 426 | u_long va_extsize; /* file extent size */ |
427 | u_long va_nextents; /* number of extents in file */ | 427 | u_long va_nextents; /* number of extents in file */ |
428 | u_long va_anextents; /* number of attr extents in file */ | 428 | u_long va_anextents; /* number of attr extents in file */ |
429 | int va_projid; /* project id */ | 429 | prid_t va_projid; /* project id */ |
430 | } vattr_t; | 430 | } vattr_t; |
431 | 431 | ||
432 | /* | 432 | /* |