Date: Thu, 7 Mar 2019 13:51:18 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r344885 - in stable/12/sbin: fsck_ffs fsdb Message-ID: <201903071351.x27DpIdt030726@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Thu Mar 7 13:51:18 2019 New Revision: 344885 URL: https://svnweb.freebsd.org/changeset/base/344885 Log: MFC r339941 (by mckusick): In preparation for adding inode check-hashes, change the fsck_ffs inodirty() function to have a pointer to the inode being dirtied. No functional change (as for now the parameter is ununsed). Modified: stable/12/sbin/fsck_ffs/dir.c stable/12/sbin/fsck_ffs/fsck.h stable/12/sbin/fsck_ffs/inode.c stable/12/sbin/fsck_ffs/pass1.c stable/12/sbin/fsck_ffs/pass2.c stable/12/sbin/fsdb/fsdb.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/fsck_ffs/dir.c ============================================================================== --- stable/12/sbin/fsck_ffs/dir.c Thu Mar 7 13:45:36 2019 (r344884) +++ stable/12/sbin/fsck_ffs/dir.c Thu Mar 7 13:51:18 2019 (r344885) @@ -323,7 +323,7 @@ adjust(struct inodesc *idesc, int lcnt) if (preen || reply("ADJUST") == 1) { if (bkgrdflag == 0) { DIP_SET(dp, di_nlink, DIP(dp, di_nlink) - lcnt); - inodirty(); + inodirty(dp); } else { cmd.value = idesc->id_number; cmd.size = -lcnt; @@ -449,7 +449,7 @@ linkup(ino_t orphan, ino_t parentdir, char *name) pfatal("SORRY. CANNOT CREATE lost+found DIRECTORY\n\n"); return (0); } - inodirty(); + inodirty(dp); idesc.id_type = ADDR; idesc.id_func = pass4check; idesc.id_number = oldlfdir; @@ -474,7 +474,7 @@ linkup(ino_t orphan, ino_t parentdir, char *name) (void)makeentry(orphan, lfdir, ".."); dp = ginode(lfdir); DIP_SET(dp, di_nlink, DIP(dp, di_nlink) + 1); - inodirty(); + inodirty(dp); inoinfo(lfdir)->ino_linkcnt++; pwarn("DIR I=%lu CONNECTED. ", (u_long)orphan); if (parentdir != (ino_t)-1) { @@ -535,7 +535,7 @@ makeentry(ino_t parent, ino_t ino, const char *name) dp = ginode(parent); if (DIP(dp, di_size) % DIRBLKSIZ) { DIP_SET(dp, di_size, roundup(DIP(dp, di_size), DIRBLKSIZ)); - inodirty(); + inodirty(dp); } if ((ckinode(dp, &idesc) & ALTERED) != 0) return (1); @@ -591,7 +591,7 @@ expanddir(union dinode *dp, char *name) else if (reply("EXPAND") == 0) goto bad; dirty(bp); - inodirty(); + inodirty(dp); return (1); bad: DIP_SET(dp, di_db[lastbn], DIP(dp, di_db[lastbn + 1])); @@ -632,7 +632,7 @@ allocdir(ino_t parent, ino_t request, int mode) memmove(cp, &emptydir, sizeof emptydir); dirty(bp); DIP_SET(dp, di_nlink, 2); - inodirty(); + inodirty(dp); if (ino == UFS_ROOTINO) { inoinfo(ino)->ino_linkcnt = DIP(dp, di_nlink); cacheino(dp, ino); @@ -653,7 +653,7 @@ allocdir(ino_t parent, ino_t request, int mode) } dp = ginode(parent); DIP_SET(dp, di_nlink, DIP(dp, di_nlink) + 1); - inodirty(); + inodirty(dp); return (ino); } @@ -668,7 +668,7 @@ freedir(ino_t ino, ino_t parent) if (ino != parent) { dp = ginode(parent); DIP_SET(dp, di_nlink, DIP(dp, di_nlink) - 1); - inodirty(); + inodirty(dp); } freeino(ino); } Modified: stable/12/sbin/fsck_ffs/fsck.h ============================================================================== --- stable/12/sbin/fsck_ffs/fsck.h Thu Mar 7 13:45:36 2019 (r344884) +++ stable/12/sbin/fsck_ffs/fsck.h Thu Mar 7 13:51:18 2019 (r344885) @@ -450,7 +450,7 @@ union dinode *ginode(ino_t inumber); void infohandler(int sig); void alarmhandler(int sig); void inocleanup(void); -void inodirty(void); +void inodirty(union dinode *); struct inostat *inoinfo(ino_t inum); void IOstats(char *what); int linkup(ino_t orphan, ino_t parentdir, char *name); Modified: stable/12/sbin/fsck_ffs/inode.c ============================================================================== --- stable/12/sbin/fsck_ffs/inode.c Thu Mar 7 13:45:36 2019 (r344884) +++ stable/12/sbin/fsck_ffs/inode.c Thu Mar 7 13:51:18 2019 (r344885) @@ -102,7 +102,7 @@ ckinode(union dinode *dp, struct inodesc *idesc) printf( "YOU MUST RERUN FSCK AFTERWARDS\n"); rerun = 1; - inodirty(); + inodirty(dp); } } @@ -142,7 +142,7 @@ ckinode(union dinode *dp, struct inodesc *idesc) printf( "YOU MUST RERUN FSCK AFTERWARDS\n"); rerun = 1; - inodirty(); + inodirty(dp); break; } } @@ -221,7 +221,7 @@ iblock(struct inodesc *idesc, long ilevel, off_t isize printf( "YOU MUST RERUN FSCK AFTERWARDS\n"); rerun = 1; - inodirty(); + inodirty(dp); bp->b_flags &= ~B_INUSE; return(STOP); } @@ -519,7 +519,7 @@ inocleanup(void) } void -inodirty(void) +inodirty(union dinode *dp) { dirty(pbp); @@ -544,7 +544,7 @@ clri(struct inodesc *idesc, const char *type, int flag (void)ckinode(dp, idesc); inoinfo(idesc->id_number)->ino_state = USTATE; clearinode(dp); - inodirty(); + inodirty(dp); } else { cmd.value = idesc->id_number; cmd.size = -DIP(dp, di_nlink); @@ -711,7 +711,7 @@ allocino(ino_t request, int type) DIP_SET(dp, di_size, sblock.fs_fsize); DIP_SET(dp, di_blocks, btodb(sblock.fs_fsize)); n_files++; - inodirty(); + inodirty(dp); inoinfo(ino)->ino_type = IFTODT(type); return (ino); } @@ -732,7 +732,7 @@ freeino(ino_t ino) dp = ginode(ino); (void)ckinode(dp, &idesc); clearinode(dp); - inodirty(); + inodirty(dp); inoinfo(ino)->ino_state = USTATE; n_files--; } Modified: stable/12/sbin/fsck_ffs/pass1.c ============================================================================== --- stable/12/sbin/fsck_ffs/pass1.c Thu Mar 7 13:45:36 2019 (r344884) +++ stable/12/sbin/fsck_ffs/pass1.c Thu Mar 7 13:51:18 2019 (r344885) @@ -271,7 +271,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r if (reply("CLEAR") == 1) { dp = ginode(inumber); clearinode(dp); - inodirty(); + inodirty(dp); } } inoinfo(inumber)->ino_state = USTATE; @@ -294,7 +294,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r dp = ginode(inumber); DIP_SET(dp, di_size, sblock.fs_fsize); DIP_SET(dp, di_mode, IFREG|0600); - inodirty(); + inodirty(dp); } if ((mode == IFBLK || mode == IFCHR || mode == IFIFO || mode == IFSOCK) && DIP(dp, di_size) != 0) { @@ -412,7 +412,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r if (bkgrdflag == 0) { dp = ginode(inumber); DIP_SET(dp, di_blocks, idesc->id_entryno); - inodirty(); + inodirty(dp); } else { cmd.value = idesc->id_number; cmd.size = idesc->id_entryno - DIP(dp, di_blocks); @@ -472,7 +472,7 @@ unknown: inoinfo(inumber)->ino_state = USTATE; dp = ginode(inumber); clearinode(dp); - inodirty(); + inodirty(dp); } return (1); } Modified: stable/12/sbin/fsck_ffs/pass2.c ============================================================================== --- stable/12/sbin/fsck_ffs/pass2.c Thu Mar 7 13:45:36 2019 (r344884) +++ stable/12/sbin/fsck_ffs/pass2.c Thu Mar 7 13:51:18 2019 (r344885) @@ -114,7 +114,7 @@ pass2(void) dp = ginode(UFS_ROOTINO); DIP_SET(dp, di_mode, DIP(dp, di_mode) & ~IFMT); DIP_SET(dp, di_mode, DIP(dp, di_mode) | IFDIR); - inodirty(); + inodirty(dp); break; case DSTATE: @@ -160,7 +160,7 @@ pass2(void) if (reply("FIX") == 1) { dp = ginode(inp->i_number); DIP_SET(dp, di_size, inp->i_isize); - inodirty(); + inodirty(dp); } } else if ((inp->i_isize & (DIRBLKSIZ - 1)) != 0) { getpathname(pathbuf, inp->i_number, inp->i_number); @@ -179,7 +179,7 @@ pass2(void) dp = ginode(inp->i_number); DIP_SET(dp, di_size, roundup(inp->i_isize, DIRBLKSIZ)); - inodirty(); + inodirty(dp); } } dp = &dino; Modified: stable/12/sbin/fsdb/fsdb.c ============================================================================== --- stable/12/sbin/fsdb/fsdb.c Thu Mar 7 13:45:36 2019 (r344884) +++ stable/12/sbin/fsdb/fsdb.c Thu Mar 7 13:51:18 2019 (r344885) @@ -342,7 +342,7 @@ CMDFUNCSTART(zapi) GETINUM(1,inum); dp = ginode(inum); clearinode(dp); - inodirty(); + inodirty(dp); if (curinode) /* re-set after potential change */ curinode = ginode(curinum); return 0; @@ -372,7 +372,7 @@ CMDFUNCSTART(uplink) DIP_SET(curinode, di_nlink, DIP(curinode, di_nlink) + 1); printf("inode %ju link count now %d\n", (uintmax_t)curinum, DIP(curinode, di_nlink)); - inodirty(); + inodirty(curinode); return 0; } @@ -383,7 +383,7 @@ CMDFUNCSTART(downlink) DIP_SET(curinode, di_nlink, DIP(curinode, di_nlink) - 1); printf("inode %ju link count now %d\n", (uintmax_t)curinum, DIP(curinode, di_nlink)); - inodirty(); + inodirty(curinode); return 0; } @@ -921,7 +921,7 @@ CMDFUNCSTART(newtype) } DIP_SET(curinode, di_mode, DIP(curinode, di_mode) & ~IFMT); DIP_SET(curinode, di_mode, DIP(curinode, di_mode) | type); - inodirty(); + inodirty(curinode); printactive(0); return 0; } @@ -942,7 +942,7 @@ CMDFUNCSTART(chlen) } DIP_SET(curinode, di_size, len); - inodirty(); + inodirty(curinode); printactive(0); return rval; } @@ -964,7 +964,7 @@ CMDFUNCSTART(chmode) DIP_SET(curinode, di_mode, DIP(curinode, di_mode) & ~07777); DIP_SET(curinode, di_mode, DIP(curinode, di_mode) | modebits); - inodirty(); + inodirty(curinode); printactive(0); return rval; } @@ -989,7 +989,7 @@ CMDFUNCSTART(chaflags) return(1); } DIP_SET(curinode, di_flags, flags); - inodirty(); + inodirty(curinode); printactive(0); return rval; } @@ -1014,7 +1014,7 @@ CMDFUNCSTART(chgen) return(1); } DIP_SET(curinode, di_gen, gen); - inodirty(); + inodirty(curinode); printactive(0); return rval; } @@ -1064,7 +1064,7 @@ CMDFUNCSTART(linkcount) } DIP_SET(curinode, di_nlink, lcnt); - inodirty(); + inodirty(curinode); printactive(0); return rval; } @@ -1091,7 +1091,7 @@ CMDFUNCSTART(chowner) } DIP_SET(curinode, di_uid, uid); - inodirty(); + inodirty(curinode); printactive(0); return rval; } @@ -1117,7 +1117,7 @@ CMDFUNCSTART(chgroup) } DIP_SET(curinode, di_gid, gid); - inodirty(); + inodirty(curinode); printactive(0); return rval; } @@ -1186,7 +1186,7 @@ CMDFUNCSTART(chbtime) return 1; curinode->dp2.di_birthtime = _time_to_time64(secs); curinode->dp2.di_birthnsec = nsecs; - inodirty(); + inodirty(curinode); printactive(0); return 0; } @@ -1203,7 +1203,7 @@ CMDFUNCSTART(chmtime) else curinode->dp2.di_mtime = _time_to_time64(secs); DIP_SET(curinode, di_mtimensec, nsecs); - inodirty(); + inodirty(curinode); printactive(0); return 0; } @@ -1220,7 +1220,7 @@ CMDFUNCSTART(chatime) else curinode->dp2.di_atime = _time_to_time64(secs); DIP_SET(curinode, di_atimensec, nsecs); - inodirty(); + inodirty(curinode); printactive(0); return 0; } @@ -1237,7 +1237,7 @@ CMDFUNCSTART(chctime) else curinode->dp2.di_ctime = _time_to_time64(secs); DIP_SET(curinode, di_ctimensec, nsecs); - inodirty(); + inodirty(curinode); printactive(0); return 0; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903071351.x27DpIdt030726>