aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/linux-2.6/kmem.h2
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c31
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c7
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c4
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.c35
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c3
6 files changed, 32 insertions, 50 deletions
diff --git a/fs/xfs/linux-2.6/kmem.h b/fs/xfs/linux-2.6/kmem.h
index e6ea293f303c..5e9564902976 100644
--- a/fs/xfs/linux-2.6/kmem.h
+++ b/fs/xfs/linux-2.6/kmem.h
@@ -79,7 +79,7 @@ kmem_zone_init(int size, char *zone_name)
79 79
80static inline kmem_zone_t * 80static inline kmem_zone_t *
81kmem_zone_init_flags(int size, char *zone_name, unsigned long flags, 81kmem_zone_init_flags(int size, char *zone_name, unsigned long flags,
82 void (*construct)(void *, kmem_zone_t *, unsigned long)) 82 void (*construct)(kmem_zone_t *, void *))
83{ 83{
84 return kmem_cache_create(zone_name, size, 0, flags, construct); 84 return kmem_cache_create(zone_name, size, 0, flags, construct);
85} 85}
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index a252fa72f55b..2e34b104107c 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -323,17 +323,13 @@ xfs_iomap_valid(
323/* 323/*
324 * BIO completion handler for buffered IO. 324 * BIO completion handler for buffered IO.
325 */ 325 */
326STATIC int 326STATIC void
327xfs_end_bio( 327xfs_end_bio(
328 struct bio *bio, 328 struct bio *bio,
329 unsigned int bytes_done,
330 int error) 329 int error)
331{ 330{
332 xfs_ioend_t *ioend = bio->bi_private; 331 xfs_ioend_t *ioend = bio->bi_private;
333 332
334 if (bio->bi_size)
335 return 1;
336
337 ASSERT(atomic_read(&bio->bi_cnt) >= 1); 333 ASSERT(atomic_read(&bio->bi_cnt) >= 1);
338 ioend->io_error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? 0 : error; 334 ioend->io_error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? 0 : error;
339 335
@@ -343,7 +339,6 @@ xfs_end_bio(
343 bio_put(bio); 339 bio_put(bio);
344 340
345 xfs_finish_ioend(ioend, 0); 341 xfs_finish_ioend(ioend, 0);
346 return 0;
347} 342}
348 343
349STATIC void 344STATIC void
@@ -407,10 +402,9 @@ xfs_start_page_writeback(
407 clear_page_dirty_for_io(page); 402 clear_page_dirty_for_io(page);
408 set_page_writeback(page); 403 set_page_writeback(page);
409 unlock_page(page); 404 unlock_page(page);
410 if (!buffers) { 405 /* If no buffers on the page are to be written, finish it here */
406 if (!buffers)
411 end_page_writeback(page); 407 end_page_writeback(page);
412 wbc->pages_skipped++; /* We didn't write this page */
413 }
414} 408}
415 409
416static inline int bio_add_buffer(struct bio *bio, struct buffer_head *bh) 410static inline int bio_add_buffer(struct bio *bio, struct buffer_head *bh)
@@ -1509,13 +1503,18 @@ xfs_vm_direct_IO(
1509} 1503}
1510 1504
1511STATIC int 1505STATIC int
1512xfs_vm_prepare_write( 1506xfs_vm_write_begin(
1513 struct file *file, 1507 struct file *file,
1514 struct page *page, 1508 struct address_space *mapping,
1515 unsigned int from, 1509 loff_t pos,
1516 unsigned int to) 1510 unsigned len,
1511 unsigned flags,
1512 struct page **pagep,
1513 void **fsdata)
1517{ 1514{
1518 return block_prepare_write(page, from, to, xfs_get_blocks); 1515 *pagep = NULL;
1516 return block_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
1517 xfs_get_blocks);
1519} 1518}
1520 1519
1521STATIC sector_t 1520STATIC sector_t
@@ -1570,8 +1569,8 @@ const struct address_space_operations xfs_address_space_operations = {
1570 .sync_page = block_sync_page, 1569 .sync_page = block_sync_page,
1571 .releasepage = xfs_vm_releasepage, 1570 .releasepage = xfs_vm_releasepage,
1572 .invalidatepage = xfs_vm_invalidatepage, 1571 .invalidatepage = xfs_vm_invalidatepage,
1573 .prepare_write = xfs_vm_prepare_write, 1572 .write_begin = xfs_vm_write_begin,
1574 .commit_write = generic_commit_write, 1573 .write_end = generic_write_end,
1575 .bmap = xfs_vm_bmap, 1574 .bmap = xfs_vm_bmap,
1576 .direct_IO = xfs_vm_direct_IO, 1575 .direct_IO = xfs_vm_direct_IO,
1577 .migratepage = buffer_migrate_page, 1576 .migratepage = buffer_migrate_page,
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index d5b2d2bbf5ff..b9c8589e05c2 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -1127,19 +1127,15 @@ _xfs_buf_ioend(
1127 } 1127 }
1128} 1128}
1129 1129
1130STATIC int 1130STATIC void
1131xfs_buf_bio_end_io( 1131xfs_buf_bio_end_io(
1132 struct bio *bio, 1132 struct bio *bio,
1133 unsigned int bytes_done,
1134 int error) 1133 int error)
1135{ 1134{
1136 xfs_buf_t *bp = (xfs_buf_t *)bio->bi_private; 1135 xfs_buf_t *bp = (xfs_buf_t *)bio->bi_private;
1137 unsigned int blocksize = bp->b_target->bt_bsize; 1136 unsigned int blocksize = bp->b_target->bt_bsize;
1138 struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1; 1137 struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
1139 1138
1140 if (bio->bi_size)
1141 return 1;
1142
1143 if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) 1139 if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
1144 bp->b_error = EIO; 1140 bp->b_error = EIO;
1145 1141
@@ -1167,7 +1163,6 @@ xfs_buf_bio_end_io(
1167 1163
1168 _xfs_buf_ioend(bp, 1); 1164 _xfs_buf_ioend(bp, 1);
1169 bio_put(bio); 1165 bio_put(bio);
1170 return 0;
1171} 1166}
1172 1167
1173STATIC void 1168STATIC void
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 11edd72baac7..ac50f8a37582 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -117,7 +117,7 @@ xfs_ichgtime(
117 */ 117 */
118 SYNCHRONIZE(); 118 SYNCHRONIZE();
119 ip->i_update_core = 1; 119 ip->i_update_core = 1;
120 if (!(inode->i_state & I_LOCK)) 120 if (!(inode->i_state & I_SYNC))
121 mark_inode_dirty_sync(inode); 121 mark_inode_dirty_sync(inode);
122} 122}
123 123
@@ -169,7 +169,7 @@ xfs_ichgtime_fast(
169 */ 169 */
170 SYNCHRONIZE(); 170 SYNCHRONIZE();
171 ip->i_update_core = 1; 171 ip->i_update_core = 1;
172 if (!(inode->i_state & I_LOCK)) 172 if (!(inode->i_state & I_SYNC))
173 mark_inode_dirty_sync(inode); 173 mark_inode_dirty_sync(inode);
174} 174}
175 175
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c
index 0f54b104a6ee..d6a8dddb2268 100644
--- a/fs/xfs/linux-2.6/xfs_lrw.c
+++ b/fs/xfs/linux-2.6/xfs_lrw.c
@@ -135,45 +135,34 @@ xfs_iozero(
135 loff_t pos, /* offset in file */ 135 loff_t pos, /* offset in file */
136 size_t count) /* size of data to zero */ 136 size_t count) /* size of data to zero */
137{ 137{
138 unsigned bytes;
139 struct page *page; 138 struct page *page;
140 struct address_space *mapping; 139 struct address_space *mapping;
141 int status; 140 int status;
142 141
143 mapping = ip->i_mapping; 142 mapping = ip->i_mapping;
144 do { 143 do {
145 unsigned long index, offset; 144 unsigned offset, bytes;
145 void *fsdata;
146 146
147 offset = (pos & (PAGE_CACHE_SIZE -1)); /* Within page */ 147 offset = (pos & (PAGE_CACHE_SIZE -1)); /* Within page */
148 index = pos >> PAGE_CACHE_SHIFT;
149 bytes = PAGE_CACHE_SIZE - offset; 148 bytes = PAGE_CACHE_SIZE - offset;
150 if (bytes > count) 149 if (bytes > count)
151 bytes = count; 150 bytes = count;
152 151
153 status = -ENOMEM; 152 status = pagecache_write_begin(NULL, mapping, pos, bytes,
154 page = grab_cache_page(mapping, index); 153 AOP_FLAG_UNINTERRUPTIBLE,
155 if (!page) 154 &page, &fsdata);
156 break;
157
158 status = mapping->a_ops->prepare_write(NULL, page, offset,
159 offset + bytes);
160 if (status) 155 if (status)
161 goto unlock; 156 break;
162 157
163 zero_user_page(page, offset, bytes, KM_USER0); 158 zero_user_page(page, offset, bytes, KM_USER0);
164 159
165 status = mapping->a_ops->commit_write(NULL, page, offset, 160 status = pagecache_write_end(NULL, mapping, pos, bytes, bytes,
166 offset + bytes); 161 page, fsdata);
167 if (!status) { 162 WARN_ON(status <= 0); /* can't return less than zero! */
168 pos += bytes; 163 pos += bytes;
169 count -= bytes; 164 count -= bytes;
170 } 165 status = 0;
171
172unlock:
173 unlock_page(page);
174 page_cache_release(page);
175 if (status)
176 break;
177 } while (count); 166 } while (count);
178 167
179 return (-status); 168 return (-status);
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index f90485828584..8cb63c60c048 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -355,9 +355,8 @@ xfs_fs_destroy_inode(
355 355
356STATIC void 356STATIC void
357xfs_fs_inode_init_once( 357xfs_fs_inode_init_once(
358 void *vnode,
359 kmem_zone_t *zonep, 358 kmem_zone_t *zonep,
360 unsigned long flags) 359 void *vnode)
361{ 360{
362 inode_init_once(vn_to_inode((bhv_vnode_t *)vnode)); 361 inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
363} 362}