diff options
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r-- | fs/xfs/linux-2.6/mrlock.h | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_aops.c | 67 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_aops.h | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_export.h | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl32.c | 22 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_iops.c | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.c | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vfs.h | 2 |
8 files changed, 50 insertions, 51 deletions
diff --git a/fs/xfs/linux-2.6/mrlock.h b/fs/xfs/linux-2.6/mrlock.h index 16b44c3c2362..1b262b790d9c 100644 --- a/fs/xfs/linux-2.6/mrlock.h +++ b/fs/xfs/linux-2.6/mrlock.h | |||
@@ -79,7 +79,7 @@ static inline void mrdemote(mrlock_t *mrp) | |||
79 | * Debug-only routine, without some platform-specific asm code, we can | 79 | * Debug-only routine, without some platform-specific asm code, we can |
80 | * now only answer requests regarding whether we hold the lock for write | 80 | * now only answer requests regarding whether we hold the lock for write |
81 | * (reader state is outside our visibility, we only track writer state). | 81 | * (reader state is outside our visibility, we only track writer state). |
82 | * Note: means !ismrlocked would give false positivies, so don't do that. | 82 | * Note: means !ismrlocked would give false positives, so don't do that. |
83 | */ | 83 | */ |
84 | static inline int ismrlocked(mrlock_t *mrp, int type) | 84 | static inline int ismrlocked(mrlock_t *mrp, int type) |
85 | { | 85 | { |
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index c02f7c5b7462..6cbbd165c60d 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c | |||
@@ -372,7 +372,7 @@ static inline int bio_add_buffer(struct bio *bio, struct buffer_head *bh) | |||
372 | * assumes that all buffers on the page are started at the same time. | 372 | * assumes that all buffers on the page are started at the same time. |
373 | * | 373 | * |
374 | * The fix is two passes across the ioend list - one to start writeback on the | 374 | * The fix is two passes across the ioend list - one to start writeback on the |
375 | * bufferheads, and then the second one submit them for I/O. | 375 | * buffer_heads, and then submit them for I/O on the second pass. |
376 | */ | 376 | */ |
377 | STATIC void | 377 | STATIC void |
378 | xfs_submit_ioend( | 378 | xfs_submit_ioend( |
@@ -699,7 +699,7 @@ xfs_convert_page( | |||
699 | 699 | ||
700 | /* | 700 | /* |
701 | * page_dirty is initially a count of buffers on the page before | 701 | * page_dirty is initially a count of buffers on the page before |
702 | * EOF and is decrememted as we move each into a cleanable state. | 702 | * EOF and is decremented as we move each into a cleanable state. |
703 | * | 703 | * |
704 | * Derivation: | 704 | * Derivation: |
705 | * | 705 | * |
@@ -842,7 +842,7 @@ xfs_cluster_write( | |||
842 | * page if possible. | 842 | * page if possible. |
843 | * The bh->b_state's cannot know if any of the blocks or which block for | 843 | * The bh->b_state's cannot know if any of the blocks or which block for |
844 | * that matter are dirty due to mmap writes, and therefore bh uptodate is | 844 | * that matter are dirty due to mmap writes, and therefore bh uptodate is |
845 | * only vaild if the page itself isn't completely uptodate. Some layers | 845 | * only valid if the page itself isn't completely uptodate. Some layers |
846 | * may clear the page dirty flag prior to calling write page, under the | 846 | * may clear the page dirty flag prior to calling write page, under the |
847 | * assumption the entire page will be written out; by not writing out the | 847 | * assumption the entire page will be written out; by not writing out the |
848 | * whole page the page can be reused before all valid dirty data is | 848 | * whole page the page can be reused before all valid dirty data is |
@@ -892,7 +892,7 @@ xfs_page_state_convert( | |||
892 | 892 | ||
893 | /* | 893 | /* |
894 | * page_dirty is initially a count of buffers on the page before | 894 | * page_dirty is initially a count of buffers on the page before |
895 | * EOF and is decrememted as we move each into a cleanable state. | 895 | * EOF and is decremented as we move each into a cleanable state. |
896 | * | 896 | * |
897 | * Derivation: | 897 | * Derivation: |
898 | * | 898 | * |
@@ -1223,10 +1223,9 @@ free_buffers: | |||
1223 | } | 1223 | } |
1224 | 1224 | ||
1225 | STATIC int | 1225 | STATIC int |
1226 | __xfs_get_block( | 1226 | __xfs_get_blocks( |
1227 | struct inode *inode, | 1227 | struct inode *inode, |
1228 | sector_t iblock, | 1228 | sector_t iblock, |
1229 | unsigned long blocks, | ||
1230 | struct buffer_head *bh_result, | 1229 | struct buffer_head *bh_result, |
1231 | int create, | 1230 | int create, |
1232 | int direct, | 1231 | int direct, |
@@ -1236,22 +1235,17 @@ __xfs_get_block( | |||
1236 | xfs_iomap_t iomap; | 1235 | xfs_iomap_t iomap; |
1237 | xfs_off_t offset; | 1236 | xfs_off_t offset; |
1238 | ssize_t size; | 1237 | ssize_t size; |
1239 | int retpbbm = 1; | 1238 | int niomap = 1; |
1240 | int error; | 1239 | int error; |
1241 | 1240 | ||
1242 | offset = (xfs_off_t)iblock << inode->i_blkbits; | 1241 | offset = (xfs_off_t)iblock << inode->i_blkbits; |
1243 | if (blocks) | 1242 | ASSERT(bh_result->b_size >= (1 << inode->i_blkbits)); |
1244 | size = (ssize_t) min_t(xfs_off_t, LONG_MAX, | 1243 | size = bh_result->b_size; |
1245 | (xfs_off_t)blocks << inode->i_blkbits); | ||
1246 | else | ||
1247 | size = 1 << inode->i_blkbits; | ||
1248 | |||
1249 | VOP_BMAP(vp, offset, size, | 1244 | VOP_BMAP(vp, offset, size, |
1250 | create ? flags : BMAPI_READ, &iomap, &retpbbm, error); | 1245 | create ? flags : BMAPI_READ, &iomap, &niomap, error); |
1251 | if (error) | 1246 | if (error) |
1252 | return -error; | 1247 | return -error; |
1253 | 1248 | if (niomap == 0) | |
1254 | if (retpbbm == 0) | ||
1255 | return 0; | 1249 | return 0; |
1256 | 1250 | ||
1257 | if (iomap.iomap_bn != IOMAP_DADDR_NULL) { | 1251 | if (iomap.iomap_bn != IOMAP_DADDR_NULL) { |
@@ -1271,12 +1265,16 @@ __xfs_get_block( | |||
1271 | } | 1265 | } |
1272 | } | 1266 | } |
1273 | 1267 | ||
1274 | /* If this is a realtime file, data might be on a new device */ | 1268 | /* |
1269 | * If this is a realtime file, data may be on a different device. | ||
1270 | * to that pointed to from the buffer_head b_bdev currently. | ||
1271 | */ | ||
1275 | bh_result->b_bdev = iomap.iomap_target->bt_bdev; | 1272 | bh_result->b_bdev = iomap.iomap_target->bt_bdev; |
1276 | 1273 | ||
1277 | /* If we previously allocated a block out beyond eof and | 1274 | /* |
1278 | * we are now coming back to use it then we will need to | 1275 | * If we previously allocated a block out beyond eof and we are |
1279 | * flag it as new even if it has a disk address. | 1276 | * now coming back to use it then we will need to flag it as new |
1277 | * even if it has a disk address. | ||
1280 | */ | 1278 | */ |
1281 | if (create && | 1279 | if (create && |
1282 | ((!buffer_mapped(bh_result) && !buffer_uptodate(bh_result)) || | 1280 | ((!buffer_mapped(bh_result) && !buffer_uptodate(bh_result)) || |
@@ -1292,26 +1290,24 @@ __xfs_get_block( | |||
1292 | } | 1290 | } |
1293 | } | 1291 | } |
1294 | 1292 | ||
1295 | if (blocks) { | 1293 | if (direct || size > (1 << inode->i_blkbits)) { |
1296 | ASSERT(iomap.iomap_bsize - iomap.iomap_delta > 0); | 1294 | ASSERT(iomap.iomap_bsize - iomap.iomap_delta > 0); |
1297 | offset = min_t(xfs_off_t, | 1295 | offset = min_t(xfs_off_t, |
1298 | iomap.iomap_bsize - iomap.iomap_delta, | 1296 | iomap.iomap_bsize - iomap.iomap_delta, size); |
1299 | (xfs_off_t)blocks << inode->i_blkbits); | 1297 | bh_result->b_size = (ssize_t)min_t(xfs_off_t, LONG_MAX, offset); |
1300 | bh_result->b_size = (u32) min_t(xfs_off_t, UINT_MAX, offset); | ||
1301 | } | 1298 | } |
1302 | 1299 | ||
1303 | return 0; | 1300 | return 0; |
1304 | } | 1301 | } |
1305 | 1302 | ||
1306 | int | 1303 | int |
1307 | xfs_get_block( | 1304 | xfs_get_blocks( |
1308 | struct inode *inode, | 1305 | struct inode *inode, |
1309 | sector_t iblock, | 1306 | sector_t iblock, |
1310 | struct buffer_head *bh_result, | 1307 | struct buffer_head *bh_result, |
1311 | int create) | 1308 | int create) |
1312 | { | 1309 | { |
1313 | return __xfs_get_block(inode, iblock, | 1310 | return __xfs_get_blocks(inode, iblock, |
1314 | bh_result->b_size >> inode->i_blkbits, | ||
1315 | bh_result, create, 0, BMAPI_WRITE); | 1311 | bh_result, create, 0, BMAPI_WRITE); |
1316 | } | 1312 | } |
1317 | 1313 | ||
@@ -1322,8 +1318,7 @@ xfs_get_blocks_direct( | |||
1322 | struct buffer_head *bh_result, | 1318 | struct buffer_head *bh_result, |
1323 | int create) | 1319 | int create) |
1324 | { | 1320 | { |
1325 | return __xfs_get_block(inode, iblock, | 1321 | return __xfs_get_blocks(inode, iblock, |
1326 | bh_result->b_size >> inode->i_blkbits, | ||
1327 | bh_result, create, 1, BMAPI_WRITE|BMAPI_DIRECT); | 1322 | bh_result, create, 1, BMAPI_WRITE|BMAPI_DIRECT); |
1328 | } | 1323 | } |
1329 | 1324 | ||
@@ -1339,9 +1334,9 @@ xfs_end_io_direct( | |||
1339 | /* | 1334 | /* |
1340 | * Non-NULL private data means we need to issue a transaction to | 1335 | * Non-NULL private data means we need to issue a transaction to |
1341 | * convert a range from unwritten to written extents. This needs | 1336 | * convert a range from unwritten to written extents. This needs |
1342 | * to happen from process contect but aio+dio I/O completion | 1337 | * to happen from process context but aio+dio I/O completion |
1343 | * happens from irq context so we need to defer it to a workqueue. | 1338 | * happens from irq context so we need to defer it to a workqueue. |
1344 | * This is not nessecary for synchronous direct I/O, but we do | 1339 | * This is not necessary for synchronous direct I/O, but we do |
1345 | * it anyway to keep the code uniform and simpler. | 1340 | * it anyway to keep the code uniform and simpler. |
1346 | * | 1341 | * |
1347 | * The core direct I/O code might be changed to always call the | 1342 | * The core direct I/O code might be changed to always call the |
@@ -1358,7 +1353,7 @@ xfs_end_io_direct( | |||
1358 | } | 1353 | } |
1359 | 1354 | ||
1360 | /* | 1355 | /* |
1361 | * blockdev_direct_IO can return an error even afer the I/O | 1356 | * blockdev_direct_IO can return an error even after the I/O |
1362 | * completion handler was called. Thus we need to protect | 1357 | * completion handler was called. Thus we need to protect |
1363 | * against double-freeing. | 1358 | * against double-freeing. |
1364 | */ | 1359 | */ |
@@ -1405,7 +1400,7 @@ xfs_vm_prepare_write( | |||
1405 | unsigned int from, | 1400 | unsigned int from, |
1406 | unsigned int to) | 1401 | unsigned int to) |
1407 | { | 1402 | { |
1408 | return block_prepare_write(page, from, to, xfs_get_block); | 1403 | return block_prepare_write(page, from, to, xfs_get_blocks); |
1409 | } | 1404 | } |
1410 | 1405 | ||
1411 | STATIC sector_t | 1406 | STATIC sector_t |
@@ -1422,7 +1417,7 @@ xfs_vm_bmap( | |||
1422 | VOP_RWLOCK(vp, VRWLOCK_READ); | 1417 | VOP_RWLOCK(vp, VRWLOCK_READ); |
1423 | VOP_FLUSH_PAGES(vp, (xfs_off_t)0, -1, 0, FI_REMAPF, error); | 1418 | VOP_FLUSH_PAGES(vp, (xfs_off_t)0, -1, 0, FI_REMAPF, error); |
1424 | VOP_RWUNLOCK(vp, VRWLOCK_READ); | 1419 | VOP_RWUNLOCK(vp, VRWLOCK_READ); |
1425 | return generic_block_bmap(mapping, block, xfs_get_block); | 1420 | return generic_block_bmap(mapping, block, xfs_get_blocks); |
1426 | } | 1421 | } |
1427 | 1422 | ||
1428 | STATIC int | 1423 | STATIC int |
@@ -1430,7 +1425,7 @@ xfs_vm_readpage( | |||
1430 | struct file *unused, | 1425 | struct file *unused, |
1431 | struct page *page) | 1426 | struct page *page) |
1432 | { | 1427 | { |
1433 | return mpage_readpage(page, xfs_get_block); | 1428 | return mpage_readpage(page, xfs_get_blocks); |
1434 | } | 1429 | } |
1435 | 1430 | ||
1436 | STATIC int | 1431 | STATIC int |
@@ -1440,7 +1435,7 @@ xfs_vm_readpages( | |||
1440 | struct list_head *pages, | 1435 | struct list_head *pages, |
1441 | unsigned nr_pages) | 1436 | unsigned nr_pages) |
1442 | { | 1437 | { |
1443 | return mpage_readpages(mapping, pages, nr_pages, xfs_get_block); | 1438 | return mpage_readpages(mapping, pages, nr_pages, xfs_get_blocks); |
1444 | } | 1439 | } |
1445 | 1440 | ||
1446 | STATIC void | 1441 | STATIC void |
diff --git a/fs/xfs/linux-2.6/xfs_aops.h b/fs/xfs/linux-2.6/xfs_aops.h index 795699f121d2..60716543c68b 100644 --- a/fs/xfs/linux-2.6/xfs_aops.h +++ b/fs/xfs/linux-2.6/xfs_aops.h | |||
@@ -41,6 +41,6 @@ typedef struct xfs_ioend { | |||
41 | } xfs_ioend_t; | 41 | } xfs_ioend_t; |
42 | 42 | ||
43 | extern struct address_space_operations xfs_address_space_operations; | 43 | extern struct address_space_operations xfs_address_space_operations; |
44 | extern int xfs_get_block(struct inode *, sector_t, struct buffer_head *, int); | 44 | extern int xfs_get_blocks(struct inode *, sector_t, struct buffer_head *, int); |
45 | 45 | ||
46 | #endif /* __XFS_IOPS_H__ */ | 46 | #endif /* __XFS_IOPS_H__ */ |
diff --git a/fs/xfs/linux-2.6/xfs_export.h b/fs/xfs/linux-2.6/xfs_export.h index e5b0559700a4..e794ca4efc76 100644 --- a/fs/xfs/linux-2.6/xfs_export.h +++ b/fs/xfs/linux-2.6/xfs_export.h | |||
@@ -54,7 +54,7 @@ | |||
54 | * Note, the NFS filehandle also includes an fsid portion which | 54 | * Note, the NFS filehandle also includes an fsid portion which |
55 | * may have an inode number in it. That number is hardcoded to | 55 | * may have an inode number in it. That number is hardcoded to |
56 | * 32bits and there is no way for XFS to intercept it. In | 56 | * 32bits and there is no way for XFS to intercept it. In |
57 | * practice this means when exporting an XFS filesytem with 64bit | 57 | * practice this means when exporting an XFS filesystem with 64bit |
58 | * inodes you should either export the mountpoint (rather than | 58 | * inodes you should either export the mountpoint (rather than |
59 | * a subdirectory) or use the "fsid" export option. | 59 | * a subdirectory) or use the "fsid" export option. |
60 | */ | 60 | */ |
diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c index b6321abd9a81..251bfe451a3f 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl32.c +++ b/fs/xfs/linux-2.6/xfs_ioctl32.c | |||
@@ -72,7 +72,7 @@ xfs_ioctl32_flock( | |||
72 | copy_in_user(&p->l_pid, &p32->l_pid, sizeof(u32)) || | 72 | copy_in_user(&p->l_pid, &p32->l_pid, sizeof(u32)) || |
73 | copy_in_user(&p->l_pad, &p32->l_pad, 4*sizeof(u32))) | 73 | copy_in_user(&p->l_pad, &p32->l_pad, 4*sizeof(u32))) |
74 | return -EFAULT; | 74 | return -EFAULT; |
75 | 75 | ||
76 | return (unsigned long)p; | 76 | return (unsigned long)p; |
77 | } | 77 | } |
78 | 78 | ||
@@ -107,11 +107,15 @@ xfs_ioctl32_bulkstat( | |||
107 | #endif | 107 | #endif |
108 | 108 | ||
109 | STATIC long | 109 | STATIC long |
110 | xfs_compat_ioctl(int mode, struct file *f, unsigned cmd, unsigned long arg) | 110 | xfs_compat_ioctl( |
111 | int mode, | ||
112 | struct file *file, | ||
113 | unsigned cmd, | ||
114 | unsigned long arg) | ||
111 | { | 115 | { |
116 | struct inode *inode = file->f_dentry->d_inode; | ||
117 | vnode_t *vp = vn_from_inode(inode); | ||
112 | int error; | 118 | int error; |
113 | struct inode *inode = f->f_dentry->d_inode; | ||
114 | vnode_t *vp = vn_to_inode(inode); | ||
115 | 119 | ||
116 | switch (cmd) { | 120 | switch (cmd) { |
117 | case XFS_IOC_DIOINFO: | 121 | case XFS_IOC_DIOINFO: |
@@ -189,7 +193,7 @@ xfs_compat_ioctl(int mode, struct file *f, unsigned cmd, unsigned long arg) | |||
189 | return -ENOIOCTLCMD; | 193 | return -ENOIOCTLCMD; |
190 | } | 194 | } |
191 | 195 | ||
192 | VOP_IOCTL(vp, inode, f, mode, cmd, (void __user *)arg, error); | 196 | VOP_IOCTL(vp, inode, file, mode, cmd, (void __user *)arg, error); |
193 | VMODIFY(vp); | 197 | VMODIFY(vp); |
194 | 198 | ||
195 | return error; | 199 | return error; |
@@ -197,18 +201,18 @@ xfs_compat_ioctl(int mode, struct file *f, unsigned cmd, unsigned long arg) | |||
197 | 201 | ||
198 | long | 202 | long |
199 | xfs_file_compat_ioctl( | 203 | xfs_file_compat_ioctl( |
200 | struct file *f, | 204 | struct file *file, |
201 | unsigned cmd, | 205 | unsigned cmd, |
202 | unsigned long arg) | 206 | unsigned long arg) |
203 | { | 207 | { |
204 | return xfs_compat_ioctl(0, f, cmd, arg); | 208 | return xfs_compat_ioctl(0, file, cmd, arg); |
205 | } | 209 | } |
206 | 210 | ||
207 | long | 211 | long |
208 | xfs_file_compat_invis_ioctl( | 212 | xfs_file_compat_invis_ioctl( |
209 | struct file *f, | 213 | struct file *file, |
210 | unsigned cmd, | 214 | unsigned cmd, |
211 | unsigned long arg) | 215 | unsigned long arg) |
212 | { | 216 | { |
213 | return xfs_compat_ioctl(IO_INVIS, f, cmd, arg); | 217 | return xfs_compat_ioctl(IO_INVIS, file, cmd, arg); |
214 | } | 218 | } |
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index af487437bd7e..149237304fb6 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -708,7 +708,7 @@ STATIC void | |||
708 | xfs_vn_truncate( | 708 | xfs_vn_truncate( |
709 | struct inode *inode) | 709 | struct inode *inode) |
710 | { | 710 | { |
711 | block_truncate_page(inode->i_mapping, inode->i_size, xfs_get_block); | 711 | block_truncate_page(inode->i_mapping, inode->i_size, xfs_get_blocks); |
712 | } | 712 | } |
713 | 713 | ||
714 | STATIC int | 714 | STATIC int |
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 0169360475c4..84ddf1893894 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c | |||
@@ -681,7 +681,7 @@ start: | |||
681 | eventsent = 1; | 681 | eventsent = 1; |
682 | 682 | ||
683 | /* | 683 | /* |
684 | * The iolock was dropped and reaquired in XFS_SEND_DATA | 684 | * The iolock was dropped and reacquired in XFS_SEND_DATA |
685 | * so we have to recheck the size when appending. | 685 | * so we have to recheck the size when appending. |
686 | * We will only "goto start;" once, since having sent the | 686 | * We will only "goto start;" once, since having sent the |
687 | * event prevents another call to XFS_SEND_DATA, which is | 687 | * event prevents another call to XFS_SEND_DATA, which is |
diff --git a/fs/xfs/linux-2.6/xfs_vfs.h b/fs/xfs/linux-2.6/xfs_vfs.h index 8fed356db055..841200c03092 100644 --- a/fs/xfs/linux-2.6/xfs_vfs.h +++ b/fs/xfs/linux-2.6/xfs_vfs.h | |||
@@ -92,7 +92,7 @@ typedef enum { | |||
92 | #define SYNC_FSDATA 0x0020 /* flush fs data (e.g. superblocks) */ | 92 | #define SYNC_FSDATA 0x0020 /* flush fs data (e.g. superblocks) */ |
93 | #define SYNC_REFCACHE 0x0040 /* prune some of the nfs ref cache */ | 93 | #define SYNC_REFCACHE 0x0040 /* prune some of the nfs ref cache */ |
94 | #define SYNC_REMOUNT 0x0080 /* remount readonly, no dummy LRs */ | 94 | #define SYNC_REMOUNT 0x0080 /* remount readonly, no dummy LRs */ |
95 | #define SYNC_QUIESCE 0x0100 /* quiesce fileystem for a snapshot */ | 95 | #define SYNC_QUIESCE 0x0100 /* quiesce filesystem for a snapshot */ |
96 | 96 | ||
97 | typedef int (*vfs_mount_t)(bhv_desc_t *, | 97 | typedef int (*vfs_mount_t)(bhv_desc_t *, |
98 | struct xfs_mount_args *, struct cred *); | 98 | struct xfs_mount_args *, struct cred *); |