From 4de0ae322cb45ae3620fef3a8fcf76d44208ee44 Mon Sep 17 00:00:00 2001 From: jeff Date: Tue, 4 Mar 2003 00:04:44 +0000 Subject: - Add a new 'flags' parameter to getblk(). - Define one flag GB_LOCK_NOWAIT that tells getblk() to pass the LK_NOWAIT flag to the initial BUF_LOCK(). This will eventually be used in cases were we want to use a buffer only if it is not currently in use. - Convert all consumers of the getblk() api to use this extra parameter. Reviwed by: arch Not objected to by: mckusick --- sys/fs/msdosfs/msdosfs_fat.c | 13 ++++++++----- sys/fs/msdosfs/msdosfs_vnops.c | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'sys/fs/msdosfs') diff --git a/sys/fs/msdosfs/msdosfs_fat.c b/sys/fs/msdosfs/msdosfs_fat.c index c1b8a9d..1e9a3cf 100644 --- a/sys/fs/msdosfs/msdosfs_fat.c +++ b/sys/fs/msdosfs/msdosfs_fat.c @@ -398,7 +398,8 @@ updatefats(pmp, bp, fatbn) for (i = 1; i < pmp->pm_FATs; i++) { fatbn += pmp->pm_FATsecs; /* getblk() never fails */ - bpn = getblk(pmp->pm_devvp, fatbn, bp->b_bcount, 0, 0); + bpn = getblk(pmp->pm_devvp, fatbn, bp->b_bcount, + 0, 0, 0); bcopy(bp->b_data, bpn->b_data, bp->b_bcount); if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) bwrite(bpn); @@ -1074,11 +1075,13 @@ extendfile(dep, count, bpp, ncp, flags) * Get the buf header for the new block of the file. */ if (dep->de_Attributes & ATTR_DIRECTORY) - bp = getblk(pmp->pm_devvp, cntobn(pmp, cn++), - pmp->pm_bpcluster, 0, 0); + bp = getblk(pmp->pm_devvp, + cntobn(pmp, cn++), + pmp->pm_bpcluster, 0, 0, 0); else { - bp = getblk(DETOV(dep), de_cn2bn(pmp, frcn++), - pmp->pm_bpcluster, 0, 0); + bp = getblk(DETOV(dep), + de_cn2bn(pmp, frcn++), + pmp->pm_bpcluster, 0, 0, 0); /* * Do the bmap now, as in msdosfs_write */ diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index f54fc57..910ce7b 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -711,7 +711,7 @@ msdosfs_write(ap) * or we write the cluster from its start beyond EOF, * then no need to read data from disk. */ - bp = getblk(thisvp, bn, pmp->pm_bpcluster, 0, 0); + bp = getblk(thisvp, bn, pmp->pm_bpcluster, 0, 0, 0); clrbuf(bp); /* * Do the bmap now, since pcbmap needs buffers @@ -1301,7 +1301,7 @@ msdosfs_mkdir(ap) */ bn = cntobn(pmp, newcluster); /* always succeeds */ - bp = getblk(pmp->pm_devvp, bn, pmp->pm_bpcluster, 0, 0); + bp = getblk(pmp->pm_devvp, bn, pmp->pm_bpcluster, 0, 0, 0); bzero(bp->b_data, pmp->pm_bpcluster); bcopy(&dosdirtemplate, bp->b_data, sizeof dosdirtemplate); denp = (struct direntry *)bp->b_data; -- cgit v1.1