pNFS系统的部署过程见这篇文章:http://blog.youkuaiyun.com/ycnian/article/details/8523193。这篇文章中我们讲讲MDS的初始化过程,主要想讲讲向文件/proc/fs/nfsd/pnfs_dlm_device中写入数据后MDS做了哪些工作,以下面这条命令为例。
[root@180 ~]# echo "sdb:192.168.6.180,192.168.6.182" >/proc/fs/nfsd/pnfs_dlm_device
这个文件的处理函数是__write_pnfs_dlm_device(),这个函数很简单,代码如下:
static ssize_t __write_pnfs_dlm_device(struct file *file, char *buf,
size_t size)
{
char *mesg = buf;
char *pnfs_dlm_device;
int max_size = NFSD_PNFS_DLM_DEVICE_MAX;
int len, ret = 0;
if (size > 0) { // 用户输入了内容.
ret = -EINVAL;
if (size > max_size || buf[size-1] != '\n') // 不能超出最大长度.