MDC模块是处在Lustre Lite之下的一层。它定义了一些元数据相关的函数, Lustre Lite可以调用这些函数来向MDS传输元数据请求。这些函数在lustre/mdc中实现,我们将在6.3节讨论它们。
Lustre Lite在mdc_op_data数据结构中传递请求参数,所有的请求最终要转化为ptl_request结构。所以,在RPC请求执行之前,有一些准备步骤(打包)。为这个目的,在mdc_lib.c里,定义了一些函数。而这些函数中的其中一部分实际上调用了由PortalRPC层提供的打包帮助函数。
一旦ptl_request准备好,MDC就可以调用ptlrpc_queue_wait()来发送请求。这是一个同步操作。所有的包含意图的元数据操作也是同步的。也有其他一些用来进行发送操作的ptlrpc方法,它们被用来进行无意图的元数据操作(mdc_reint)——这些在源码mdc_reint.c中完成。
在大部分情况下,对由mdc_op_data到ptl_request转换的驱动,和对请求入队列的调用,都是在mdc_enqueue中进行的,这在lustre/mdc/mdc_locks.c里实现。
根据分条EA是否被创建,有三种格式:
- 盘上格式,在存储在MDS磁盘上时使用,由结构体lov_mds_md描述。
- 内存中格式,在读入内存和解包后使用,由结构体lov_stripe_md描述。
- 用户格式,在信息向用户呈现时使用,由结构体lov_user_md描述。
用户格式和盘上格式的不同体现在两方面:
- 用户格式有lmm_stripe_offset而盘上格式则没有,这个字段用来在用户想要设置分条时将striping_index参数传递给Lustre。
- 用户格式有一个16比特的lmm_stripe_count,而盘上格式是32比特。
为了处理分条EA,定义了五类API。如下所列:
设置/获取API 用来从存储器中设置或获取分条EA。它对盘上分条EA进行操作。
intfsfilt_set_md(struct obd_device *obd, struct inode *inode,
void *handle, void*md, int size, const char *name)
intfsfilt_get_md(struct obd_device *obd, struct inode *inode,
void *md, int size,const char *name)
这里,md是分条EA的缓冲,handle是日志处理函数,而inode指向MDS对象。
打包/解包API 由于EA在磁盘中以打包的方式存储,所以它们需要在调用fsfilt_get_md()之后解包。这些API可以对盘上或者内存中的分条EA使用。
intobd_packmd(struct obd_export *exp, struct lov_mds_md **disk_tgt,
struct lov_stripe_md *mem_src)
intobd_unpackmd(struct obd_export *exp, struct lov_stripe_md **mem_tgt,
struct lov_mds_md *disk_src, int disk_len)
这里,mem_src指向分条EA的内存中结构,而disk_tgt指向分条EA的盘上结构。反过来,disk_src是盘上分条EA源,而mem_tgt是内存中的分条EA目的。
分配/释放API 分配和释放内存中和盘上的分条EA。
voidobd_size_diskmd(struct obd_export *exp, struct lov_mds_md *dis_tgt)
intobd_alloc_diskmd(struct obd_export *exp, struct lov_mds_md **disk_tgt)
intobd_free_diskmd(struct obd_export *exp, struct lov_mds_md **disk_tgt)
intobd_alloc_memmd(struct obd_export *exp, struct lov_stripe_md **mem_tgt)
intobd_free_memmd(struct obd_export *exp, struct lov_stripe_md **mem_tgt)
分条定位API 从分条EA中返回数据对象位置信息。
obd_sizelove_stripe_size(struct lov_stripe_md *lsm, obd_size ost_size, int stripeno)
intlov_stripe_offset(struct lov_stripe_md *lsm, obd_off lov_off,
int stripeno, obd_off *obd_off)
intlov_stripe_number(struct lov_stripe_md *lsm, obd_off lov_off)
这里,lov_off是文件逻辑偏移量。stripeno是数据对象的分条数量。
lfs API 用户层的用来处理分条EA的API,这由lfs工具使用。
intllapi_file_get_stripe(const char *path, struct lov_user_md *lum)
intllapi_file_open(const char *name, int flags, int mode,
unsigned long stripe_size, intstripe_offset, int stripe_count,int stripe_pattern)
这里llapi_file_get_stripe()在给定路径时,返回用户分条EA,而llapi_file_open()打开或者创建文件,该文件使用用户定义的分条模式。值得指出的是,stripe_offset和用户空间中使用的stripe_index相同,它是首个分条的OST索引。
本文章欢迎转载,请保留原始博客链接http://blog.csdn.net/fsdev/article
分享到:
相关推荐
深入理解Lustre文件系统
Lustre是一个开源的、基于对象存储技术的集群并行分布式文件系统,它具有很高的可扩展性、可用性、性能、易用性等,在高性能计算系统中被广泛使用。它主要包括三个部分:元数据服务器MDS (Metadata Server)、对象...
Lustre文件系统架构和配置调优.docx
Lustre 文件系统操作手册
资源来自pypi官网。 资源全名:aws_orbit_lustre-1.0.1-py3-none-any.whl
包括Lustre mannul , Lustre internals , Lustre quick start ,Lustre arthitecture等资料
面向数据密集型应用的Lustre文件系统
并行文件系统lustre手册,pdf文件,介绍lustre文件系统架构,系统管理,操作手册
Lustre is a storage architecture for clusters. The central component is the Lustre file system, which is available for Linux and provides a POSIX-compliant UNIX file system interface.
Lustre is a shared disk file system, generally used for large scale cluster computing. The name Lustre is a portmanteau of Linux and cluster. The project aims to provide a file system for clusters of ...
本文档是本人在调研Lustre文件系统式时的总结!
PHARphp composer.phar安装扩展composer require lustre/php-dfa-sensitive注意:如果你在使用composer安装时,出现Could not find package lustre/php-dfa-sensitive at any version for your minimum-stability ...
自2005年6月以来,它持续在超级计算机世界排名前十中占有至少一半的席位,前排名前100的超级计算机中,至少60个超级计算机使用Lustre,其中包括在2014
该项目是由Intel高性能数据部门开发的,该部门是Lustre文件系统的主要贡献者之一。 我们欢迎社区的参与和贡献。生成和安装说明要求: JDK 1.7以上Maven 3.0或更高版本首次构建的Internet连接(以获取所有Maven和...
#资源达人分享计划#
官方离线安装包,亲测可用。使用rpm -ivh [rpm完整包名] 进行安装
lustre分布式并行文件系统介绍
分布式文件系统需要有一种机制对来自各个客户端的并发访问进行控制,维护文件数据的一致性。锁是实现并发控制最流行的机制。研究了Lustre 文件系统的分布式I/O 范围锁的模型,并对它的各种应用进行了优化。介绍了...
官方离线安装包,亲测可用。使用rpm -ivh [rpm完整包名] 进行安装