* [PATCH 0/7] assorted cleanups
@ 2009-11-14 16:17 Christoph Hellwig
2009-11-14 16:17 ` [PATCH 1/7] xfs: remove IO_ISAIO Christoph Hellwig
` (6 more replies)
0 siblings, 7 replies; 22+ messages in thread
From: Christoph Hellwig @ 2009-11-14 16:17 UTC (permalink / raw)
To: xfs
This series has a couple of minor cleanups which have been lingering around in
my tree for a while. None of them should cause any change in behaviour.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 22+ messages in thread* [PATCH 1/7] xfs: remove IO_ISAIO 2009-11-14 16:17 [PATCH 0/7] assorted cleanups Christoph Hellwig @ 2009-11-14 16:17 ` Christoph Hellwig 2009-11-16 3:05 ` Dave Chinner 2009-11-19 4:36 ` Eric Sandeen 2009-11-14 16:17 ` [PATCH 2/7] xfs: remove xfs_buf_get / xfs_buf_read Christoph Hellwig ` (5 subsequent siblings) 6 siblings, 2 replies; 22+ messages in thread From: Christoph Hellwig @ 2009-11-14 16:17 UTC (permalink / raw) To: xfs [-- Attachment #1: xfs-kill-IO_ISAIO --] [-- Type: text/plain, Size: 2307 bytes --] We set this flag for all read/write I/O since early Linux 2.6.x. Remove it as it has lost it's purpose long ago. Signed-off-by: Christoph Hellwig <hch@lst.de> Index: xfs/fs/xfs/linux-2.6/xfs_file.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_file.c 2009-10-11 14:25:17.496003686 +0200 +++ xfs/fs/xfs/linux-2.6/xfs_file.c 2009-11-12 17:14:06.160023109 +0100 @@ -52,7 +52,7 @@ xfs_file_aio_read( loff_t pos) { struct file *file = iocb->ki_filp; - int ioflags = IO_ISAIO; + int ioflags = 0; BUG_ON(iocb->ki_pos != pos); if (unlikely(file->f_flags & O_DIRECT)) @@ -71,7 +71,7 @@ xfs_file_aio_write( loff_t pos) { struct file *file = iocb->ki_filp; - int ioflags = IO_ISAIO; + int ioflags = 0; BUG_ON(iocb->ki_pos != pos); if (unlikely(file->f_flags & O_DIRECT)) Index: xfs/fs/xfs/linux-2.6/xfs_lrw.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_lrw.c 2009-11-12 17:10:19.909278501 +0100 +++ xfs/fs/xfs/linux-2.6/xfs_lrw.c 2009-11-12 17:14:06.161003891 +0100 @@ -255,8 +255,6 @@ xfs_read( iocb->ki_pos = *offset; ret = generic_file_aio_read(iocb, iovp, segs, *offset); - if (ret == -EIOCBQUEUED && !(ioflags & IO_ISAIO)) - ret = wait_on_sync_kiocb(iocb); if (ret > 0) XFS_STATS_ADD(xs_read_bytes, ret); @@ -774,9 +772,6 @@ write_retry: current->backing_dev_info = NULL; - if (ret == -EIOCBQUEUED && !(ioflags & IO_ISAIO)) - ret = wait_on_sync_kiocb(iocb); - isize = i_size_read(inode); if (unlikely(ret < 0 && ret != -EFAULT && *offset > isize)) *offset = isize; Index: xfs/fs/xfs/linux-2.6/xfs_vnode.h =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2009-11-12 17:10:19.942276910 +0100 +++ xfs/fs/xfs/linux-2.6/xfs_vnode.h 2009-11-12 17:14:06.161003891 +0100 @@ -36,7 +36,6 @@ struct attrlist_cursor_kern; /* * Flags for read/write calls - same values as IRIX */ -#define IO_ISAIO 0x00001 /* don't wait for completion */ #define IO_ISDIRECT 0x00004 /* bypass page cache */ #define IO_INVIS 0x00020 /* don't update inode timestamps */ _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 1/7] xfs: remove IO_ISAIO 2009-11-14 16:17 ` [PATCH 1/7] xfs: remove IO_ISAIO Christoph Hellwig @ 2009-11-16 3:05 ` Dave Chinner 2009-11-19 4:36 ` Eric Sandeen 1 sibling, 0 replies; 22+ messages in thread From: Dave Chinner @ 2009-11-16 3:05 UTC (permalink / raw) To: Christoph Hellwig; +Cc: xfs On Sat, Nov 14, 2009 at 11:17:18AM -0500, Christoph Hellwig wrote: > We set this flag for all read/write I/O since early Linux 2.6.x. > Remove it as it has lost it's purpose long ago. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Looks good. Reviewed-by: Dave Chinner <david@fromorbit.com> -- Dave Chinner david@fromorbit.com _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 1/7] xfs: remove IO_ISAIO 2009-11-14 16:17 ` [PATCH 1/7] xfs: remove IO_ISAIO Christoph Hellwig 2009-11-16 3:05 ` Dave Chinner @ 2009-11-19 4:36 ` Eric Sandeen 1 sibling, 0 replies; 22+ messages in thread From: Eric Sandeen @ 2009-11-19 4:36 UTC (permalink / raw) To: Christoph Hellwig; +Cc: xfs Christoph Hellwig wrote: Looks fine to me. > We set this flag for all read/write I/O since early Linux 2.6.x. > Remove it as it has lost it's purpose long ago. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net> > Index: xfs/fs/xfs/linux-2.6/xfs_file.c > =================================================================== > --- xfs.orig/fs/xfs/linux-2.6/xfs_file.c 2009-10-11 14:25:17.496003686 +0200 > +++ xfs/fs/xfs/linux-2.6/xfs_file.c 2009-11-12 17:14:06.160023109 +0100 > @@ -52,7 +52,7 @@ xfs_file_aio_read( > loff_t pos) > { > struct file *file = iocb->ki_filp; > - int ioflags = IO_ISAIO; > + int ioflags = 0; > > BUG_ON(iocb->ki_pos != pos); > if (unlikely(file->f_flags & O_DIRECT)) > @@ -71,7 +71,7 @@ xfs_file_aio_write( > loff_t pos) > { > struct file *file = iocb->ki_filp; > - int ioflags = IO_ISAIO; > + int ioflags = 0; > > BUG_ON(iocb->ki_pos != pos); > if (unlikely(file->f_flags & O_DIRECT)) > Index: xfs/fs/xfs/linux-2.6/xfs_lrw.c > =================================================================== > --- xfs.orig/fs/xfs/linux-2.6/xfs_lrw.c 2009-11-12 17:10:19.909278501 +0100 > +++ xfs/fs/xfs/linux-2.6/xfs_lrw.c 2009-11-12 17:14:06.161003891 +0100 > @@ -255,8 +255,6 @@ xfs_read( > > iocb->ki_pos = *offset; > ret = generic_file_aio_read(iocb, iovp, segs, *offset); > - if (ret == -EIOCBQUEUED && !(ioflags & IO_ISAIO)) > - ret = wait_on_sync_kiocb(iocb); > if (ret > 0) > XFS_STATS_ADD(xs_read_bytes, ret); > > @@ -774,9 +772,6 @@ write_retry: > > current->backing_dev_info = NULL; > > - if (ret == -EIOCBQUEUED && !(ioflags & IO_ISAIO)) > - ret = wait_on_sync_kiocb(iocb); > - > isize = i_size_read(inode); > if (unlikely(ret < 0 && ret != -EFAULT && *offset > isize)) > *offset = isize; > Index: xfs/fs/xfs/linux-2.6/xfs_vnode.h > =================================================================== > --- xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2009-11-12 17:10:19.942276910 +0100 > +++ xfs/fs/xfs/linux-2.6/xfs_vnode.h 2009-11-12 17:14:06.161003891 +0100 > @@ -36,7 +36,6 @@ struct attrlist_cursor_kern; > /* > * Flags for read/write calls - same values as IRIX > */ > -#define IO_ISAIO 0x00001 /* don't wait for completion */ > #define IO_ISDIRECT 0x00004 /* bypass page cache */ > #define IO_INVIS 0x00020 /* don't update inode timestamps */ > > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 2/7] xfs: remove xfs_buf_get / xfs_buf_read 2009-11-14 16:17 [PATCH 0/7] assorted cleanups Christoph Hellwig 2009-11-14 16:17 ` [PATCH 1/7] xfs: remove IO_ISAIO Christoph Hellwig @ 2009-11-14 16:17 ` Christoph Hellwig 2009-11-16 3:15 ` Dave Chinner ` (2 more replies) 2009-11-14 16:17 ` [PATCH 3/7] xfs: rename xfs_attr_fetch to xfs_attr_get_int Christoph Hellwig ` (4 subsequent siblings) 6 siblings, 3 replies; 22+ messages in thread From: Christoph Hellwig @ 2009-11-14 16:17 UTC (permalink / raw) To: xfs [-- Attachment #1: xfs-kill-xfs_buf_read --] [-- Type: text/plain, Size: 5508 bytes --] The two interfaces are highl confusing as they do have a flags argument which gets ignored and replaced with default flags. Switch the few remaining callers to use xfs_buf_get_flags and xfs_buf_read_flags instead and remove these wrappers. Signed-off-by: Christoph Hellwig <hch@lst.de> Index: xfs/fs/xfs/linux-2.6/xfs_buf.h =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_buf.h 2009-11-12 17:13:55.334003777 +0100 +++ xfs/fs/xfs/linux-2.6/xfs_buf.h 2009-11-12 17:17:21.873006402 +0100 @@ -189,13 +189,8 @@ extern xfs_buf_t *_xfs_buf_find(xfs_buft extern xfs_buf_t *xfs_buf_get_flags(xfs_buftarg_t *, xfs_off_t, size_t, xfs_buf_flags_t); -#define xfs_buf_get(target, blkno, len, flags) \ - xfs_buf_get_flags((target), (blkno), (len), XBF_LOCK | XBF_MAPPED) - extern xfs_buf_t *xfs_buf_read_flags(xfs_buftarg_t *, xfs_off_t, size_t, xfs_buf_flags_t); -#define xfs_buf_read(target, blkno, len, flags) \ - xfs_buf_read_flags((target), (blkno), (len), XBF_LOCK | XBF_MAPPED) extern xfs_buf_t *xfs_buf_get_empty(size_t, xfs_buftarg_t *); extern xfs_buf_t *xfs_buf_get_noaddr(size_t, xfs_buftarg_t *); Index: xfs/fs/xfs/xfs_log_recover.c =================================================================== --- xfs.orig/fs/xfs/xfs_log_recover.c 2009-11-12 17:10:20.286254746 +0100 +++ xfs/fs/xfs/xfs_log_recover.c 2009-11-12 17:14:15.274004198 +0100 @@ -2206,6 +2206,7 @@ xlog_recover_do_buffer_trans( xfs_daddr_t blkno; int len; ushort flags; + uint buf_flags; buf_f = (xfs_buf_log_format_t *)item->ri_buf[0].i_addr; @@ -2246,12 +2247,11 @@ xlog_recover_do_buffer_trans( } mp = log->l_mp; - if (flags & XFS_BLI_INODE_BUF) { - bp = xfs_buf_read_flags(mp->m_ddev_targp, blkno, len, - XFS_BUF_LOCK); - } else { - bp = xfs_buf_read(mp->m_ddev_targp, blkno, len, 0); - } + buf_flags = XFS_BUF_LOCK; + if (!(flags & XFS_BLI_INODE_BUF)) + buf_flags |= XFS_BUF_MAPPED; + + bp = xfs_buf_read_flags(mp->m_ddev_targp, blkno, len, buf_flags); if (XFS_BUF_ISERROR(bp)) { xfs_ioerror_alert("xlog_recover_do..(read#1)", log->l_mp, bp, blkno); Index: xfs/fs/xfs/xfs_rw.c =================================================================== --- xfs.orig/fs/xfs/xfs_rw.c 2009-11-12 17:10:20.326254256 +0100 +++ xfs/fs/xfs/xfs_rw.c 2009-11-12 17:14:15.278004428 +0100 @@ -277,10 +277,10 @@ xfs_read_buf( xfs_buf_t *bp; int error; - if (flags) - bp = xfs_buf_read_flags(target, blkno, len, flags); - else - bp = xfs_buf_read(target, blkno, len, flags); + if (!flags) + flags = XBF_LOCK | XBF_MAPPED; + + bp = xfs_buf_read_flags(target, blkno, len, flags); if (!bp) return XFS_ERROR(EIO); error = XFS_BUF_GETERROR(bp); Index: xfs/fs/xfs/xfs_fsops.c =================================================================== --- xfs.orig/fs/xfs/xfs_fsops.c 2009-11-12 17:15:17.097272663 +0100 +++ xfs/fs/xfs/xfs_fsops.c 2009-11-12 17:16:53.487005554 +0100 @@ -200,9 +200,9 @@ xfs_growfs_data_private( /* * AG freelist header block */ - bp = xfs_buf_get(mp->m_ddev_targp, - XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)), - XFS_FSS_TO_BB(mp, 1), 0); + bp = xfs_buf_get_flags(mp->m_ddev_targp, + XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)), + XFS_FSS_TO_BB(mp, 1), XBF_LOCK | XBF_MAPPED); agf = XFS_BUF_TO_AGF(bp); memset(agf, 0, mp->m_sb.sb_sectsize); agf->agf_magicnum = cpu_to_be32(XFS_AGF_MAGIC); @@ -232,9 +232,9 @@ xfs_growfs_data_private( /* * AG inode header block */ - bp = xfs_buf_get(mp->m_ddev_targp, - XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), - XFS_FSS_TO_BB(mp, 1), 0); + bp = xfs_buf_get_flags(mp->m_ddev_targp, + XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), + XFS_FSS_TO_BB(mp, 1), XBF_LOCK | XBF_MAPPED); agi = XFS_BUF_TO_AGI(bp); memset(agi, 0, mp->m_sb.sb_sectsize); agi->agi_magicnum = cpu_to_be32(XFS_AGI_MAGIC); @@ -256,9 +256,9 @@ xfs_growfs_data_private( /* * BNO btree root block */ - bp = xfs_buf_get(mp->m_ddev_targp, - XFS_AGB_TO_DADDR(mp, agno, XFS_BNO_BLOCK(mp)), - BTOBB(mp->m_sb.sb_blocksize), 0); + bp = xfs_buf_get_flags(mp->m_ddev_targp, + XFS_AGB_TO_DADDR(mp, agno, XFS_BNO_BLOCK(mp)), + BTOBB(mp->m_sb.sb_blocksize), XBF_LOCK | XBF_MAPPED); block = XFS_BUF_TO_BLOCK(bp); memset(block, 0, mp->m_sb.sb_blocksize); block->bb_magic = cpu_to_be32(XFS_ABTB_MAGIC); @@ -277,9 +277,9 @@ xfs_growfs_data_private( /* * CNT btree root block */ - bp = xfs_buf_get(mp->m_ddev_targp, - XFS_AGB_TO_DADDR(mp, agno, XFS_CNT_BLOCK(mp)), - BTOBB(mp->m_sb.sb_blocksize), 0); + bp = xfs_buf_get_flags(mp->m_ddev_targp, + XFS_AGB_TO_DADDR(mp, agno, XFS_CNT_BLOCK(mp)), + BTOBB(mp->m_sb.sb_blocksize), XBF_LOCK | XBF_MAPPED); block = XFS_BUF_TO_BLOCK(bp); memset(block, 0, mp->m_sb.sb_blocksize); block->bb_magic = cpu_to_be32(XFS_ABTC_MAGIC); @@ -299,9 +299,9 @@ xfs_growfs_data_private( /* * INO btree root block */ - bp = xfs_buf_get(mp->m_ddev_targp, - XFS_AGB_TO_DADDR(mp, agno, XFS_IBT_BLOCK(mp)), - BTOBB(mp->m_sb.sb_blocksize), 0); + bp = xfs_buf_get_flags(mp->m_ddev_targp, + XFS_AGB_TO_DADDR(mp, agno, XFS_IBT_BLOCK(mp)), + BTOBB(mp->m_sb.sb_blocksize), XBF_LOCK | XBF_MAPPED); block = XFS_BUF_TO_BLOCK(bp); memset(block, 0, mp->m_sb.sb_blocksize); block->bb_magic = cpu_to_be32(XFS_IBT_MAGIC); _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/7] xfs: remove xfs_buf_get / xfs_buf_read 2009-11-14 16:17 ` [PATCH 2/7] xfs: remove xfs_buf_get / xfs_buf_read Christoph Hellwig @ 2009-11-16 3:15 ` Dave Chinner 2009-11-16 11:03 ` Christoph Hellwig 2009-11-19 4:40 ` Eric Sandeen 2009-11-24 18:02 ` [PATCH v2 2/7] xfs: simplify xfs_buf_get / xfs_buf_read interfaces Christoph Hellwig 2 siblings, 1 reply; 22+ messages in thread From: Dave Chinner @ 2009-11-16 3:15 UTC (permalink / raw) To: Christoph Hellwig; +Cc: xfs On Sat, Nov 14, 2009 at 11:17:19AM -0500, Christoph Hellwig wrote: > The two interfaces are highl confusing as they do have a flags argument > which gets ignored and replaced with default flags. Switch the few remaining > callers to use xfs_buf_get_flags and xfs_buf_read_flags instead and remove > these wrappers. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Personally I would have dropped the *_flags from the function names as well (so everything calls xfs_buf_get() or xfs_buf_read()) but it doesn't really matter.... > /* > * BNO btree root block > */ > - bp = xfs_buf_get(mp->m_ddev_targp, > - XFS_AGB_TO_DADDR(mp, agno, XFS_BNO_BLOCK(mp)), > - BTOBB(mp->m_sb.sb_blocksize), 0); > + bp = xfs_buf_get_flags(mp->m_ddev_targp, > + XFS_AGB_TO_DADDR(mp, agno, XFS_BNO_BLOCK(mp)), > + BTOBB(mp->m_sb.sb_blocksize), XBF_LOCK | XBF_MAPPED); That looks wider than 80 columns. Same for the other conversions, too. Cheers, Dave. -- Dave Chinner david@fromorbit.com _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/7] xfs: remove xfs_buf_get / xfs_buf_read 2009-11-16 3:15 ` Dave Chinner @ 2009-11-16 11:03 ` Christoph Hellwig 0 siblings, 0 replies; 22+ messages in thread From: Christoph Hellwig @ 2009-11-16 11:03 UTC (permalink / raw) To: Dave Chinner; +Cc: Christoph Hellwig, xfs On Mon, Nov 16, 2009 at 02:15:12PM +1100, Dave Chinner wrote: > On Sat, Nov 14, 2009 at 11:17:19AM -0500, Christoph Hellwig wrote: > > The two interfaces are highl confusing as they do have a flags argument > > which gets ignored and replaced with default flags. Switch the few remaining > > callers to use xfs_buf_get_flags and xfs_buf_read_flags instead and remove > > these wrappers. > > > > Signed-off-by: Christoph Hellwig <hch@lst.de> > > Personally I would have dropped the *_flags from the function names > as well (so everything calls xfs_buf_get() or xfs_buf_read()) but > it doesn't really matter.... Maybe. The issue would be if we forward-port some code that expects it can pass random crap in the flags field will get different behaviour now. Then again it'll blow up fast enough to notice.. > > + XFS_AGB_TO_DADDR(mp, agno, XFS_BNO_BLOCK(mp)), > > + BTOBB(mp->m_sb.sb_blocksize), XBF_LOCK | XBF_MAPPED); > > That looks wider than 80 columns. Same for the other conversions, > too. I'll fix it. _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/7] xfs: remove xfs_buf_get / xfs_buf_read 2009-11-14 16:17 ` [PATCH 2/7] xfs: remove xfs_buf_get / xfs_buf_read Christoph Hellwig 2009-11-16 3:15 ` Dave Chinner @ 2009-11-19 4:40 ` Eric Sandeen 2009-11-24 18:02 ` [PATCH v2 2/7] xfs: simplify xfs_buf_get / xfs_buf_read interfaces Christoph Hellwig 2 siblings, 0 replies; 22+ messages in thread From: Eric Sandeen @ 2009-11-19 4:40 UTC (permalink / raw) To: Christoph Hellwig; +Cc: xfs Christoph Hellwig wrote: > The two interfaces are highl confusing as they do have a flags argument > which gets ignored and replaced with default flags. Switch the few remaining > callers to use xfs_buf_get_flags and xfs_buf_read_flags instead and remove > these wrappers. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net> > Index: xfs/fs/xfs/linux-2.6/xfs_buf.h > =================================================================== > --- xfs.orig/fs/xfs/linux-2.6/xfs_buf.h 2009-11-12 17:13:55.334003777 +0100 > +++ xfs/fs/xfs/linux-2.6/xfs_buf.h 2009-11-12 17:17:21.873006402 +0100 > @@ -189,13 +189,8 @@ extern xfs_buf_t *_xfs_buf_find(xfs_buft > > extern xfs_buf_t *xfs_buf_get_flags(xfs_buftarg_t *, xfs_off_t, size_t, > xfs_buf_flags_t); > -#define xfs_buf_get(target, blkno, len, flags) \ > - xfs_buf_get_flags((target), (blkno), (len), XBF_LOCK | XBF_MAPPED) > - > extern xfs_buf_t *xfs_buf_read_flags(xfs_buftarg_t *, xfs_off_t, size_t, > xfs_buf_flags_t); > -#define xfs_buf_read(target, blkno, len, flags) \ > - xfs_buf_read_flags((target), (blkno), (len), XBF_LOCK | XBF_MAPPED) > > extern xfs_buf_t *xfs_buf_get_empty(size_t, xfs_buftarg_t *); > extern xfs_buf_t *xfs_buf_get_noaddr(size_t, xfs_buftarg_t *); > Index: xfs/fs/xfs/xfs_log_recover.c > =================================================================== > --- xfs.orig/fs/xfs/xfs_log_recover.c 2009-11-12 17:10:20.286254746 +0100 > +++ xfs/fs/xfs/xfs_log_recover.c 2009-11-12 17:14:15.274004198 +0100 > @@ -2206,6 +2206,7 @@ xlog_recover_do_buffer_trans( > xfs_daddr_t blkno; > int len; > ushort flags; > + uint buf_flags; > > buf_f = (xfs_buf_log_format_t *)item->ri_buf[0].i_addr; > > @@ -2246,12 +2247,11 @@ xlog_recover_do_buffer_trans( > } > > mp = log->l_mp; > - if (flags & XFS_BLI_INODE_BUF) { > - bp = xfs_buf_read_flags(mp->m_ddev_targp, blkno, len, > - XFS_BUF_LOCK); > - } else { > - bp = xfs_buf_read(mp->m_ddev_targp, blkno, len, 0); > - } > + buf_flags = XFS_BUF_LOCK; > + if (!(flags & XFS_BLI_INODE_BUF)) > + buf_flags |= XFS_BUF_MAPPED; > + > + bp = xfs_buf_read_flags(mp->m_ddev_targp, blkno, len, buf_flags); > if (XFS_BUF_ISERROR(bp)) { > xfs_ioerror_alert("xlog_recover_do..(read#1)", log->l_mp, > bp, blkno); > Index: xfs/fs/xfs/xfs_rw.c > =================================================================== > --- xfs.orig/fs/xfs/xfs_rw.c 2009-11-12 17:10:20.326254256 +0100 > +++ xfs/fs/xfs/xfs_rw.c 2009-11-12 17:14:15.278004428 +0100 > @@ -277,10 +277,10 @@ xfs_read_buf( > xfs_buf_t *bp; > int error; > > - if (flags) > - bp = xfs_buf_read_flags(target, blkno, len, flags); > - else > - bp = xfs_buf_read(target, blkno, len, flags); > + if (!flags) > + flags = XBF_LOCK | XBF_MAPPED; > + > + bp = xfs_buf_read_flags(target, blkno, len, flags); > if (!bp) > return XFS_ERROR(EIO); > error = XFS_BUF_GETERROR(bp); > Index: xfs/fs/xfs/xfs_fsops.c > =================================================================== > --- xfs.orig/fs/xfs/xfs_fsops.c 2009-11-12 17:15:17.097272663 +0100 > +++ xfs/fs/xfs/xfs_fsops.c 2009-11-12 17:16:53.487005554 +0100 > @@ -200,9 +200,9 @@ xfs_growfs_data_private( > /* > * AG freelist header block > */ > - bp = xfs_buf_get(mp->m_ddev_targp, > - XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)), > - XFS_FSS_TO_BB(mp, 1), 0); > + bp = xfs_buf_get_flags(mp->m_ddev_targp, > + XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)), > + XFS_FSS_TO_BB(mp, 1), XBF_LOCK | XBF_MAPPED); > agf = XFS_BUF_TO_AGF(bp); > memset(agf, 0, mp->m_sb.sb_sectsize); > agf->agf_magicnum = cpu_to_be32(XFS_AGF_MAGIC); > @@ -232,9 +232,9 @@ xfs_growfs_data_private( > /* > * AG inode header block > */ > - bp = xfs_buf_get(mp->m_ddev_targp, > - XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), > - XFS_FSS_TO_BB(mp, 1), 0); > + bp = xfs_buf_get_flags(mp->m_ddev_targp, > + XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), > + XFS_FSS_TO_BB(mp, 1), XBF_LOCK | XBF_MAPPED); > agi = XFS_BUF_TO_AGI(bp); > memset(agi, 0, mp->m_sb.sb_sectsize); > agi->agi_magicnum = cpu_to_be32(XFS_AGI_MAGIC); > @@ -256,9 +256,9 @@ xfs_growfs_data_private( > /* > * BNO btree root block > */ > - bp = xfs_buf_get(mp->m_ddev_targp, > - XFS_AGB_TO_DADDR(mp, agno, XFS_BNO_BLOCK(mp)), > - BTOBB(mp->m_sb.sb_blocksize), 0); > + bp = xfs_buf_get_flags(mp->m_ddev_targp, > + XFS_AGB_TO_DADDR(mp, agno, XFS_BNO_BLOCK(mp)), > + BTOBB(mp->m_sb.sb_blocksize), XBF_LOCK | XBF_MAPPED); > block = XFS_BUF_TO_BLOCK(bp); > memset(block, 0, mp->m_sb.sb_blocksize); > block->bb_magic = cpu_to_be32(XFS_ABTB_MAGIC); > @@ -277,9 +277,9 @@ xfs_growfs_data_private( > /* > * CNT btree root block > */ > - bp = xfs_buf_get(mp->m_ddev_targp, > - XFS_AGB_TO_DADDR(mp, agno, XFS_CNT_BLOCK(mp)), > - BTOBB(mp->m_sb.sb_blocksize), 0); > + bp = xfs_buf_get_flags(mp->m_ddev_targp, > + XFS_AGB_TO_DADDR(mp, agno, XFS_CNT_BLOCK(mp)), > + BTOBB(mp->m_sb.sb_blocksize), XBF_LOCK | XBF_MAPPED); > block = XFS_BUF_TO_BLOCK(bp); > memset(block, 0, mp->m_sb.sb_blocksize); > block->bb_magic = cpu_to_be32(XFS_ABTC_MAGIC); > @@ -299,9 +299,9 @@ xfs_growfs_data_private( > /* > * INO btree root block > */ > - bp = xfs_buf_get(mp->m_ddev_targp, > - XFS_AGB_TO_DADDR(mp, agno, XFS_IBT_BLOCK(mp)), > - BTOBB(mp->m_sb.sb_blocksize), 0); > + bp = xfs_buf_get_flags(mp->m_ddev_targp, > + XFS_AGB_TO_DADDR(mp, agno, XFS_IBT_BLOCK(mp)), > + BTOBB(mp->m_sb.sb_blocksize), XBF_LOCK | XBF_MAPPED); > block = XFS_BUF_TO_BLOCK(bp); > memset(block, 0, mp->m_sb.sb_blocksize); > block->bb_magic = cpu_to_be32(XFS_IBT_MAGIC); > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v2 2/7] xfs: simplify xfs_buf_get / xfs_buf_read interfaces 2009-11-14 16:17 ` [PATCH 2/7] xfs: remove xfs_buf_get / xfs_buf_read Christoph Hellwig 2009-11-16 3:15 ` Dave Chinner 2009-11-19 4:40 ` Eric Sandeen @ 2009-11-24 18:02 ` Christoph Hellwig 2009-11-25 0:16 ` Dave Chinner 2 siblings, 1 reply; 22+ messages in thread From: Christoph Hellwig @ 2009-11-24 18:02 UTC (permalink / raw) To: xfs Currently these lowlevel buffer cache interfaces are highly confusing as we have a _flags variant of each that does actually respect the flags, and one without _flags which has a flags argument that gets ignored and overriden with a default set. Given that very few places use the default arguments get rid of the duplication and convert all callers to pass the flags explicitly. Also remove the now confusing _flags postfix. Signed-off-by: Christoph Hellwig <hch@lst.de> Index: xfs/fs/xfs/linux-2.6/xfs_buf.h =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_buf.h 2009-11-20 14:45:10.771004296 +0100 +++ xfs/fs/xfs/linux-2.6/xfs_buf.h 2009-11-20 14:51:49.614256096 +0100 @@ -187,15 +187,10 @@ extern xfs_buf_t *_xfs_buf_find(xfs_buft #define xfs_incore(buftarg,blkno,len,lockit) \ _xfs_buf_find(buftarg, blkno ,len, lockit, NULL) -extern xfs_buf_t *xfs_buf_get_flags(xfs_buftarg_t *, xfs_off_t, size_t, +extern xfs_buf_t *xfs_buf_get(xfs_buftarg_t *, xfs_off_t, size_t, xfs_buf_flags_t); -#define xfs_buf_get(target, blkno, len, flags) \ - xfs_buf_get_flags((target), (blkno), (len), XBF_LOCK | XBF_MAPPED) - -extern xfs_buf_t *xfs_buf_read_flags(xfs_buftarg_t *, xfs_off_t, size_t, +extern xfs_buf_t *xfs_buf_read(xfs_buftarg_t *, xfs_off_t, size_t, xfs_buf_flags_t); -#define xfs_buf_read(target, blkno, len, flags) \ - xfs_buf_read_flags((target), (blkno), (len), XBF_LOCK | XBF_MAPPED) extern xfs_buf_t *xfs_buf_get_empty(size_t, xfs_buftarg_t *); extern xfs_buf_t *xfs_buf_get_noaddr(size_t, xfs_buftarg_t *); Index: xfs/fs/xfs/xfs_log_recover.c =================================================================== --- xfs.orig/fs/xfs/xfs_log_recover.c 2009-11-20 14:45:10.776004095 +0100 +++ xfs/fs/xfs/xfs_log_recover.c 2009-11-20 14:48:01.412255985 +0100 @@ -2206,6 +2206,7 @@ xlog_recover_do_buffer_trans( xfs_daddr_t blkno; int len; ushort flags; + uint buf_flags; buf_f = (xfs_buf_log_format_t *)item->ri_buf[0].i_addr; @@ -2246,12 +2247,11 @@ xlog_recover_do_buffer_trans( } mp = log->l_mp; - if (flags & XFS_BLI_INODE_BUF) { - bp = xfs_buf_read_flags(mp->m_ddev_targp, blkno, len, - XFS_BUF_LOCK); - } else { - bp = xfs_buf_read(mp->m_ddev_targp, blkno, len, 0); - } + buf_flags = XFS_BUF_LOCK; + if (!(flags & XFS_BLI_INODE_BUF)) + buf_flags |= XFS_BUF_MAPPED; + + bp = xfs_buf_read(mp->m_ddev_targp, blkno, len, buf_flags); if (XFS_BUF_ISERROR(bp)) { xfs_ioerror_alert("xlog_recover_do..(read#1)", log->l_mp, bp, blkno); @@ -2350,8 +2350,8 @@ xlog_recover_do_inode_trans( goto error; } - bp = xfs_buf_read_flags(mp->m_ddev_targp, in_f->ilf_blkno, - in_f->ilf_len, XFS_BUF_LOCK); + bp = xfs_buf_read(mp->m_ddev_targp, in_f->ilf_blkno, in_f->ilf_len, + XFS_BUF_LOCK); if (XFS_BUF_ISERROR(bp)) { xfs_ioerror_alert("xlog_recover_do..(read#2)", mp, bp, in_f->ilf_blkno); Index: xfs/fs/xfs/xfs_rw.c =================================================================== --- xfs.orig/fs/xfs/xfs_rw.c 2009-11-20 14:45:10.781022821 +0100 +++ xfs/fs/xfs/xfs_rw.c 2009-11-20 14:47:08.756036097 +0100 @@ -277,10 +277,10 @@ xfs_read_buf( xfs_buf_t *bp; int error; - if (flags) - bp = xfs_buf_read_flags(target, blkno, len, flags); - else - bp = xfs_buf_read(target, blkno, len, flags); + if (!flags) + flags = XBF_LOCK | XBF_MAPPED; + + bp = xfs_buf_read(target, blkno, len, flags); if (!bp) return XFS_ERROR(EIO); error = XFS_BUF_GETERROR(bp); Index: xfs/fs/xfs/xfs_fsops.c =================================================================== --- xfs.orig/fs/xfs/xfs_fsops.c 2009-11-20 14:45:10.788004088 +0100 +++ xfs/fs/xfs/xfs_fsops.c 2009-11-20 14:50:40.324033258 +0100 @@ -201,8 +201,8 @@ xfs_growfs_data_private( * AG freelist header block */ bp = xfs_buf_get(mp->m_ddev_targp, - XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)), - XFS_FSS_TO_BB(mp, 1), 0); + XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)), + XFS_FSS_TO_BB(mp, 1), XBF_LOCK | XBF_MAPPED); agf = XFS_BUF_TO_AGF(bp); memset(agf, 0, mp->m_sb.sb_sectsize); agf->agf_magicnum = cpu_to_be32(XFS_AGF_MAGIC); @@ -233,8 +233,8 @@ xfs_growfs_data_private( * AG inode header block */ bp = xfs_buf_get(mp->m_ddev_targp, - XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), - XFS_FSS_TO_BB(mp, 1), 0); + XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), + XFS_FSS_TO_BB(mp, 1), XBF_LOCK | XBF_MAPPED); agi = XFS_BUF_TO_AGI(bp); memset(agi, 0, mp->m_sb.sb_sectsize); agi->agi_magicnum = cpu_to_be32(XFS_AGI_MAGIC); @@ -257,8 +257,9 @@ xfs_growfs_data_private( * BNO btree root block */ bp = xfs_buf_get(mp->m_ddev_targp, - XFS_AGB_TO_DADDR(mp, agno, XFS_BNO_BLOCK(mp)), - BTOBB(mp->m_sb.sb_blocksize), 0); + XFS_AGB_TO_DADDR(mp, agno, XFS_BNO_BLOCK(mp)), + BTOBB(mp->m_sb.sb_blocksize), + XBF_LOCK | XBF_MAPPED); block = XFS_BUF_TO_BLOCK(bp); memset(block, 0, mp->m_sb.sb_blocksize); block->bb_magic = cpu_to_be32(XFS_ABTB_MAGIC); @@ -278,8 +279,9 @@ xfs_growfs_data_private( * CNT btree root block */ bp = xfs_buf_get(mp->m_ddev_targp, - XFS_AGB_TO_DADDR(mp, agno, XFS_CNT_BLOCK(mp)), - BTOBB(mp->m_sb.sb_blocksize), 0); + XFS_AGB_TO_DADDR(mp, agno, XFS_CNT_BLOCK(mp)), + BTOBB(mp->m_sb.sb_blocksize), + XBF_LOCK | XBF_MAPPED); block = XFS_BUF_TO_BLOCK(bp); memset(block, 0, mp->m_sb.sb_blocksize); block->bb_magic = cpu_to_be32(XFS_ABTC_MAGIC); @@ -300,8 +302,9 @@ xfs_growfs_data_private( * INO btree root block */ bp = xfs_buf_get(mp->m_ddev_targp, - XFS_AGB_TO_DADDR(mp, agno, XFS_IBT_BLOCK(mp)), - BTOBB(mp->m_sb.sb_blocksize), 0); + XFS_AGB_TO_DADDR(mp, agno, XFS_IBT_BLOCK(mp)), + BTOBB(mp->m_sb.sb_blocksize), + XBF_LOCK | XBF_MAPPED); block = XFS_BUF_TO_BLOCK(bp); memset(block, 0, mp->m_sb.sb_blocksize); block->bb_magic = cpu_to_be32(XFS_IBT_MAGIC); Index: xfs/fs/xfs/linux-2.6/xfs_buf.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_buf.c 2009-11-20 14:48:08.972276171 +0100 +++ xfs/fs/xfs/linux-2.6/xfs_buf.c 2009-11-20 14:51:31.077256872 +0100 @@ -582,7 +582,7 @@ found: * although backing storage may not be. */ xfs_buf_t * -xfs_buf_get_flags( +xfs_buf_get( xfs_buftarg_t *target,/* target for buffer */ xfs_off_t ioff, /* starting offset of range */ size_t isize, /* length of range */ @@ -661,7 +661,7 @@ _xfs_buf_read( } xfs_buf_t * -xfs_buf_read_flags( +xfs_buf_read( xfs_buftarg_t *target, xfs_off_t ioff, size_t isize, @@ -671,7 +671,7 @@ xfs_buf_read_flags( flags |= XBF_READ; - bp = xfs_buf_get_flags(target, ioff, isize, flags); + bp = xfs_buf_get(target, ioff, isize, flags); if (bp) { if (!XFS_BUF_ISDONE(bp)) { XB_TRACE(bp, "read", (unsigned long)flags); @@ -718,7 +718,7 @@ xfs_buf_readahead( return; flags |= (XBF_TRYLOCK|XBF_ASYNC|XBF_READ_AHEAD); - xfs_buf_read_flags(target, ioff, isize, flags); + xfs_buf_read(target, ioff, isize, flags); } xfs_buf_t * Index: xfs/fs/xfs/xfs_attr.c =================================================================== --- xfs.orig/fs/xfs/xfs_attr.c 2009-11-20 14:49:18.048254421 +0100 +++ xfs/fs/xfs/xfs_attr.c 2009-11-20 14:51:13.539256422 +0100 @@ -2143,8 +2143,8 @@ xfs_attr_rmtval_set(xfs_da_args_t *args) dblkno = XFS_FSB_TO_DADDR(mp, map.br_startblock), blkcnt = XFS_FSB_TO_BB(mp, map.br_blockcount); - bp = xfs_buf_get_flags(mp->m_ddev_targp, dblkno, blkcnt, - XFS_BUF_LOCK | XBF_DONT_BLOCK); + bp = xfs_buf_get(mp->m_ddev_targp, dblkno, blkcnt, + XFS_BUF_LOCK | XBF_DONT_BLOCK); ASSERT(bp); ASSERT(!XFS_BUF_GETERROR(bp)); Index: xfs/fs/xfs/xfs_mount.c =================================================================== --- xfs.orig/fs/xfs/xfs_mount.c 2009-11-20 14:45:56.032003740 +0100 +++ xfs/fs/xfs/xfs_mount.c 2009-11-20 14:47:03.268005820 +0100 @@ -583,8 +583,8 @@ xfs_readsb(xfs_mount_t *mp, int flags) sector_size = xfs_getsize_buftarg(mp->m_ddev_targp); extra_flags = XFS_BUF_LOCK | XFS_BUF_MANAGE | XFS_BUF_MAPPED; - bp = xfs_buf_read_flags(mp->m_ddev_targp, XFS_SB_DADDR, - BTOBB(sector_size), extra_flags); + bp = xfs_buf_read(mp->m_ddev_targp, XFS_SB_DADDR, BTOBB(sector_size), + extra_flags); if (!bp || XFS_BUF_ISERROR(bp)) { xfs_fs_mount_cmn_err(flags, "SB read failed"); error = bp ? XFS_BUF_GETERROR(bp) : ENOMEM; @@ -624,8 +624,8 @@ xfs_readsb(xfs_mount_t *mp, int flags) XFS_BUF_UNMANAGE(bp); xfs_buf_relse(bp); sector_size = mp->m_sb.sb_sectsize; - bp = xfs_buf_read_flags(mp->m_ddev_targp, XFS_SB_DADDR, - BTOBB(sector_size), extra_flags); + bp = xfs_buf_read(mp->m_ddev_targp, XFS_SB_DADDR, + BTOBB(sector_size), extra_flags); if (!bp || XFS_BUF_ISERROR(bp)) { xfs_fs_mount_cmn_err(flags, "SB re-read failed"); error = bp ? XFS_BUF_GETERROR(bp) : ENOMEM; Index: xfs/fs/xfs/xfs_trans_buf.c =================================================================== --- xfs.orig/fs/xfs/xfs_trans_buf.c 2009-11-20 14:45:56.049003881 +0100 +++ xfs/fs/xfs/xfs_trans_buf.c 2009-11-20 14:51:59.741006218 +0100 @@ -79,11 +79,8 @@ xfs_trans_get_buf(xfs_trans_t *tp, /* * Default to a normal get_buf() call if the tp is NULL. */ - if (tp == NULL) { - bp = xfs_buf_get_flags(target_dev, blkno, len, - flags | BUF_BUSY); - return(bp); - } + if (tp == NULL) + return xfs_buf_get(target_dev, blkno, len, flags | BUF_BUSY); /* * If we find the buffer in the cache with this transaction @@ -129,7 +126,7 @@ xfs_trans_get_buf(xfs_trans_t *tp, * easily deadlock with our current transaction as well as cause * us to run out of stack space. */ - bp = xfs_buf_get_flags(target_dev, blkno, len, flags | BUF_BUSY); + bp = xfs_buf_get(target_dev, blkno, len, flags | BUF_BUSY); if (bp == NULL) { return NULL; } @@ -302,7 +299,7 @@ xfs_trans_read_buf( * Default to a normal get_buf() call if the tp is NULL. */ if (tp == NULL) { - bp = xfs_buf_read_flags(target, blkno, len, flags | BUF_BUSY); + bp = xfs_buf_read(target, blkno, len, flags | BUF_BUSY); if (!bp) return (flags & XFS_BUF_TRYLOCK) ? EAGAIN : XFS_ERROR(ENOMEM); @@ -398,7 +395,7 @@ xfs_trans_read_buf( * easily deadlock with our current transaction as well as cause * us to run out of stack space. */ - bp = xfs_buf_read_flags(target, blkno, len, flags | BUF_BUSY); + bp = xfs_buf_read(target, blkno, len, flags | BUF_BUSY); if (bp == NULL) { *bpp = NULL; return 0; Index: xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- xfs.orig/fs/xfs/xfs_vnodeops.c 2009-11-20 14:45:56.058003701 +0100 +++ xfs/fs/xfs/xfs_vnodeops.c 2009-11-20 14:47:59.262256187 +0100 @@ -538,9 +538,8 @@ xfs_readlink_bmap( d = XFS_FSB_TO_DADDR(mp, mval[n].br_startblock); byte_cnt = XFS_FSB_TO_B(mp, mval[n].br_blockcount); - bp = xfs_buf_read_flags(mp->m_ddev_targp, d, BTOBB(byte_cnt), - XBF_LOCK | XBF_MAPPED | - XBF_DONT_BLOCK); + bp = xfs_buf_read(mp->m_ddev_targp, d, BTOBB(byte_cnt), + XBF_LOCK | XBF_MAPPED | XBF_DONT_BLOCK); error = XFS_BUF_GETERROR(bp); if (error) { xfs_ioerror_alert("xfs_readlink", _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 2/7] xfs: simplify xfs_buf_get / xfs_buf_read interfaces 2009-11-24 18:02 ` [PATCH v2 2/7] xfs: simplify xfs_buf_get / xfs_buf_read interfaces Christoph Hellwig @ 2009-11-25 0:16 ` Dave Chinner 0 siblings, 0 replies; 22+ messages in thread From: Dave Chinner @ 2009-11-25 0:16 UTC (permalink / raw) To: Christoph Hellwig; +Cc: xfs On Tue, Nov 24, 2009 at 01:02:23PM -0500, Christoph Hellwig wrote: > > Currently these lowlevel buffer cache interfaces are highly confusing > as we have a _flags variant of each that does actually respect the flags, > and one without _flags which has a flags argument that gets ignored and > overriden with a default set. Given that very few places use the default > arguments get rid of the duplication and convert all callers to pass the > flags explicitly. Also remove the now confusing _flags postfix. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <david@fromorbit.com> -- Dave Chinner david@fromorbit.com _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 3/7] xfs: rename xfs_attr_fetch to xfs_attr_get_int 2009-11-14 16:17 [PATCH 0/7] assorted cleanups Christoph Hellwig 2009-11-14 16:17 ` [PATCH 1/7] xfs: remove IO_ISAIO Christoph Hellwig 2009-11-14 16:17 ` [PATCH 2/7] xfs: remove xfs_buf_get / xfs_buf_read Christoph Hellwig @ 2009-11-14 16:17 ` Christoph Hellwig 2009-11-16 3:17 ` Dave Chinner 2009-11-19 4:42 ` Eric Sandeen 2009-11-14 16:17 ` [PATCH 4/7] xfs: uninline xfs_get_extsz_hint Christoph Hellwig ` (3 subsequent siblings) 6 siblings, 2 replies; 22+ messages in thread From: Christoph Hellwig @ 2009-11-14 16:17 UTC (permalink / raw) To: xfs [-- Attachment #1: xfs_attr_get_int --] [-- Type: text/plain, Size: 1983 bytes --] Using a totally different name for the lowlevel get operation does not fit the _int convention used in the rest of the attr code, so rename it. While we're at it also fix the prototype to use the normal convention and mark it static as it's never used outside of xfs_attr.c. Signed-off-by: Christoph Hellwig <hch@lst.de> Index: xfs/fs/xfs/xfs_attr.c =================================================================== --- xfs.orig/fs/xfs/xfs_attr.c 2009-11-12 17:10:20.047264798 +0100 +++ xfs/fs/xfs/xfs_attr.c 2009-11-12 17:18:17.703273473 +0100 @@ -123,9 +123,13 @@ xfs_inode_hasattr( * Overall external interface routines. *========================================================================*/ -int -xfs_attr_fetch(xfs_inode_t *ip, struct xfs_name *name, - char *value, int *valuelenp, int flags) +STATIC int +xfs_attr_get_int( + struct xfs_inode *ip, + struct xfs_name *name, + char *value, + int *valuelenp, + int flags) { xfs_da_args_t args; int error; @@ -188,7 +192,7 @@ xfs_attr_get( return error; xfs_ilock(ip, XFS_ILOCK_SHARED); - error = xfs_attr_fetch(ip, &xname, value, valuelenp, flags); + error = xfs_attr_get_int(ip, &xname, value, valuelenp, flags); xfs_iunlock(ip, XFS_ILOCK_SHARED); return(error); } Index: xfs/fs/xfs/xfs_attr.h =================================================================== --- xfs.orig/fs/xfs/xfs_attr.h 2009-11-12 17:10:20.056254911 +0100 +++ xfs/fs/xfs/xfs_attr.h 2009-11-12 17:18:17.703273473 +0100 @@ -131,7 +131,6 @@ typedef struct xfs_attr_list_context { */ int xfs_attr_calc_size(struct xfs_inode *, int, int, int *); int xfs_attr_inactive(struct xfs_inode *dp); -int xfs_attr_fetch(struct xfs_inode *, struct xfs_name *, char *, int *, int); int xfs_attr_rmtval_get(struct xfs_da_args *args); int xfs_attr_list_int(struct xfs_attr_list_context *); _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 3/7] xfs: rename xfs_attr_fetch to xfs_attr_get_int 2009-11-14 16:17 ` [PATCH 3/7] xfs: rename xfs_attr_fetch to xfs_attr_get_int Christoph Hellwig @ 2009-11-16 3:17 ` Dave Chinner 2009-11-19 4:42 ` Eric Sandeen 1 sibling, 0 replies; 22+ messages in thread From: Dave Chinner @ 2009-11-16 3:17 UTC (permalink / raw) To: Christoph Hellwig; +Cc: xfs On Sat, Nov 14, 2009 at 11:17:20AM -0500, Christoph Hellwig wrote: > Using a totally different name for the lowlevel get operation does not > fit the _int convention used in the rest of the attr code, so rename it. > > While we're at it also fix the prototype to use the normal convention > and mark it static as it's never used outside of xfs_attr.c. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Looks OK. Reviewed-by: Dave Chinner <david@fromorbit.com> -- Dave Chinner david@fromorbit.com _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 3/7] xfs: rename xfs_attr_fetch to xfs_attr_get_int 2009-11-14 16:17 ` [PATCH 3/7] xfs: rename xfs_attr_fetch to xfs_attr_get_int Christoph Hellwig 2009-11-16 3:17 ` Dave Chinner @ 2009-11-19 4:42 ` Eric Sandeen 1 sibling, 0 replies; 22+ messages in thread From: Eric Sandeen @ 2009-11-19 4:42 UTC (permalink / raw) To: Christoph Hellwig; +Cc: xfs Christoph Hellwig wrote: > Using a totally different name for the lowlevel get operation does not > fit the _int convention used in the rest of the attr code, so rename it. > > While we're at it also fix the prototype to use the normal convention > and mark it static as it's never used outside of xfs_attr.c. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net> > Index: xfs/fs/xfs/xfs_attr.c > =================================================================== > --- xfs.orig/fs/xfs/xfs_attr.c 2009-11-12 17:10:20.047264798 +0100 > +++ xfs/fs/xfs/xfs_attr.c 2009-11-12 17:18:17.703273473 +0100 > @@ -123,9 +123,13 @@ xfs_inode_hasattr( > * Overall external interface routines. > *========================================================================*/ > > -int > -xfs_attr_fetch(xfs_inode_t *ip, struct xfs_name *name, > - char *value, int *valuelenp, int flags) > +STATIC int > +xfs_attr_get_int( > + struct xfs_inode *ip, > + struct xfs_name *name, > + char *value, > + int *valuelenp, > + int flags) > { > xfs_da_args_t args; > int error; > @@ -188,7 +192,7 @@ xfs_attr_get( > return error; > > xfs_ilock(ip, XFS_ILOCK_SHARED); > - error = xfs_attr_fetch(ip, &xname, value, valuelenp, flags); > + error = xfs_attr_get_int(ip, &xname, value, valuelenp, flags); > xfs_iunlock(ip, XFS_ILOCK_SHARED); > return(error); > } > Index: xfs/fs/xfs/xfs_attr.h > =================================================================== > --- xfs.orig/fs/xfs/xfs_attr.h 2009-11-12 17:10:20.056254911 +0100 > +++ xfs/fs/xfs/xfs_attr.h 2009-11-12 17:18:17.703273473 +0100 > @@ -131,7 +131,6 @@ typedef struct xfs_attr_list_context { > */ > int xfs_attr_calc_size(struct xfs_inode *, int, int, int *); > int xfs_attr_inactive(struct xfs_inode *dp); > -int xfs_attr_fetch(struct xfs_inode *, struct xfs_name *, char *, int *, int); > int xfs_attr_rmtval_get(struct xfs_da_args *args); > int xfs_attr_list_int(struct xfs_attr_list_context *); > > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 4/7] xfs: uninline xfs_get_extsz_hint 2009-11-14 16:17 [PATCH 0/7] assorted cleanups Christoph Hellwig ` (2 preceding siblings ...) 2009-11-14 16:17 ` [PATCH 3/7] xfs: rename xfs_attr_fetch to xfs_attr_get_int Christoph Hellwig @ 2009-11-14 16:17 ` Christoph Hellwig 2009-11-16 3:18 ` Dave Chinner 2009-11-19 4:51 ` Eric Sandeen 2009-11-14 16:17 ` [PATCH 5/7] xfs: kill the STATIC_INLINE macro Christoph Hellwig ` (2 subsequent siblings) 6 siblings, 2 replies; 22+ messages in thread From: Christoph Hellwig @ 2009-11-14 16:17 UTC (permalink / raw) To: xfs [-- Attachment #1: xfs-uninline-xfs_get_extsz_hint --] [-- Type: text/plain, Size: 2091 bytes --] This function is too large to efficiently be inlined. Signed-off-by: Christoph Hellwig <hch@lst.de> Index: xfs/fs/xfs/xfs_rw.c =================================================================== --- xfs.orig/fs/xfs/xfs_rw.c 2009-11-12 17:14:15.278004428 +0100 +++ xfs/fs/xfs/xfs_rw.c 2009-11-12 17:18:33.311004263 +0100 @@ -336,3 +336,25 @@ xfs_bwrite( } return (error); } + +/* + * helper function to extract extent size hint from inode + */ +xfs_extlen_t +xfs_get_extsz_hint( + struct xfs_inode *ip) +{ + xfs_extlen_t extsz; + + if (unlikely(XFS_IS_REALTIME_INODE(ip))) { + extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) + ? ip->i_d.di_extsize + : ip->i_mount->m_sb.sb_rextsize; + ASSERT(extsz); + } else { + extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) + ? ip->i_d.di_extsize : 0; + } + + return extsz; +} Index: xfs/fs/xfs/xfs_rw.h =================================================================== --- xfs.orig/fs/xfs/xfs_rw.h 2009-11-09 17:06:46.116004228 +0100 +++ xfs/fs/xfs/xfs_rw.h 2009-11-12 17:18:33.311004263 +0100 @@ -37,27 +37,6 @@ xfs_fsb_to_db(struct xfs_inode *ip, xfs_ } /* - * helper function to extract extent size hint from inode - */ -STATIC_INLINE xfs_extlen_t -xfs_get_extsz_hint( - xfs_inode_t *ip) -{ - xfs_extlen_t extsz; - - if (unlikely(XFS_IS_REALTIME_INODE(ip))) { - extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) - ? ip->i_d.di_extsize - : ip->i_mount->m_sb.sb_rextsize; - ASSERT(extsz); - } else { - extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) - ? ip->i_d.di_extsize : 0; - } - return extsz; -} - -/* * Prototypes for functions in xfs_rw.c. */ extern int xfs_write_clear_setuid(struct xfs_inode *ip); @@ -69,5 +48,6 @@ extern int xfs_read_buf(struct xfs_mount struct xfs_buf **bpp); extern void xfs_ioerror_alert(char *func, struct xfs_mount *mp, xfs_buf_t *bp, xfs_daddr_t blkno); +extern xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip); #endif /* __XFS_RW_H__ */ _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 4/7] xfs: uninline xfs_get_extsz_hint 2009-11-14 16:17 ` [PATCH 4/7] xfs: uninline xfs_get_extsz_hint Christoph Hellwig @ 2009-11-16 3:18 ` Dave Chinner 2009-11-19 4:51 ` Eric Sandeen 1 sibling, 0 replies; 22+ messages in thread From: Dave Chinner @ 2009-11-16 3:18 UTC (permalink / raw) To: Christoph Hellwig; +Cc: xfs On Sat, Nov 14, 2009 at 11:17:21AM -0500, Christoph Hellwig wrote: > This function is too large to efficiently be inlined. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Makes sense. Reviewed-by: Dave Chinner <david@fromorbit.com> -- Dave Chinner david@fromorbit.com _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 4/7] xfs: uninline xfs_get_extsz_hint 2009-11-14 16:17 ` [PATCH 4/7] xfs: uninline xfs_get_extsz_hint Christoph Hellwig 2009-11-16 3:18 ` Dave Chinner @ 2009-11-19 4:51 ` Eric Sandeen 1 sibling, 0 replies; 22+ messages in thread From: Eric Sandeen @ 2009-11-19 4:51 UTC (permalink / raw) To: Christoph Hellwig; +Cc: xfs Christoph Hellwig wrote: > This function is too large to efficiently be inlined. Just out of curiosity; too how do you define too large? -Eric > Signed-off-by: Christoph Hellwig <hch@lst.de> > > Index: xfs/fs/xfs/xfs_rw.c > =================================================================== > --- xfs.orig/fs/xfs/xfs_rw.c 2009-11-12 17:14:15.278004428 +0100 > +++ xfs/fs/xfs/xfs_rw.c 2009-11-12 17:18:33.311004263 +0100 > @@ -336,3 +336,25 @@ xfs_bwrite( > } > return (error); > } > + > +/* > + * helper function to extract extent size hint from inode > + */ > +xfs_extlen_t > +xfs_get_extsz_hint( > + struct xfs_inode *ip) > +{ > + xfs_extlen_t extsz; > + > + if (unlikely(XFS_IS_REALTIME_INODE(ip))) { > + extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) > + ? ip->i_d.di_extsize > + : ip->i_mount->m_sb.sb_rextsize; > + ASSERT(extsz); > + } else { > + extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) > + ? ip->i_d.di_extsize : 0; > + } > + > + return extsz; > +} > Index: xfs/fs/xfs/xfs_rw.h > =================================================================== > --- xfs.orig/fs/xfs/xfs_rw.h 2009-11-09 17:06:46.116004228 +0100 > +++ xfs/fs/xfs/xfs_rw.h 2009-11-12 17:18:33.311004263 +0100 > @@ -37,27 +37,6 @@ xfs_fsb_to_db(struct xfs_inode *ip, xfs_ > } > > /* > - * helper function to extract extent size hint from inode > - */ > -STATIC_INLINE xfs_extlen_t > -xfs_get_extsz_hint( > - xfs_inode_t *ip) > -{ > - xfs_extlen_t extsz; > - > - if (unlikely(XFS_IS_REALTIME_INODE(ip))) { > - extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) > - ? ip->i_d.di_extsize > - : ip->i_mount->m_sb.sb_rextsize; > - ASSERT(extsz); > - } else { > - extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) > - ? ip->i_d.di_extsize : 0; > - } > - return extsz; > -} > - > -/* > * Prototypes for functions in xfs_rw.c. > */ > extern int xfs_write_clear_setuid(struct xfs_inode *ip); > @@ -69,5 +48,6 @@ extern int xfs_read_buf(struct xfs_mount > struct xfs_buf **bpp); > extern void xfs_ioerror_alert(char *func, struct xfs_mount *mp, > xfs_buf_t *bp, xfs_daddr_t blkno); > +extern xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip); > > #endif /* __XFS_RW_H__ */ > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 5/7] xfs: kill the STATIC_INLINE macro 2009-11-14 16:17 [PATCH 0/7] assorted cleanups Christoph Hellwig ` (3 preceding siblings ...) 2009-11-14 16:17 ` [PATCH 4/7] xfs: uninline xfs_get_extsz_hint Christoph Hellwig @ 2009-11-14 16:17 ` Christoph Hellwig 2009-11-16 3:20 ` Dave Chinner 2009-11-14 16:17 ` [PATCH 6/7] xfs: remove incorrect sparse annotation for xfs_iget_cache_miss Christoph Hellwig 2009-11-14 16:17 ` [PATCH 7/7] xfs: cleanup dmapi macros in the umount path Christoph Hellwig 6 siblings, 1 reply; 22+ messages in thread From: Christoph Hellwig @ 2009-11-14 16:17 UTC (permalink / raw) To: xfs [-- Attachment #1: xfs-kill-STATIC_INLINE --] [-- Type: text/plain, Size: 6626 bytes --] Remove our own STATIC_INLINE macro. For small function inside implementation files just use STATIC and let gcc inline it, and for those in headers do the normal static inline - they are all small enough to be inlined for debug builds, too. Signed-off-by: Christoph Hellwig <hch@lst.de> Index: xfs/fs/xfs/linux-2.6/xfs_aops.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_aops.c 2009-11-12 17:10:19.847273603 +0100 +++ xfs/fs/xfs/linux-2.6/xfs_aops.c 2009-11-12 17:18:51.342254266 +0100 @@ -337,7 +337,7 @@ xfs_map_blocks( return -xfs_iomap(XFS_I(inode), offset, count, flags, mapp, &nmaps); } -STATIC_INLINE int +STATIC int xfs_iomap_valid( xfs_iomap_t *iomapp, loff_t offset) Index: xfs/fs/xfs/linux-2.6/xfs_buf.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_buf.c 2009-11-12 17:13:55.334003777 +0100 +++ xfs/fs/xfs/linux-2.6/xfs_buf.c 2009-11-12 17:18:51.343279047 +0100 @@ -149,7 +149,7 @@ page_region_mask( return mask; } -STATIC_INLINE void +STATIC void set_page_region( struct page *page, size_t offset, @@ -161,7 +161,7 @@ set_page_region( SetPageUptodate(page); } -STATIC_INLINE int +STATIC int test_page_region( struct page *page, size_t offset, @@ -1113,7 +1113,7 @@ xfs_bdwrite( xfs_buf_delwri_queue(bp, 1); } -STATIC_INLINE void +STATIC void _xfs_buf_ioend( xfs_buf_t *bp, int schedule) Index: xfs/fs/xfs/support/debug.h =================================================================== --- xfs.orig/fs/xfs/support/debug.h 2009-09-02 02:34:18.083957167 +0200 +++ xfs/fs/xfs/support/debug.h 2009-11-12 17:18:51.346291303 +0100 @@ -41,10 +41,6 @@ extern void assfail(char *expr, char *f, # define STATIC static noinline #endif -#ifndef STATIC_INLINE -# define STATIC_INLINE static inline -#endif - #else /* DEBUG */ #define ASSERT(expr) \ @@ -54,19 +50,5 @@ extern void assfail(char *expr, char *f, # define STATIC noinline #endif -/* - * We stop inlining of inline functions in debug mode. - * Unfortunately, this means static inline in header files - * get multiple definitions, so they need to remain static. - * This then gives tonnes of warnings about unused but defined - * functions, so we need to add the unused attribute to prevent - * these spurious warnings. - */ -#ifndef STATIC_INLINE -# define STATIC_INLINE static __attribute__ ((unused)) noinline -#endif - #endif /* DEBUG */ - - #endif /* __XFS_SUPPORT_DEBUG_H__ */ Index: xfs/fs/xfs/xfs_attr_leaf.c =================================================================== --- xfs.orig/fs/xfs/xfs_attr_leaf.c 2009-11-12 17:10:20.365276128 +0100 +++ xfs/fs/xfs/xfs_attr_leaf.c 2009-11-12 17:18:51.352004530 +0100 @@ -98,7 +98,7 @@ STATIC int xfs_attr_leaf_entsize(xfs_att * If namespace bits don't match return 0. * If all match then return 1. */ -STATIC_INLINE int +STATIC int xfs_attr_namesp_match(int arg_flags, int ondisk_flags) { return XFS_ATTR_NSP_ONDISK(ondisk_flags) == XFS_ATTR_NSP_ARGS_TO_ONDISK(arg_flags); Index: xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- xfs.orig/fs/xfs/xfs_bmap_btree.c 2009-11-12 17:10:20.092263270 +0100 +++ xfs/fs/xfs/xfs_bmap_btree.c 2009-11-12 17:18:51.355004214 +0100 @@ -98,8 +98,7 @@ xfs_bmdr_to_bmbt( * This code must be in sync with the routines xfs_bmbt_get_startoff, * xfs_bmbt_get_startblock, xfs_bmbt_get_blockcount and xfs_bmbt_get_state. */ - -STATIC_INLINE void +STATIC void __xfs_bmbt_get_all( __uint64_t l0, __uint64_t l1, Index: xfs/fs/xfs/xfs_filestream.h =================================================================== --- xfs.orig/fs/xfs/xfs_filestream.h 2009-08-27 03:51:46.093856009 +0200 +++ xfs/fs/xfs/xfs_filestream.h 2009-11-12 17:18:51.357025561 +0100 @@ -79,7 +79,7 @@ extern ktrace_t *xfs_filestreams_trace_b * the cache that reference per-ag array elements that have since been * reallocated. */ -STATIC_INLINE int +static inline int xfs_filestream_peek_ag( xfs_mount_t *mp, xfs_agnumber_t agno) @@ -87,7 +87,7 @@ xfs_filestream_peek_ag( return atomic_read(&mp->m_perag[agno].pagf_fstrms); } -STATIC_INLINE int +static inline int xfs_filestream_get_ag( xfs_mount_t *mp, xfs_agnumber_t agno) @@ -95,7 +95,7 @@ xfs_filestream_get_ag( return atomic_inc_return(&mp->m_perag[agno].pagf_fstrms); } -STATIC_INLINE int +static inline int xfs_filestream_put_ag( xfs_mount_t *mp, xfs_agnumber_t agno) @@ -122,7 +122,7 @@ int xfs_filestream_new_ag(struct xfs_bma /* filestreams for the inode? */ -STATIC_INLINE int +static inline int xfs_inode_is_filestream( struct xfs_inode *ip) { Index: xfs/fs/xfs/xfs_ialloc.c =================================================================== --- xfs.orig/fs/xfs/xfs_ialloc.c 2009-11-09 17:06:46.115004101 +0100 +++ xfs/fs/xfs/xfs_ialloc.c 2009-11-12 17:18:51.362006363 +0100 @@ -425,7 +425,7 @@ xfs_ialloc_ag_alloc( return 0; } -STATIC_INLINE xfs_agnumber_t +STATIC xfs_agnumber_t xfs_ialloc_next_ag( xfs_mount_t *mp) { Index: xfs/fs/xfs/xfs_mount.c =================================================================== --- xfs.orig/fs/xfs/xfs_mount.c 2009-11-12 17:10:20.296276205 +0100 +++ xfs/fs/xfs/xfs_mount.c 2009-11-12 17:18:51.367005882 +0100 @@ -2123,7 +2123,7 @@ xfs_icsb_destroy_counters( mutex_destroy(&mp->m_icsb_mutex); } -STATIC_INLINE void +STATIC void xfs_icsb_lock_cntr( xfs_icsb_cnts_t *icsbp) { @@ -2132,7 +2132,7 @@ xfs_icsb_lock_cntr( } } -STATIC_INLINE void +STATIC void xfs_icsb_unlock_cntr( xfs_icsb_cnts_t *icsbp) { @@ -2140,7 +2140,7 @@ xfs_icsb_unlock_cntr( } -STATIC_INLINE void +STATIC void xfs_icsb_lock_all_counters( xfs_mount_t *mp) { @@ -2153,7 +2153,7 @@ xfs_icsb_lock_all_counters( } } -STATIC_INLINE void +STATIC void xfs_icsb_unlock_all_counters( xfs_mount_t *mp) { Index: xfs/fs/xfs/xfs_mount.h =================================================================== --- xfs.orig/fs/xfs/xfs_mount.h 2009-09-16 14:36:18.022004650 +0200 +++ xfs/fs/xfs/xfs_mount.h 2009-11-12 17:18:51.369006416 +0100 @@ -387,13 +387,13 @@ xfs_put_perag(struct xfs_mount *mp, xfs_ * Per-cpu superblock locking functions */ #ifdef HAVE_PERCPU_SB -STATIC_INLINE void +static inline void xfs_icsb_lock(xfs_mount_t *mp) { mutex_lock(&mp->m_icsb_mutex); } -STATIC_INLINE void +static inline void xfs_icsb_unlock(xfs_mount_t *mp) { mutex_unlock(&mp->m_icsb_mutex); _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 5/7] xfs: kill the STATIC_INLINE macro 2009-11-14 16:17 ` [PATCH 5/7] xfs: kill the STATIC_INLINE macro Christoph Hellwig @ 2009-11-16 3:20 ` Dave Chinner 0 siblings, 0 replies; 22+ messages in thread From: Dave Chinner @ 2009-11-16 3:20 UTC (permalink / raw) To: Christoph Hellwig; +Cc: xfs On Sat, Nov 14, 2009 at 11:17:22AM -0500, Christoph Hellwig wrote: > Remove our own STATIC_INLINE macro. For small function inside implementation > files just use STATIC and let gcc inline it, and for those in headers do the > normal static inline - they are all small enough to be inlined for debug > builds, too. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Looks good. Reviewed-by: Dave Chinner <david@fromorbit.com> -- Dave Chinner david@fromorbit.com _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 6/7] xfs: remove incorrect sparse annotation for xfs_iget_cache_miss 2009-11-14 16:17 [PATCH 0/7] assorted cleanups Christoph Hellwig ` (4 preceding siblings ...) 2009-11-14 16:17 ` [PATCH 5/7] xfs: kill the STATIC_INLINE macro Christoph Hellwig @ 2009-11-14 16:17 ` Christoph Hellwig 2009-11-16 3:22 ` Dave Chinner 2009-11-14 16:17 ` [PATCH 7/7] xfs: cleanup dmapi macros in the umount path Christoph Hellwig 6 siblings, 1 reply; 22+ messages in thread From: Christoph Hellwig @ 2009-11-14 16:17 UTC (permalink / raw) To: xfs [-- Attachment #1: xfs-sparse-fix --] [-- Type: text/plain, Size: 722 bytes --] xfs_iget_cache_miss does not get called with the pag_ici_lock held, so the __releases annotation is incorrect. Signed-off-by: Christoph Hellwig <hch@lst.de> Index: xfs/fs/xfs/xfs_iget.c =================================================================== --- xfs.orig/fs/xfs/xfs_iget.c 2009-11-12 17:13:27.565003964 +0100 +++ xfs/fs/xfs/xfs_iget.c 2009-11-12 17:19:14.801254179 +0100 @@ -293,7 +293,7 @@ xfs_iget_cache_miss( struct xfs_inode **ipp, xfs_daddr_t bno, int flags, - int lock_flags) __releases(pag->pag_ici_lock) + int lock_flags) { struct xfs_inode *ip; int error; _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 6/7] xfs: remove incorrect sparse annotation for xfs_iget_cache_miss 2009-11-14 16:17 ` [PATCH 6/7] xfs: remove incorrect sparse annotation for xfs_iget_cache_miss Christoph Hellwig @ 2009-11-16 3:22 ` Dave Chinner 0 siblings, 0 replies; 22+ messages in thread From: Dave Chinner @ 2009-11-16 3:22 UTC (permalink / raw) To: Christoph Hellwig; +Cc: xfs On Sat, Nov 14, 2009 at 11:17:23AM -0500, Christoph Hellwig wrote: > xfs_iget_cache_miss does not get called with the pag_ici_lock held, so > the __releases annotation is incorrect. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <david@fromorbit.com> -- Dave Chinner david@fromorbit.com _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 7/7] xfs: cleanup dmapi macros in the umount path 2009-11-14 16:17 [PATCH 0/7] assorted cleanups Christoph Hellwig ` (5 preceding siblings ...) 2009-11-14 16:17 ` [PATCH 6/7] xfs: remove incorrect sparse annotation for xfs_iget_cache_miss Christoph Hellwig @ 2009-11-14 16:17 ` Christoph Hellwig 2009-11-16 3:29 ` Dave Chinner 6 siblings, 1 reply; 22+ messages in thread From: Christoph Hellwig @ 2009-11-14 16:17 UTC (permalink / raw) To: xfs [-- Attachment #1: unmount-dmapi-cleanup --] [-- Type: text/plain, Size: 3444 bytes --] Stop the flag saving as we never mangle those in the unmount path, and hide all the weird arguents to the dmapi code inside the XFS_SEND_PREUNMOUNT / XFS_SEND_UNMOUNT macros. Signed-off-by: Christoph Hellwig <hch@lst.de> Index: xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2009-11-12 17:10:19.920254621 +0100 +++ xfs/fs/xfs/linux-2.6/xfs_super.c 2009-11-12 17:23:54.929032604 +0100 @@ -1131,8 +1131,6 @@ xfs_fs_put_super( struct super_block *sb) { struct xfs_mount *mp = XFS_M(sb); - struct xfs_inode *rip = mp->m_rootip; - int unmount_event_flags = 0; xfs_syncd_stop(mp); @@ -1148,20 +1146,7 @@ xfs_fs_put_super( xfs_sync_attr(mp, 0); } -#ifdef HAVE_DMAPI - if (mp->m_flags & XFS_MOUNT_DMAPI) { - unmount_event_flags = - (mp->m_dmevmask & (1 << DM_EVENT_UNMOUNT)) ? - 0 : DM_FLAGS_UNWANTED; - /* - * Ignore error from dmapi here, first unmount is not allowed - * to fail anyway, and second we wouldn't want to fail a - * unmount because of dmapi. - */ - XFS_SEND_PREUNMOUNT(mp, rip, DM_RIGHT_NULL, rip, DM_RIGHT_NULL, - NULL, NULL, 0, 0, unmount_event_flags); - } -#endif + XFS_SEND_PREUNMOUNT(mp); /* * Blow away any referenced inode in the filestreams cache. @@ -1172,10 +1157,7 @@ xfs_fs_put_super( XFS_bflush(mp->m_ddev_targp); - if (mp->m_flags & XFS_MOUNT_DMAPI) { - XFS_SEND_UNMOUNT(mp, rip, DM_RIGHT_NULL, 0, 0, - unmount_event_flags); - } + XFS_SEND_UNMOUNT(mp); xfs_unmountfs(mp); xfs_freesb(mp); Index: xfs/fs/xfs/xfs_mount.h =================================================================== --- xfs.orig/fs/xfs/xfs_mount.h 2009-11-12 17:18:51.369006416 +0100 +++ xfs/fs/xfs/xfs_mount.h 2009-11-12 17:23:01.626024632 +0100 @@ -93,6 +93,9 @@ typedef struct xfs_dmops { xfs_send_unmount_t xfs_send_unmount; } xfs_dmops_t; +#define XFS_DMAPI_UNMOUNT_FLAGS(mp) \ + (((mp)->m_dmevmask & (1 << DM_EVENT_UNMOUNT)) ? 0 : DM_FLAGS_UNWANTED) + #define XFS_SEND_DATA(mp, ev,ip,off,len,fl,lock) \ (*(mp)->m_dm_ops->xfs_send_data)(ev,ip,off,len,fl,lock) #define XFS_SEND_MMAP(mp, vma,fl) \ @@ -101,12 +104,24 @@ typedef struct xfs_dmops { (*(mp)->m_dm_ops->xfs_send_destroy)(ip,right) #define XFS_SEND_NAMESP(mp, ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) \ (*(mp)->m_dm_ops->xfs_send_namesp)(ev,NULL,b1,r1,b2,r2,n1,n2,mode,rval,fl) -#define XFS_SEND_PREUNMOUNT(mp,b1,r1,b2,r2,n1,n2,mode,rval,fl) \ - (*(mp)->m_dm_ops->xfs_send_namesp)(DM_EVENT_PREUNMOUNT,mp,b1,r1,b2,r2,n1,n2,mode,rval,fl) #define XFS_SEND_MOUNT(mp,right,path,name) \ (*(mp)->m_dm_ops->xfs_send_mount)(mp,right,path,name) -#define XFS_SEND_UNMOUNT(mp, ip,right,mode,rval,fl) \ - (*(mp)->m_dm_ops->xfs_send_unmount)(mp,ip,right,mode,rval,fl) +#define XFS_SEND_PREUNMOUNT(mp) \ +do { \ + if (mp->m_flags & XFS_MOUNT_DMAPI) { \ + (*(mp)->m_dm_ops->xfs_send_namesp)(DM_EVENT_PREUNMOUNT, mp, \ + (mp)->m_rootip, DM_RIGHT_NULL, \ + (mp)->m_rootip, DM_RIGHT_NULL, \ + NULL, NULL, 0, 0, XFS_DMAPI_UNMOUNT_FLAGS(mp)); \ + } \ +} while (0) +#define XFS_SEND_UNMOUNT(mp) \ +do { \ + if (mp->m_flags & XFS_MOUNT_DMAPI) { \ + (*(mp)->m_dm_ops->xfs_send_unmount)(mp, (mp)->m_rootip, \ + DM_RIGHT_NULL, 0, 0, XFS_DMAPI_UNMOUNT_FLAGS(mp)); \ + } \ +} while (0) #ifdef HAVE_PERCPU_SB _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 7/7] xfs: cleanup dmapi macros in the umount path 2009-11-14 16:17 ` [PATCH 7/7] xfs: cleanup dmapi macros in the umount path Christoph Hellwig @ 2009-11-16 3:29 ` Dave Chinner 0 siblings, 0 replies; 22+ messages in thread From: Dave Chinner @ 2009-11-16 3:29 UTC (permalink / raw) To: Christoph Hellwig; +Cc: xfs On Sat, Nov 14, 2009 at 11:17:24AM -0500, Christoph Hellwig wrote: > Stop the flag saving as we never mangle those in the unmount path, and hide all > the weird arguents to the dmapi code inside the XFS_SEND_PREUNMOUNT / > XFS_SEND_UNMOUNT macros. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Nice cleanup. Reviewed-by: Dave Chinner <david@fromorbit.com> -- Dave Chinner david@fromorbit.com _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2009-11-25 0:16 UTC | newest] Thread overview: 22+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-11-14 16:17 [PATCH 0/7] assorted cleanups Christoph Hellwig 2009-11-14 16:17 ` [PATCH 1/7] xfs: remove IO_ISAIO Christoph Hellwig 2009-11-16 3:05 ` Dave Chinner 2009-11-19 4:36 ` Eric Sandeen 2009-11-14 16:17 ` [PATCH 2/7] xfs: remove xfs_buf_get / xfs_buf_read Christoph Hellwig 2009-11-16 3:15 ` Dave Chinner 2009-11-16 11:03 ` Christoph Hellwig 2009-11-19 4:40 ` Eric Sandeen 2009-11-24 18:02 ` [PATCH v2 2/7] xfs: simplify xfs_buf_get / xfs_buf_read interfaces Christoph Hellwig 2009-11-25 0:16 ` Dave Chinner 2009-11-14 16:17 ` [PATCH 3/7] xfs: rename xfs_attr_fetch to xfs_attr_get_int Christoph Hellwig 2009-11-16 3:17 ` Dave Chinner 2009-11-19 4:42 ` Eric Sandeen 2009-11-14 16:17 ` [PATCH 4/7] xfs: uninline xfs_get_extsz_hint Christoph Hellwig 2009-11-16 3:18 ` Dave Chinner 2009-11-19 4:51 ` Eric Sandeen 2009-11-14 16:17 ` [PATCH 5/7] xfs: kill the STATIC_INLINE macro Christoph Hellwig 2009-11-16 3:20 ` Dave Chinner 2009-11-14 16:17 ` [PATCH 6/7] xfs: remove incorrect sparse annotation for xfs_iget_cache_miss Christoph Hellwig 2009-11-16 3:22 ` Dave Chinner 2009-11-14 16:17 ` [PATCH 7/7] xfs: cleanup dmapi macros in the umount path Christoph Hellwig 2009-11-16 3:29 ` Dave Chinner
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox