Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178254940
D62336.1796341912.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D62336.1796341912.diff
View Options
diff --git a/sys/fs/nfsclient/nfs_clnode.c.strat b/sys/fs/nfsclient/nfs_clnode.c
--- a/sys/fs/nfsclient/nfs_clnode.c.strat
+++ b/sys/fs/nfsclient/nfs_clnode.c
@@ -60,6 +60,7 @@
#include <nfs/nfs_lock.h>
extern struct vop_vector newnfs_vnodeops;
+extern struct buf_ops buf_ops_nfs;
MALLOC_DECLARE(M_NEWNFSREQ);
uma_zone_t newnfsnode_zone;
@@ -130,6 +131,7 @@
return (error);
}
vp = nvp;
+ vp->v_bufobj.bo_ops = &buf_ops_nfs;
KASSERT(vp->v_bufobj.bo_bsize != 0, ("ncl_nget: bo_bsize == 0"));
vp->v_data = np;
np->n_vnode = vp;
diff --git a/sys/fs/nfsclient/nfs_clport.c.strat b/sys/fs/nfsclient/nfs_clport.c
--- a/sys/fs/nfsclient/nfs_clport.c.strat
+++ b/sys/fs/nfsclient/nfs_clport.c
@@ -78,6 +78,7 @@
struct mtx ncl_iod_mutex;
NFSDLOCKMUTEX;
extern struct mtx nfsrv_dslock_mtx;
+extern struct buf_ops buf_ops_nfs;
extern void (*ncl_call_invalcaches)(struct vnode *);
@@ -226,6 +227,7 @@
return (error);
}
vp = nvp;
+ vp->v_bufobj.bo_ops = &buf_ops_nfs;
KASSERT(vp->v_bufobj.bo_bsize != 0, ("nfscl_nget: bo_bsize == 0"));
vp->v_data = np;
np->n_vnode = vp;
diff --git a/sys/fs/nfsclient/nfs_clvnops.c.strat b/sys/fs/nfsclient/nfs_clvnops.c
--- a/sys/fs/nfsclient/nfs_clvnops.c.strat
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -134,7 +134,7 @@
static vop_rmdir_t nfs_rmdir;
static vop_symlink_t nfs_symlink;
static vop_readdir_t nfs_readdir;
-static vop_strategy_t nfs_strategy;
+static int nfs_strategy(struct vnode *, struct buf *);
static int nfs_lookitup(struct vnode *, char *, int,
struct ucred *, struct thread *, struct nfsnode **);
static int nfs_sillyrename(struct vnode *, struct vnode *,
@@ -189,7 +189,6 @@
.vop_rename = nfs_rename,
.vop_rmdir = nfs_rmdir,
.vop_setattr = nfs_setattr,
- .vop_strategy = nfs_strategy,
.vop_symlink = nfs_symlink,
.vop_write = ncl_write,
.vop_getacl = nfs_getacl,
@@ -3029,14 +3028,10 @@
* request.
*/
static int
-nfs_strategy(struct vop_strategy_args *ap)
+nfs_strategy(struct vnode *vp, struct buf *bp)
{
- struct buf *bp;
- struct vnode *vp;
struct ucred *cr;
- bp = ap->a_bp;
- vp = ap->a_vp;
KASSERT(bp->b_vp == vp, ("missing b_getvp"));
KASSERT(!(bp->b_flags & B_DONE),
("nfs_strategy: buffer %p unexpectedly marked B_DONE", bp));
@@ -4856,4 +4851,27 @@
break;
}
return (error);
+}
+
+static void
+nfscl_bufstrategy(struct bufobj *bo, struct buf *bp)
+{
+ int i __unused;
+ struct vnode *vp;
+
+ vp = bp->b_vp;
+ KASSERT(vp == bo->bo_private, ("Inconsistent vnode nfscl_bufstrategy"));
+ KASSERT(!VN_ISDEV(vp),
+ ("Wrong vnode in nfscl_bufstrategy(bp=%p, vp=%p)", bp, vp));
+ i = nfs_strategy(vp, bp);
+ KASSERT(i == 0, ("nfs_strategy failed bp=%p vp=%p", bp, bp->b_vp));
}
+
+struct buf_ops buf_ops_nfs = {
+ .bop_name = "buf_ops_nfs",
+ .bop_write = bufwrite,
+ .bop_strategy = nfscl_bufstrategy,
+ .bop_sync = bufsync,
+ .bop_bdflush = bufbdflush,
+};
+
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 3, 11:51 PM (23 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42195477
Default Alt Text
D62336.1796341912.diff (2 KB)
Attached To
Mode
D62336: nfscl: Set up a custom buf_ops so that VOP_STRATEGY() call is avoided
Attached
Detach File
Event Timeline