aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2019-10-04 05:28:36 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2019-10-04 05:28:36 +0000
commit44d37182ce57ce95bbea92309a1abc7e3f3b6096 (patch)
tree4fa122bf6bd65d671b1e8f4f4d448ff86aa2e7d7 /sys/ufs
parentf4ddd499736b38d9a072fdd84410d6fd2d0cd67b (diff)
downloadsrc-44d37182ce57ce95bbea92309a1abc7e3f3b6096.tar.gz
src-44d37182ce57ce95bbea92309a1abc7e3f3b6096.zip
Update ffs_getcg() function to accept a flags parameter to be passed
to breadn_flags() in preparation for later need when doing forcible unmount when disk dies or is removed. No functional change. Sponsored by: Netflix
Notes
Notes: svn path=/head/; revision=353099
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_alloc.c24
-rw-r--r--sys/ufs/ffs/ffs_extern.h2
-rw-r--r--sys/ufs/ffs/ffs_snapshot.c2
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c2
-rw-r--r--sys/ufs/ufs/ufs_gjournal.c2
5 files changed, 16 insertions, 16 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 386cfb6064fe..02bd38e01169 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -1689,7 +1689,7 @@ ffs_fragextend(ip, cg, bprev, osize, nsize)
return (0);
}
UFS_UNLOCK(ump);
- if ((error = ffs_getcg(fs, ump->um_devvp, cg, &bp, &cgp)) != 0)
+ if ((error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp)) != 0)
goto fail;
bno = dtogd(fs, bprev);
blksfree = cg_blksfree(cgp);
@@ -1760,7 +1760,7 @@ ffs_alloccg(ip, cg, bpref, size, rsize)
if (fs->fs_cs(fs, cg).cs_nbfree == 0 && size == fs->fs_bsize)
return (0);
UFS_UNLOCK(ump);
- if ((error = ffs_getcg(fs, ump->um_devvp, cg, &bp, &cgp)) != 0 ||
+ if ((error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp)) != 0 ||
(cgp->cg_cs.cs_nbfree == 0 && size == fs->fs_bsize))
goto fail;
if (size == fs->fs_bsize) {
@@ -1940,7 +1940,7 @@ ffs_clusteralloc(ip, cg, bpref, len)
if (fs->fs_maxcluster[cg] < len)
return (0);
UFS_UNLOCK(ump);
- if ((error = ffs_getcg(fs, ump->um_devvp, cg, &bp, &cgp)) != 0) {
+ if ((error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp)) != 0) {
UFS_LOCK(ump);
return (0);
}
@@ -2082,7 +2082,7 @@ check_nifree:
if (fs->fs_cs(fs, cg).cs_nifree == 0)
return (0);
UFS_UNLOCK(ump);
- if ((error = ffs_getcg(fs, ump->um_devvp, cg, &bp, &cgp)) != 0) {
+ if ((error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp)) != 0) {
UFS_LOCK(ump);
return (0);
}
@@ -2179,7 +2179,7 @@ gotit:
* to it, then leave it unchanged as the other thread
* has already set it correctly.
*/
- error = ffs_getcg(fs, ump->um_devvp, cg, &bp, &cgp);
+ error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp);
UFS_LOCK(ump);
ACTIVECLEAR(fs, cg);
UFS_UNLOCK(ump);
@@ -2261,7 +2261,7 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd)
ffs_fserr(fs, inum, "bad block");
return;
}
- if ((error = ffs_getcg(fs, devvp, cg, &bp, &cgp)) != 0)
+ if ((error = ffs_getcg(fs, devvp, cg, 0, &bp, &cgp)) != 0)
return;
cgbno = dtogd(fs, bno);
blksfree = cg_blksfree(cgp);
@@ -2728,7 +2728,7 @@ ffs_checkblk(ip, bno, size)
}
if ((u_int)bno >= fs->fs_size)
panic("ffs_checkblk: bad block %jd", (intmax_t)bno);
- error = ffs_getcg(fs, ITODEVVP(ip), dtog(fs, bno), &bp, &cgp);
+ error = ffs_getcg(fs, ITODEVVP(ip), dtog(fs, bno), 0, &bp, &cgp);
if (error)
panic("ffs_checkblk: cylinder group read failed");
blksfree = cg_blksfree(cgp);
@@ -2802,7 +2802,7 @@ ffs_freefile(ump, fs, devvp, ino, mode, wkhd)
if (ino >= fs->fs_ipg * fs->fs_ncg)
panic("ffs_freefile: range: dev = %s, ino = %ju, fs = %s",
devtoname(dev), (uintmax_t)ino, fs->fs_fsmnt);
- if ((error = ffs_getcg(fs, devvp, cg, &bp, &cgp)) != 0)
+ if ((error = ffs_getcg(fs, devvp, cg, 0, &bp, &cgp)) != 0)
return (error);
inosused = cg_inosused(cgp);
ino %= fs->fs_ipg;
@@ -2855,7 +2855,7 @@ ffs_checkfreefile(fs, devvp, ino)
return (1);
if (ino >= fs->fs_ipg * fs->fs_ncg)
return (1);
- if ((error = ffs_getcg(fs, devvp, cg, &bp, &cgp)) != 0)
+ if ((error = ffs_getcg(fs, devvp, cg, 0, &bp, &cgp)) != 0)
return (1);
inosused = cg_inosused(cgp);
ino %= fs->fs_ipg;
@@ -2944,21 +2944,21 @@ ffs_getmntstat(struct vnode *devvp)
* Fetch and verify a cylinder group.
*/
int
-ffs_getcg(fs, devvp, cg, bpp, cgpp)
+ffs_getcg(fs, devvp, cg, flags, bpp, cgpp)
struct fs *fs;
struct vnode *devvp;
u_int cg;
+ int flags;
struct buf **bpp;
struct cg **cgpp;
{
struct buf *bp;
struct cg *cgp;
const struct statfs *sfs;
- int flags, error;
+ int error;
*bpp = NULL;
*cgpp = NULL;
- flags = 0;
if ((fs->fs_metackhash & CK_CYLGRP) != 0)
flags |= GB_CKHASH;
error = breadn_flags(devvp, devvp->v_type == VREG ?
diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h
index 140f5d15f86e..eff082fc9b45 100644
--- a/sys/ufs/ffs/ffs_extern.h
+++ b/sys/ufs/ffs/ffs_extern.h
@@ -80,7 +80,7 @@ void ffs_fragacct(struct fs *, int, int32_t [], int);
int ffs_freefile(struct ufsmount *, struct fs *, struct vnode *, ino_t,
int, struct workhead *);
void ffs_fserr(struct fs *, ino_t, char *);
-int ffs_getcg(struct fs *, struct vnode *, u_int, struct buf **,
+int ffs_getcg(struct fs *, struct vnode *, u_int, int, struct buf **,
struct cg **);
int ffs_isblock(struct fs *, u_char *, ufs1_daddr_t);
int ffs_isfreeblock(struct fs *, u_char *, ufs1_daddr_t);
diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c
index fd43ced08b53..bfe89bfe8eee 100644
--- a/sys/ufs/ffs/ffs_snapshot.c
+++ b/sys/ufs/ffs/ffs_snapshot.c
@@ -899,7 +899,7 @@ cgaccount(cg, vp, nbp, passno)
ip = VTOI(vp);
fs = ITOFS(ip);
- if ((error = ffs_getcg(fs, ITODEVVP(ip), cg, &bp, &cgp)) != 0)
+ if ((error = ffs_getcg(fs, ITODEVVP(ip), cg, 0, &bp, &cgp)) != 0)
return (error);
UFS_LOCK(ITOUMP(ip));
ACTIVESET(fs, cg);
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 058512d4a24e..8256874df3fc 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1880,7 +1880,7 @@ ffs_fhtovp(mp, fhp, flags, vpp)
if (fs->fs_magic != FS_UFS2_MAGIC)
return (ufs_fhtovp(mp, ufhp, flags, vpp));
cg = ino_to_cg(fs, ino);
- if ((error = ffs_getcg(fs, ump->um_devvp, cg, &bp, &cgp)) != 0)
+ if ((error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp)) != 0)
return (error);
if (ino >= cg * fs->fs_ipg + cgp->cg_initediblk) {
brelse(bp);
diff --git a/sys/ufs/ufs/ufs_gjournal.c b/sys/ufs/ufs/ufs_gjournal.c
index 3e62954bd4ae..a41dc7c04a88 100644
--- a/sys/ufs/ufs/ufs_gjournal.c
+++ b/sys/ufs/ufs/ufs_gjournal.c
@@ -85,7 +85,7 @@ ufs_gjournal_modref(struct vnode *vp, int count)
if ((u_int)ino >= fs->fs_ipg * fs->fs_ncg)
panic("ufs_gjournal_modref: range: dev = %s, ino = %lu, fs = %s",
devtoname(dev), (u_long)ino, fs->fs_fsmnt);
- if ((error = ffs_getcg(fs, devvp, cg, &bp, &cgp)) != 0)
+ if ((error = ffs_getcg(fs, devvp, cg, 0, &bp, &cgp)) != 0)
return (error);
cgp->cg_unrefs += count;
UFS_LOCK(ump);