> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/man9/vfs_checkexp.9.md).

# VFS\_CHECKEXP.9

`VFS_CHECKEXP` — 检查文件系统是否导出给客户端

## 名称

`VFS_CHECKEXP`

## 概要

```c
#include <sys/param.h>
#include <sys/mount.h>

int
VFS_CHECKEXP(struct mount *mp, struct sockaddr *nam, uint64_t *exflagsp,
    struct ucred **credanonp, int *numsecflavor, int *secflavors)
```

## 描述

`VFS_CHECKEXP` 宏由 NFS 服务器用来检查一个挂载点是否导出给某个客户端。

它所需的参数为：

**`mp`** 要检查的挂载点。

**`nam`** 包含客户端网络地址的 mbuf。

**`exflagsp`** 返回该客户端导出标志的返回参数。

**`credanonp`** 返回该客户端匿名凭证的返回参数。

**`numsecflavors`** 返回该客户端安全风格数量的返回值。

**`secflavors`** 必须是大小为 MAXSECFLAVORS 的数组，用于返回该客户端的安全风格。

应在文件系统的挂载结构上调用 `VFS_CHECKEXP` 宏，以确定它是否导出给地址包含在 `nam` 中的客户端。

它在 NFS 服务器中，一旦获取了文件句柄对应的 vnode 就会被调用，以确定客户端在 vnode 所在文件系统上被允许的访问权限。对于 NFSv4，每当查找操作跨越服务器文件系统挂载点时也会调用它，以更新访问信息。

该操作是文件系统特定的，但通常由默认的 \`\`vfs\_stdcheckexp'' 处理。

## 返回值

特定于客户端的导出标志、匿名凭证和安全风格将通过 `*exflagsp`、`*credanonp`、`*numsecflavors` 和 `*secflavors` 返回。

## 参见

[VFS(9)](/man/man9/vfs.9.md), [VFS\_FHTOVP(9)](/man/man9/vfs_fhtovp.9.md), [vnode(9)](/man/man9/vnode.9.md), [VOP\_VPTOFH(9)](/man/man9/vop_vptofh.9.md)

## 作者

本手册页由 Alfred Perlstein 编写。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/man9/vfs_checkexp.9.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
