(1)创建65M的system V共享内存掉败:
- shmem_get_sb –> shmem_fill_super
- //mem/shmem.c
- int shmem_fill_super(struct super_block *sb, void *data, int silent)
- {
- ...
- #ifdef CONFIG_TMPFS
- /*
- * Per default we only allow half of the physical ram per
- * tmpfs instance, limiting inodes to one per page of lowmem;
- * but the internal instance is left unlimited.
- */
- if (!(sb->s_flags & MS_NOUSER)) {///内核会设置MS_NOUSER
- sbinfo->max_blocks = shmem_default_max_blocks();
- sbinfo->max_inodes = shmem_default_max_inodes();
- if (shmem_parse_options(data, sbinfo, false)) {
- err = -EINVAL;
- goto failed;
- }
- }
- sb->s_export_op = &shmem_export_ops;
- #else
- ...
- #ifdef CONFIG_TMPFS
- static unsigned long shmem_default_max_blocks(void) {
- return totalram_pages / 2;
- }
留意CONFIG_TMPFS.
别的,在/dev/shm创建文件走VFS接口,而SYS V与匿名映射倒是经由过程shmem_file_setup实现:
推荐阅读
Win7体系U盘插入后假逝世怎么处理?有效户表示,在Win7体系下,U盘插入后体系会出现假逝世的问题,一般十几秒钟就恢复正常了,固然对操作体系毫无影响,我们却不想存在任何假设的病毒存在,>>>详细阅读
地址:http://www.17bianji.com/lsqh/36688.html
1/2 1