Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84474
b: refs/heads/master
c: 71ddabb
h: refs/heads/master
v: v3
  • Loading branch information
Eric Sandeen authored and Lachlan McIlroy committed Feb 7, 2008
1 parent 9fff1bd commit e39ff9b
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a67d7c5f5d25d0b13a4dfb182697135b014fa478
refs/heads/master: 71ddabb94a623d1e16e7e66898bf439ff78ecc41
2 changes: 1 addition & 1 deletion trunk/fs/xfs/linux-2.6/xfs_aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ xfs_find_bdev_for_inode(
{
struct xfs_mount *mp = ip->i_mount;

if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME)
if (XFS_IS_REALTIME_INODE(ip))
return mp->m_rtdev_targp->bt_bdev;
else
return mp->m_ddev_targp->bt_bdev;
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/xfs/linux-2.6/xfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ xfs_ioctl(
case XFS_IOC_DIOINFO: {
struct dioattr da;
xfs_buftarg_t *target =
(ip->i_d.di_flags & XFS_DIFLAG_REALTIME) ?
XFS_IS_REALTIME_INODE(ip) ?
mp->m_rtdev_targp : mp->m_ddev_targp;

da.d_mem = da.d_miniosz = 1 << target->bt_sshift;
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/xfs/linux-2.6/xfs_iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ xfs_vn_getattr(
sysv_minor(ip->i_df.if_u2.if_rdev));
break;
default:
if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) {
if (XFS_IS_REALTIME_INODE(ip)) {
/*
* If the file blocks are being allocated from a
* realtime volume, then return the inode's realtime
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/xfs/linux-2.6/xfs_lrw.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ xfs_read(

if (unlikely(ioflags & IO_ISDIRECT)) {
xfs_buftarg_t *target =
(ip->i_d.di_flags & XFS_DIFLAG_REALTIME) ?
XFS_IS_REALTIME_INODE(ip) ?
mp->m_rtdev_targp : mp->m_ddev_targp;
if ((*offset & target->bt_smask) ||
(size & target->bt_smask)) {
Expand Down Expand Up @@ -657,7 +657,7 @@ xfs_write(

if (ioflags & IO_ISDIRECT) {
xfs_buftarg_t *target =
(xip->i_d.di_flags & XFS_DIFLAG_REALTIME) ?
XFS_IS_REALTIME_INODE(xip) ?
mp->m_rtdev_targp : mp->m_ddev_targp;

if ((pos & target->bt_smask) || (count & target->bt_smask)) {
Expand Down
5 changes: 2 additions & 3 deletions trunk/fs/xfs/xfs_bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2969,7 +2969,7 @@ STATIC int
xfs_bmap_alloc(
xfs_bmalloca_t *ap) /* bmap alloc argument struct */
{
if ((ap->ip->i_d.di_flags & XFS_DIFLAG_REALTIME) && ap->userdata)
if (XFS_IS_REALTIME_INODE(ap->ip) && ap->userdata)
return xfs_bmap_rtalloc(ap);
return xfs_bmap_btalloc(ap);
}
Expand Down Expand Up @@ -3096,8 +3096,7 @@ xfs_bmap_del_extent(
/*
* Realtime allocation. Free it and record di_nblocks update.
*/
if (whichfork == XFS_DATA_FORK &&
(ip->i_d.di_flags & XFS_DIFLAG_REALTIME)) {
if (whichfork == XFS_DATA_FORK && XFS_IS_REALTIME_INODE(ip)) {
xfs_fsblock_t bno;
xfs_filblks_t len;

Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/xfs/xfs_bmap_btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2062,8 +2062,7 @@ xfs_bmbt_insert(
pcur->bc_private.b.allocated;
pcur->bc_private.b.allocated = 0;
ASSERT((cur->bc_private.b.firstblock != NULLFSBLOCK) ||
(cur->bc_private.b.ip->i_d.di_flags &
XFS_DIFLAG_REALTIME));
XFS_IS_REALTIME_INODE(cur->bc_private.b.ip));
cur->bc_private.b.firstblock =
pcur->bc_private.b.firstblock;
ASSERT(cur->bc_private.b.flist ==
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/xfs/xfs_dfrag.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ xfs_swap_extents(
}

/* Verify both files are either real-time or non-realtime */
if ((ip->i_d.di_flags & XFS_DIFLAG_REALTIME) !=
(tip->i_d.di_flags & XFS_DIFLAG_REALTIME)) {
if (XFS_IS_REALTIME_INODE(ip) != XFS_IS_REALTIME_INODE(tip)) {
error = XFS_ERROR(EINVAL);
goto error0;
}
Expand Down
6 changes: 6 additions & 0 deletions trunk/fs/xfs/xfs_dinode.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ typedef enum xfs_dinode_fmt
#define XFS_DIFLAG_NODEFRAG (1 << XFS_DIFLAG_NODEFRAG_BIT)
#define XFS_DIFLAG_FILESTREAM (1 << XFS_DIFLAG_FILESTREAM_BIT)

#ifdef CONFIG_XFS_RT
#define XFS_IS_REALTIME_INODE(ip) ((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME)
#else
#define XFS_IS_REALTIME_INODE(ip) (0)
#endif

#define XFS_DIFLAG_ANY \
(XFS_DIFLAG_REALTIME | XFS_DIFLAG_PREALLOC | XFS_DIFLAG_NEWRTBM | \
XFS_DIFLAG_IMMUTABLE | XFS_DIFLAG_APPEND | XFS_DIFLAG_SYNC | \
Expand Down
5 changes: 4 additions & 1 deletion trunk/fs/xfs/xfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,10 @@ xfs_isize_check(
if ((ip->i_d.di_mode & S_IFMT) != S_IFREG)
return;

if (ip->i_d.di_flags & (XFS_DIFLAG_REALTIME | XFS_DIFLAG_EXTSIZE))
if (XFS_IS_REALTIME_INODE(ip))
return;

if (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE)
return;

nimaps = 2;
Expand Down
10 changes: 5 additions & 5 deletions trunk/fs/xfs/xfs_iomap.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ xfs_imap_to_bmap(
iomapp->iomap_bsize = XFS_FSB_TO_B(mp, imap->br_blockcount);
iomapp->iomap_flags = flags;

if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) {
if (XFS_IS_REALTIME_INODE(ip)) {
iomapp->iomap_flags |= IOMAP_REALTIME;
iomapp->iomap_target = mp->m_rtdev_targp;
} else {
Expand Down Expand Up @@ -298,7 +298,7 @@ xfs_iomap_eof_align_last_fsb(
xfs_extlen_t align;
int eof, error;

if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME)
if (XFS_IS_REALTIME_INODE(ip))
;
/*
* If mounted with the "-o swalloc" option, roundup the allocation
Expand Down Expand Up @@ -524,7 +524,7 @@ xfs_iomap_write_direct(
}

if (unlikely(!imap.br_startblock &&
!(ip->i_d.di_flags & XFS_DIFLAG_REALTIME))) {
!(XFS_IS_REALTIME_INODE(ip)))) {
error = xfs_cmn_err_fsblock_zero(ip, &imap);
goto error_out;
}
Expand Down Expand Up @@ -687,7 +687,7 @@ xfs_iomap_write_delay(
}

if (unlikely(!imap[0].br_startblock &&
!(ip->i_d.di_flags & XFS_DIFLAG_REALTIME)))
!(XFS_IS_REALTIME_INODE(ip))))
return xfs_cmn_err_fsblock_zero(ip, &imap[0]);

*ret_imap = imap[0];
Expand Down Expand Up @@ -932,7 +932,7 @@ xfs_iomap_write_unwritten(
return XFS_ERROR(error);

if (unlikely(!imap.br_startblock &&
!(ip->i_d.di_flags & XFS_DIFLAG_REALTIME)))
!(XFS_IS_REALTIME_INODE(ip))))
return xfs_cmn_err_fsblock_zero(ip, &imap);

if ((numblks_fsb = imap.br_blockcount) == 0) {
Expand Down
2 changes: 0 additions & 2 deletions trunk/fs/xfs/xfs_rtalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
struct xfs_mount;
struct xfs_trans;

#define XFS_IS_REALTIME_INODE(ip) ((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME)

/* Min and max rt extent sizes, specified in bytes */
#define XFS_MAX_RTEXTSIZE (1024 * 1024 * 1024) /* 1GB */
#define XFS_DFL_RTEXTSIZE (64 * 1024) /* 64KB */
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/xfs/xfs_rw.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct xfs_mount;
static inline xfs_daddr_t
xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb)
{
return (((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME) ? \
return (XFS_IS_REALTIME_INODE(ip) ? \
(xfs_daddr_t)XFS_FSB_TO_BB((ip)->i_mount, (fsb)) : \
XFS_FSB_TO_DADDR((ip)->i_mount, (fsb)));
}
Expand All @@ -53,7 +53,7 @@ xfs_get_extsz_hint(
{
xfs_extlen_t extsz;

if (unlikely(ip->i_d.di_flags & XFS_DIFLAG_REALTIME)) {
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;
Expand Down
12 changes: 6 additions & 6 deletions trunk/fs/xfs/xfs_vnodeops.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ xfs_getattr(
default:
vap->va_rdev = 0;

if (!(ip->i_d.di_flags & XFS_DIFLAG_REALTIME)) {
if (!(XFS_IS_REALTIME_INODE(ip))) {
vap->va_blocksize = xfs_preferred_iosize(mp);
} else {

Expand Down Expand Up @@ -508,7 +508,7 @@ xfs_setattr(
*/
if ((ip->i_d.di_nextents || ip->i_delayed_blks) &&
(mask & XFS_AT_XFLAGS) &&
(ip->i_d.di_flags & XFS_DIFLAG_REALTIME) !=
(XFS_IS_REALTIME_INODE(ip)) !=
(vap->va_xflags & XFS_XFLAG_REALTIME)) {
code = XFS_ERROR(EINVAL); /* EFBIG? */
goto error_return;
Expand All @@ -520,7 +520,7 @@ xfs_setattr(
if ((mask & XFS_AT_EXTSIZE) && vap->va_extsize != 0) {
xfs_extlen_t size;

if ((ip->i_d.di_flags & XFS_DIFLAG_REALTIME) ||
if (XFS_IS_REALTIME_INODE(ip) ||
((mask & XFS_AT_XFLAGS) &&
(vap->va_xflags & XFS_XFLAG_REALTIME))) {
size = mp->m_sb.sb_rextsize <<
Expand Down Expand Up @@ -1144,7 +1144,7 @@ xfs_fsync(
* If this inode is on the RT dev we need to flush that
* cache as well.
*/
if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME)
if (XFS_IS_REALTIME_INODE(ip))
xfs_blkdev_issue_flush(ip->i_mount->m_rtdev_targp);
}

Expand Down Expand Up @@ -4044,7 +4044,7 @@ xfs_zero_remaining_bytes(
int error = 0;

bp = xfs_buf_get_noaddr(mp->m_sb.sb_blocksize,
ip->i_d.di_flags & XFS_DIFLAG_REALTIME ?
XFS_IS_REALTIME_INODE(ip) ?
mp->m_rtdev_targp : mp->m_ddev_targp);

for (offset = startoff; offset <= endoff; offset = lastoffset + 1) {
Expand Down Expand Up @@ -4141,7 +4141,7 @@ xfs_free_file_space(
error = 0;
if (len <= 0) /* if nothing being freed */
return error;
rt = (ip->i_d.di_flags & XFS_DIFLAG_REALTIME);
rt = XFS_IS_REALTIME_INODE(ip);
startoffset_fsb = XFS_B_TO_FSB(mp, offset);
end_dmi_offset = offset + len;
endoffset_fsb = XFS_B_TO_FSBT(mp, end_dmi_offset);
Expand Down

0 comments on commit e39ff9b

Please sign in to comment.