Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/lfs Rename i_flag to i_state.
details: https://anonhg.NetBSD.org/src/rev/f0ebdb709e94
branches: trunk
changeset: 354286:f0ebdb709e94
user: maya <maya%NetBSD.org@localhost>
date: Sat Jun 10 05:29:36 2017 +0000
description:
Rename i_flag to i_state.
The similarity to i_flags has previously caused errors.
diffstat:
sys/ufs/lfs/lfs_accessors.h | 30 +++++++++++-----------
sys/ufs/lfs/lfs_alloc.c | 8 +++---
sys/ufs/lfs/lfs_balloc.c | 8 +++---
sys/ufs/lfs/lfs_bio.c | 10 +++---
sys/ufs/lfs/lfs_inode.c | 26 ++++++++++----------
sys/ufs/lfs/lfs_inode.h | 42 ++++++++++++++++----------------
sys/ufs/lfs/lfs_itimes.c | 20 +++++++-------
sys/ufs/lfs/lfs_pages.c | 16 ++++++------
sys/ufs/lfs/lfs_rename.c | 16 ++++++------
sys/ufs/lfs/lfs_segment.c | 30 +++++++++++-----------
sys/ufs/lfs/lfs_subr.c | 8 +++---
sys/ufs/lfs/lfs_vnops.c | 56 ++++++++++++++++++++++----------------------
sys/ufs/lfs/ulfs_inode.c | 8 +++---
sys/ufs/lfs/ulfs_inode.h | 4 +-
sys/ufs/lfs/ulfs_lookup.c | 22 ++++++++--------
sys/ufs/lfs/ulfs_quota2.c | 6 ++--
sys/ufs/lfs/ulfs_readwrite.c | 10 +++---
sys/ufs/lfs/ulfs_vnops.c | 36 ++++++++++++++--------------
18 files changed, 178 insertions(+), 178 deletions(-)
diffs (truncated from 1281 to 300 lines):
diff -r 1a5fda52a7c8 -r f0ebdb709e94 sys/ufs/lfs/lfs_accessors.h
--- a/sys/ufs/lfs/lfs_accessors.h Fri Jun 09 23:49:58 2017 +0000
+++ b/sys/ufs/lfs/lfs_accessors.h Sat Jun 10 05:29:36 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_accessors.h,v 1.47 2017/01/12 18:40:02 christos Exp $ */
+/* $NetBSD: lfs_accessors.h,v 1.48 2017/06/10 05:29:36 maya Exp $ */
/* from NetBSD: lfs.h,v 1.165 2015/07/24 06:59:32 dholland Exp */
/* from NetBSD: dinode.h,v 1.25 2016/01/22 23:06:10 dholland Exp */
@@ -619,31 +619,31 @@
* "struct inode" associated definitions
*/
-#define LFS_SET_UINO(ip, flags) do { \
- if (((flags) & IN_ACCESSED) && !((ip)->i_flag & IN_ACCESSED)) \
+#define LFS_SET_UINO(ip, states) do { \
+ if (((states) & IN_ACCESSED) && !((ip)->i_state & IN_ACCESSED)) \
lfs_sb_adduinodes((ip)->i_lfs, 1); \
- if (((flags) & IN_CLEANING) && !((ip)->i_flag & IN_CLEANING)) \
+ if (((states) & IN_CLEANING) && !((ip)->i_state & IN_CLEANING)) \
lfs_sb_adduinodes((ip)->i_lfs, 1); \
- if (((flags) & IN_MODIFIED) && !((ip)->i_flag & IN_MODIFIED)) \
+ if (((states) & IN_MODIFIED) && !((ip)->i_state & IN_MODIFIED)) \
lfs_sb_adduinodes((ip)->i_lfs, 1); \
- (ip)->i_flag |= (flags); \
+ (ip)->i_state |= (states); \
} while (0)
-#define LFS_CLR_UINO(ip, flags) do { \
- if (((flags) & IN_ACCESSED) && ((ip)->i_flag & IN_ACCESSED)) \
+#define LFS_CLR_UINO(ip, states) do { \
+ if (((states) & IN_ACCESSED) && ((ip)->i_state & IN_ACCESSED)) \
lfs_sb_subuinodes((ip)->i_lfs, 1); \
- if (((flags) & IN_CLEANING) && ((ip)->i_flag & IN_CLEANING)) \
+ if (((states) & IN_CLEANING) && ((ip)->i_state & IN_CLEANING)) \
lfs_sb_subuinodes((ip)->i_lfs, 1); \
- if (((flags) & IN_MODIFIED) && ((ip)->i_flag & IN_MODIFIED)) \
+ if (((states) & IN_MODIFIED) && ((ip)->i_state & IN_MODIFIED)) \
lfs_sb_subuinodes((ip)->i_lfs, 1); \
- (ip)->i_flag &= ~(flags); \
+ (ip)->i_state &= ~(states); \
if (lfs_sb_getuinodes((ip)->i_lfs) < 0) { \
panic("lfs_uinodes < 0"); \
} \
} while (0)
#define LFS_ITIMES(ip, acc, mod, cre) \
- while ((ip)->i_flag & (IN_ACCESS | IN_CHANGE | IN_UPDATE | IN_MODIFY)) \
+ while ((ip)->i_state & (IN_ACCESS | IN_CHANGE | IN_UPDATE | IN_MODIFY)) \
lfs_itimes(ip, acc, mod, cre)
/*
@@ -672,7 +672,7 @@
#define LFS_SEGENTRY(SP, F, IN, BP) do { \
int _e; \
SHARE_IFLOCK(F); \
- VTOI((F)->lfs_ivnode)->i_flag |= IN_ACCESS; \
+ VTOI((F)->lfs_ivnode)->i_state |= IN_ACCESS; \
if ((_e = bread((F)->lfs_ivnode, \
((IN) / lfs_sb_getsepb(F)) + lfs_sb_getcleansz(F), \
lfs_sb_getbsize(F), 0, &(BP))) != 0) \
@@ -825,7 +825,7 @@
#define LFS_IENTRY(IP, F, IN, BP) do { \
int _e; \
SHARE_IFLOCK(F); \
- VTOI((F)->lfs_ivnode)->i_flag |= IN_ACCESS; \
+ VTOI((F)->lfs_ivnode)->i_state |= IN_ACCESS; \
if ((_e = bread((F)->lfs_ivnode, \
(IN) / lfs_sb_getifpb(F) + lfs_sb_getcleansz(F) + lfs_sb_getsegtabsz(F), \
lfs_sb_getbsize(F), 0, &(BP))) != 0) \
@@ -941,7 +941,7 @@
#define LFS_CLEANERINFO(CP, F, BP) do { \
int _e; \
SHARE_IFLOCK(F); \
- VTOI((F)->lfs_ivnode)->i_flag |= IN_ACCESS; \
+ VTOI((F)->lfs_ivnode)->i_state |= IN_ACCESS; \
_e = bread((F)->lfs_ivnode, \
(daddr_t)0, lfs_sb_getbsize(F), 0, &(BP)); \
if (_e) \
diff -r 1a5fda52a7c8 -r f0ebdb709e94 sys/ufs/lfs/lfs_alloc.c
--- a/sys/ufs/lfs/lfs_alloc.c Fri Jun 09 23:49:58 2017 +0000
+++ b/sys/ufs/lfs/lfs_alloc.c Sat Jun 10 05:29:36 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_alloc.c,v 1.135 2017/03/13 20:15:50 maya Exp $ */
+/* $NetBSD: lfs_alloc.c,v 1.136 2017/06/10 05:29:36 maya Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_alloc.c,v 1.135 2017/03/13 20:15:50 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_alloc.c,v 1.136 2017/06/10 05:29:36 maya Exp $");
#if defined(_KERNEL_OPT)
#include "opt_quota.h"
@@ -506,7 +506,7 @@
/*
* If the inode was in a dirop, it isn't now.
*
- * XXX: why are (v_uflag & VU_DIROP) and (ip->i_flag & IN_ADIROP)
+ * XXX: why are (v_uflag & VU_DIROP) and (ip->i_state & IN_ADIROP)
* not updated together in one function? (and why do both exist,
* anyway?)
*/
@@ -551,7 +551,7 @@
mutex_exit(&lfs_lock);
/* Turn off all inode modification flags */
- ip->i_flag &= ~IN_ALLMOD;
+ ip->i_state &= ~IN_ALLMOD;
/* Mark it deleted */
ip->i_lfs_iflags |= LFSI_DELETED;
diff -r 1a5fda52a7c8 -r f0ebdb709e94 sys/ufs/lfs/lfs_balloc.c
--- a/sys/ufs/lfs/lfs_balloc.c Fri Jun 09 23:49:58 2017 +0000
+++ b/sys/ufs/lfs/lfs_balloc.c Sat Jun 10 05:29:36 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_balloc.c,v 1.93 2017/06/08 01:23:01 chs Exp $ */
+/* $NetBSD: lfs_balloc.c,v 1.94 2017/06/10 05:29:36 maya Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_balloc.c,v 1.93 2017/06/08 01:23:01 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_balloc.c,v 1.94 2017/06/10 05:29:36 maya Exp $");
#if defined(_KERNEL_OPT)
#include "opt_quota.h"
@@ -194,7 +194,7 @@
ip->i_size = (lastblock + 1) * lfs_sb_getbsize(fs);
lfs_dino_setsize(fs, ip->i_din, ip->i_size);
uvm_vnp_setsize(vp, ip->i_size);
- ip->i_flag |= IN_CHANGE | IN_UPDATE;
+ ip->i_state |= IN_CHANGE | IN_UPDATE;
/* if we got a buffer for this, write it out now */
if (bpp)
(void) VOP_BWRITE(bp->b_vp, bp);
@@ -579,7 +579,7 @@
/* increase the file's effective block count */
ip->i_lfs_effnblks += frags;
/* mark the inode dirty */
- ip->i_flag |= IN_CHANGE | IN_UPDATE;
+ ip->i_state |= IN_CHANGE | IN_UPDATE;
if (bpp) {
obufsize = (*bpp)->b_bufsize;
diff -r 1a5fda52a7c8 -r f0ebdb709e94 sys/ufs/lfs/lfs_bio.c
--- a/sys/ufs/lfs/lfs_bio.c Fri Jun 09 23:49:58 2017 +0000
+++ b/sys/ufs/lfs/lfs_bio.c Sat Jun 10 05:29:36 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_bio.c,v 1.140 2017/06/08 01:23:01 chs Exp $ */
+/* $NetBSD: lfs_bio.c,v 1.141 2017/06/10 05:29:36 maya Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003, 2008 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.140 2017/06/08 01:23:01 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.141 2017/06/10 05:29:36 maya Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -159,7 +159,7 @@
KASSERT(locked_queue_rcount >= 0);
KASSERT(locked_queue_rbytes >= 0);
- cantwait = (VTOI(vp)->i_flag & IN_ADIROP) || fs->lfs_unlockvp == vp;
+ cantwait = (VTOI(vp)->i_state & IN_ADIROP) || fs->lfs_unlockvp == vp;
mutex_enter(&lfs_lock);
while (!cantwait && n > 0 && !lfs_fits_buf(fs, n, bytes)) {
int error;
@@ -214,7 +214,7 @@
ASSERT_MAYBE_SEGLOCK(fs);
slept = 0;
mutex_enter(&lfs_lock);
- cantwait = (VTOI(vp)->i_flag & IN_ADIROP) || fs->lfs_unlockvp == vp;
+ cantwait = (VTOI(vp)->i_state & IN_ADIROP) || fs->lfs_unlockvp == vp;
while (!cantwait && fsb > 0 &&
!lfs_fits(fs, fsb + fs->lfs_ravail + fs->lfs_favail)) {
mutex_exit(&lfs_lock);
@@ -602,7 +602,7 @@
if (ip->i_number == LFS_IFILE_INUM)
return 0;
/* If we're being called from inside a dirop, don't sleep */
- if (ip->i_flag & IN_ADIROP)
+ if (ip->i_state & IN_ADIROP)
return 0;
fs = ip->i_lfs;
diff -r 1a5fda52a7c8 -r f0ebdb709e94 sys/ufs/lfs/lfs_inode.c
--- a/sys/ufs/lfs/lfs_inode.c Fri Jun 09 23:49:58 2017 +0000
+++ b/sys/ufs/lfs/lfs_inode.c Sat Jun 10 05:29:36 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_inode.c,v 1.156 2017/06/05 01:29:21 maya Exp $ */
+/* $NetBSD: lfs_inode.c,v 1.157 2017/06/10 05:29:36 maya Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_inode.c,v 1.156 2017/06/05 01:29:21 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_inode.c,v 1.157 2017/06/10 05:29:36 maya Exp $");
#if defined(_KERNEL_OPT)
#include "opt_quota.h"
@@ -156,9 +156,9 @@
mutex_exit(vp->v_interlock);
LFS_ITIMES(ip, acc, mod, NULL);
if (updflags & UPDATE_CLOSE)
- flags = ip->i_flag & (IN_MODIFIED | IN_ACCESSED | IN_CLEANING);
+ flags = ip->i_state & (IN_MODIFIED | IN_ACCESSED | IN_CLEANING);
else
- flags = ip->i_flag & (IN_MODIFIED | IN_CLEANING);
+ flags = ip->i_state & (IN_MODIFIED | IN_CLEANING);
if (flags == 0)
return (0);
@@ -170,10 +170,10 @@
while (vp->v_uflag & VU_DIROP) {
DLOG((DLOG_DIROP, "lfs_update: sleeping on inode %llu "
"(dirops)\n", (unsigned long long) ip->i_number));
- DLOG((DLOG_DIROP, "lfs_update: vflags 0x%x, iflags"
+ DLOG((DLOG_DIROP, "lfs_update: vflags 0x%x, i_state"
" 0x%x\n",
vp->v_iflag | vp->v_vflag | vp->v_uflag,
- ip->i_flag));
+ ip->i_state));
if (fs->lfs_dirops == 0)
lfs_flush_fs(fs, SEGM_SYNC);
else
@@ -239,13 +239,13 @@
memset((char *)SHORTLINK(oip), 0, (u_int)oip->i_size);
oip->i_size = 0;
lfs_dino_setsize(fs, oip->i_din, 0);
- oip->i_flag |= IN_CHANGE | IN_UPDATE;
+ oip->i_state |= IN_CHANGE | IN_UPDATE;
return (lfs_update(ovp, NULL, NULL, 0));
}
if (oip->i_size == length) {
/* still do a uvm_vnp_setsize() as writesize may be larger */
uvm_vnp_setsize(ovp, length);
- oip->i_flag |= IN_CHANGE | IN_UPDATE;
+ oip->i_state |= IN_CHANGE | IN_UPDATE;
return (lfs_update(ovp, NULL, NULL, 0));
}
lfs_imtime(fs);
@@ -296,7 +296,7 @@
return error;
}
uvm_vnp_setsize(ovp, length);
- oip->i_flag |= IN_CHANGE | IN_UPDATE;
+ oip->i_state |= IN_CHANGE | IN_UPDATE;
KASSERT(ovp->v_size == oip->i_size);
oip->i_lfs_hiblk = lfs_lblkno(fs, oip->i_size + lfs_sb_getbsize(fs) - 1) - 1;
return (lfs_update(ovp, NULL, NULL, 0));
@@ -315,7 +315,7 @@
lfs_dino_setsize(fs, oip->i_din, oip->i_size);
uvm_vnp_setsize(ovp, length);
(void) VOP_BWRITE(bp->b_vp, bp);
- oip->i_flag |= IN_CHANGE | IN_UPDATE;
+ oip->i_state |= IN_CHANGE | IN_UPDATE;
oip->i_lfs_hiblk = lfs_lblkno(fs, oip->i_size + lfs_sb_getbsize(fs) - 1) - 1;
return (lfs_update(ovp, NULL, NULL, 0));
}
@@ -592,13 +592,13 @@
/*
* If we truncated to zero, take us off the paging queue.
*/
- if (oip->i_size == 0 && oip->i_flag & IN_PAGING) {
- oip->i_flag &= ~IN_PAGING;
+ if (oip->i_size == 0 && oip->i_state & IN_PAGING) {
+ oip->i_state &= ~IN_PAGING;
TAILQ_REMOVE(&fs->lfs_pchainhd, oip, i_lfs_pchain);
}
mutex_exit(&lfs_lock);
- oip->i_flag |= IN_CHANGE;
+ oip->i_state |= IN_CHANGE;
#if defined(LFS_QUOTA) || defined(LFS_QUOTA2)
(void) lfs_chkdq(oip, -blocksreleased, NOCRED, 0);
#endif
diff -r 1a5fda52a7c8 -r f0ebdb709e94 sys/ufs/lfs/lfs_inode.h
--- a/sys/ufs/lfs/lfs_inode.h Fri Jun 09 23:49:58 2017 +0000
+++ b/sys/ufs/lfs/lfs_inode.h Sat Jun 10 05:29:36 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_inode.h,v 1.22 2017/06/08 01:23:01 chs Exp $ */
+/* $NetBSD: lfs_inode.h,v 1.23 2017/06/10 05:29:36 maya Exp $ */
/* from NetBSD: ulfs_inode.h,v 1.5 2013/06/06 00:51:50 dholland Exp */
/* from NetBSD: inode.h,v 1.72 2016/06/03 15:36:03 christos Exp */
@@ -107,7 +107,26 @@
Home |
Main Index |
Thread Index |
Old Index