Skip to content

Commit e71ac60

Browse files
author
Linus Torvalds
committed
Merge git://oss.sgi.com:8090/oss/git/xfs-2.6
* git://oss.sgi.com:8090/oss/git/xfs-2.6: [XFS] Cleanup in XFS after recent get_block_t interface tweaks. [XFS] Remove unused/obsoleted function: xfs_bmap_do_search_extents() [XFS] A change to inode chunk allocation to try allocating the new chunk Fixes a regression from the recent "remove ->get_blocks() support" [XFS] Fix compiler warning and small code inconsistencies in compat [XFS] We really suck at spulling. Thanks to Chris Pascoe for fixing all
2 parents 224b148 + c253666 commit e71ac60

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+204
-291
lines changed

fs/direct-io.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,6 @@ static int get_more_blocks(struct dio *dio)
524524
*/
525525
ret = dio->page_errors;
526526
if (ret == 0) {
527-
map_bh->b_state = 0;
528-
map_bh->b_size = 0;
529527
BUG_ON(dio->block_in_file >= dio->final_block_in_request);
530528
fs_startblk = dio->block_in_file >> dio->blkfactor;
531529
dio_count = dio->final_block_in_request - dio->block_in_file;
@@ -534,6 +532,9 @@ static int get_more_blocks(struct dio *dio)
534532
if (dio_count & blkmask)
535533
fs_count++;
536534

535+
map_bh->b_state = 0;
536+
map_bh->b_size = fs_count << dio->inode->i_blkbits;
537+
537538
create = dio->rw == WRITE;
538539
if (dio->lock_type == DIO_LOCKING) {
539540
if (dio->block_in_file < (i_size_read(dio->inode) >>
@@ -542,13 +543,13 @@ static int get_more_blocks(struct dio *dio)
542543
} else if (dio->lock_type == DIO_NO_LOCKING) {
543544
create = 0;
544545
}
546+
545547
/*
546548
* For writes inside i_size we forbid block creations: only
547549
* overwrites are permitted. We fall back to buffered writes
548550
* at a higher level for inside-i_size block-instantiating
549551
* writes.
550552
*/
551-
map_bh->b_size = fs_count << dio->blkbits;
552553
ret = (*dio->get_block)(dio->inode, fs_startblk,
553554
map_bh, create);
554555
}

fs/xfs/linux-2.6/mrlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static inline void mrdemote(mrlock_t *mrp)
7979
* Debug-only routine, without some platform-specific asm code, we can
8080
* now only answer requests regarding whether we hold the lock for write
8181
* (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.
8383
*/
8484
static inline int ismrlocked(mrlock_t *mrp, int type)
8585
{

fs/xfs/linux-2.6/xfs_aops.c

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ static inline int bio_add_buffer(struct bio *bio, struct buffer_head *bh)
372372
* assumes that all buffers on the page are started at the same time.
373373
*
374374
* 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.
376376
*/
377377
STATIC void
378378
xfs_submit_ioend(
@@ -699,7 +699,7 @@ xfs_convert_page(
699699

700700
/*
701701
* 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.
703703
*
704704
* Derivation:
705705
*
@@ -842,7 +842,7 @@ xfs_cluster_write(
842842
* page if possible.
843843
* The bh->b_state's cannot know if any of the blocks or which block for
844844
* 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
846846
* may clear the page dirty flag prior to calling write page, under the
847847
* assumption the entire page will be written out; by not writing out the
848848
* whole page the page can be reused before all valid dirty data is
@@ -892,7 +892,7 @@ xfs_page_state_convert(
892892

893893
/*
894894
* 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.
896896
*
897897
* Derivation:
898898
*
@@ -1223,10 +1223,9 @@ xfs_vm_releasepage(
12231223
}
12241224

12251225
STATIC int
1226-
__xfs_get_block(
1226+
__xfs_get_blocks(
12271227
struct inode *inode,
12281228
sector_t iblock,
1229-
unsigned long blocks,
12301229
struct buffer_head *bh_result,
12311230
int create,
12321231
int direct,
@@ -1236,22 +1235,17 @@ __xfs_get_block(
12361235
xfs_iomap_t iomap;
12371236
xfs_off_t offset;
12381237
ssize_t size;
1239-
int retpbbm = 1;
1238+
int niomap = 1;
12401239
int error;
12411240

12421241
offset = (xfs_off_t)iblock << inode->i_blkbits;
1243-
if (blocks)
1244-
size = (ssize_t) min_t(xfs_off_t, LONG_MAX,
1245-
(xfs_off_t)blocks << inode->i_blkbits);
1246-
else
1247-
size = 1 << inode->i_blkbits;
1248-
1242+
ASSERT(bh_result->b_size >= (1 << inode->i_blkbits));
1243+
size = bh_result->b_size;
12491244
VOP_BMAP(vp, offset, size,
1250-
create ? flags : BMAPI_READ, &iomap, &retpbbm, error);
1245+
create ? flags : BMAPI_READ, &iomap, &niomap, error);
12511246
if (error)
12521247
return -error;
1253-
1254-
if (retpbbm == 0)
1248+
if (niomap == 0)
12551249
return 0;
12561250

12571251
if (iomap.iomap_bn != IOMAP_DADDR_NULL) {
@@ -1271,12 +1265,16 @@ __xfs_get_block(
12711265
}
12721266
}
12731267

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+
*/
12751272
bh_result->b_bdev = iomap.iomap_target->bt_bdev;
12761273

1277-
/* If we previously allocated a block out beyond eof and
1278-
* we are now coming back to use it then we will need to
1279-
* flag it as new even if it has a disk address.
1274+
/*
1275+
* If we previously allocated a block out beyond eof and we are
1276+
* now coming back to use it then we will need to flag it as new
1277+
* even if it has a disk address.
12801278
*/
12811279
if (create &&
12821280
((!buffer_mapped(bh_result) && !buffer_uptodate(bh_result)) ||
@@ -1292,26 +1290,24 @@ __xfs_get_block(
12921290
}
12931291
}
12941292

1295-
if (blocks) {
1293+
if (direct || size > (1 << inode->i_blkbits)) {
12961294
ASSERT(iomap.iomap_bsize - iomap.iomap_delta > 0);
12971295
offset = min_t(xfs_off_t,
1298-
iomap.iomap_bsize - iomap.iomap_delta,
1299-
(xfs_off_t)blocks << inode->i_blkbits);
1300-
bh_result->b_size = (u32) min_t(xfs_off_t, UINT_MAX, offset);
1296+
iomap.iomap_bsize - iomap.iomap_delta, size);
1297+
bh_result->b_size = (ssize_t)min_t(xfs_off_t, LONG_MAX, offset);
13011298
}
13021299

13031300
return 0;
13041301
}
13051302

13061303
int
1307-
xfs_get_block(
1304+
xfs_get_blocks(
13081305
struct inode *inode,
13091306
sector_t iblock,
13101307
struct buffer_head *bh_result,
13111308
int create)
13121309
{
1313-
return __xfs_get_block(inode, iblock,
1314-
bh_result->b_size >> inode->i_blkbits,
1310+
return __xfs_get_blocks(inode, iblock,
13151311
bh_result, create, 0, BMAPI_WRITE);
13161312
}
13171313

@@ -1322,8 +1318,7 @@ xfs_get_blocks_direct(
13221318
struct buffer_head *bh_result,
13231319
int create)
13241320
{
1325-
return __xfs_get_block(inode, iblock,
1326-
bh_result->b_size >> inode->i_blkbits,
1321+
return __xfs_get_blocks(inode, iblock,
13271322
bh_result, create, 1, BMAPI_WRITE|BMAPI_DIRECT);
13281323
}
13291324

@@ -1339,9 +1334,9 @@ xfs_end_io_direct(
13391334
/*
13401335
* Non-NULL private data means we need to issue a transaction to
13411336
* 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
13431338
* 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
13451340
* it anyway to keep the code uniform and simpler.
13461341
*
13471342
* The core direct I/O code might be changed to always call the
@@ -1358,7 +1353,7 @@ xfs_end_io_direct(
13581353
}
13591354

13601355
/*
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
13621357
* completion handler was called. Thus we need to protect
13631358
* against double-freeing.
13641359
*/
@@ -1405,7 +1400,7 @@ xfs_vm_prepare_write(
14051400
unsigned int from,
14061401
unsigned int to)
14071402
{
1408-
return block_prepare_write(page, from, to, xfs_get_block);
1403+
return block_prepare_write(page, from, to, xfs_get_blocks);
14091404
}
14101405

14111406
STATIC sector_t
@@ -1422,15 +1417,15 @@ xfs_vm_bmap(
14221417
VOP_RWLOCK(vp, VRWLOCK_READ);
14231418
VOP_FLUSH_PAGES(vp, (xfs_off_t)0, -1, 0, FI_REMAPF, error);
14241419
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);
14261421
}
14271422

14281423
STATIC int
14291424
xfs_vm_readpage(
14301425
struct file *unused,
14311426
struct page *page)
14321427
{
1433-
return mpage_readpage(page, xfs_get_block);
1428+
return mpage_readpage(page, xfs_get_blocks);
14341429
}
14351430

14361431
STATIC int
@@ -1440,7 +1435,7 @@ xfs_vm_readpages(
14401435
struct list_head *pages,
14411436
unsigned nr_pages)
14421437
{
1443-
return mpage_readpages(mapping, pages, nr_pages, xfs_get_block);
1438+
return mpage_readpages(mapping, pages, nr_pages, xfs_get_blocks);
14441439
}
14451440

14461441
STATIC void

fs/xfs/linux-2.6/xfs_aops.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ typedef struct xfs_ioend {
4141
} xfs_ioend_t;
4242

4343
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);
4545

4646
#endif /* __XFS_IOPS_H__ */

fs/xfs/linux-2.6/xfs_export.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
* Note, the NFS filehandle also includes an fsid portion which
5555
* may have an inode number in it. That number is hardcoded to
5656
* 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
5858
* inodes you should either export the mountpoint (rather than
5959
* a subdirectory) or use the "fsid" export option.
6060
*/

fs/xfs/linux-2.6/xfs_ioctl32.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ xfs_ioctl32_flock(
7272
copy_in_user(&p->l_pid, &p32->l_pid, sizeof(u32)) ||
7373
copy_in_user(&p->l_pad, &p32->l_pad, 4*sizeof(u32)))
7474
return -EFAULT;
75-
75+
7676
return (unsigned long)p;
7777
}
7878

@@ -107,11 +107,15 @@ xfs_ioctl32_bulkstat(
107107
#endif
108108

109109
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)
111115
{
116+
struct inode *inode = file->f_dentry->d_inode;
117+
vnode_t *vp = vn_from_inode(inode);
112118
int error;
113-
struct inode *inode = f->f_dentry->d_inode;
114-
vnode_t *vp = vn_to_inode(inode);
115119

116120
switch (cmd) {
117121
case XFS_IOC_DIOINFO:
@@ -189,26 +193,26 @@ xfs_compat_ioctl(int mode, struct file *f, unsigned cmd, unsigned long arg)
189193
return -ENOIOCTLCMD;
190194
}
191195

192-
VOP_IOCTL(vp, inode, f, mode, cmd, (void __user *)arg, error);
196+
VOP_IOCTL(vp, inode, file, mode, cmd, (void __user *)arg, error);
193197
VMODIFY(vp);
194198

195199
return error;
196200
}
197201

198202
long
199203
xfs_file_compat_ioctl(
200-
struct file *f,
204+
struct file *file,
201205
unsigned cmd,
202206
unsigned long arg)
203207
{
204-
return xfs_compat_ioctl(0, f, cmd, arg);
208+
return xfs_compat_ioctl(0, file, cmd, arg);
205209
}
206210

207211
long
208212
xfs_file_compat_invis_ioctl(
209-
struct file *f,
213+
struct file *file,
210214
unsigned cmd,
211215
unsigned long arg)
212216
{
213-
return xfs_compat_ioctl(IO_INVIS, f, cmd, arg);
217+
return xfs_compat_ioctl(IO_INVIS, file, cmd, arg);
214218
}

fs/xfs/linux-2.6/xfs_iops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ STATIC void
708708
xfs_vn_truncate(
709709
struct inode *inode)
710710
{
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);
712712
}
713713

714714
STATIC int

fs/xfs/linux-2.6/xfs_lrw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ xfs_write(
681681
eventsent = 1;
682682

683683
/*
684-
* The iolock was dropped and reaquired in XFS_SEND_DATA
684+
* The iolock was dropped and reacquired in XFS_SEND_DATA
685685
* so we have to recheck the size when appending.
686686
* We will only "goto start;" once, since having sent the
687687
* event prevents another call to XFS_SEND_DATA, which is

fs/xfs/linux-2.6/xfs_vfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ typedef enum {
9292
#define SYNC_FSDATA 0x0020 /* flush fs data (e.g. superblocks) */
9393
#define SYNC_REFCACHE 0x0040 /* prune some of the nfs ref cache */
9494
#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 */
9696

9797
typedef int (*vfs_mount_t)(bhv_desc_t *,
9898
struct xfs_mount_args *, struct cred *);

fs/xfs/quota/xfs_dquot_item.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ xfs_qm_dqunpin_wait(
221221
* as possible.
222222
*
223223
* We must not be holding the AIL_LOCK at this point. Calling incore() to
224-
* search the buffercache can be a time consuming thing, and AIL_LOCK is a
224+
* search the buffer cache can be a time consuming thing, and AIL_LOCK is a
225225
* spinlock.
226226
*/
227227
STATIC void

0 commit comments

Comments
 (0)