1 / 14

장보길

ULKML 가상 파일 시스템 (VFS) - 2. 장보길. 한국 외국어대학교 디지털정보공학과 System Software LAB xearo@hufs.ac.kr. dentry ? 저 번 시간에 고건 교수님 강의 자료에 의하 면 사용자의 디렉토리 이동 경로를 캐싱 하는 용도. 디렉토리 엔트리의 관리 구조. dentry 구조체 (include/ linux / dcache.h ). 디렉토리 엔트리의 관리 구조. 디렉토리 엔트리의 목적. 경로 명 탐색 처리 고속화 지원

odessa
Download Presentation

장보길

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ULKML 가상 파일 시스템(VFS) - 2 장보길 한국 외국어대학교 디지털정보공학과 System Software LAB xearo@hufs.ac.kr

  2. dentry? • 저번 시간에 고건 교수님 강의 자료에 의하면 • 사용자의 디렉토리 이동 경로를 캐싱 하는 용도.

  3. 디렉토리엔트리의 관리 구조 dentry구조체 (include/linux/dcache.h)

  4. 디렉토리엔트리의 관리 구조

  5. 디렉토리엔트리의 목적 • 경로명 탐색 처리 고속화 지원 • 디렉토리의 계층 구조 관리 + 접근 했던 경로 캐싱

  6. 목적 1.경로명 탐색 처리 고속화 지원 dentry structqstrd_name; 빠른 경로 검색을 위해 dentry구조체 내에 이름을 저장 하는 d_name (structqstr) 이름, 길이, hash 값 저장

  7. dentry_hashtable dentry_hashtable 어느 헤드로 연결될지는부모 디렉토리dentry주소, 파일명의 해시 값으로 결정 헤드 dentry dentry dentry dentry dentry dentry d_hash d_lru d_hash d_lru d_hash d_lru d_hash d_lru d_hash d_lru d_hash d_lru dentry_unused

  8. 경로 탐색 처리 과정 dentry_hashtable 헤드를 먼저 찾는다. ( 앞장의 헤드 결정 방법으로) 헤드부터 연결된 dentry를 찾아 나간다. 일일이 문자열 비교로 찾는 것 보다 빠르다. 헤드 dentry dentry dentry dentry dentry dentry d_hash d_lru d_hash d_lru d_hash d_lru d_hash d_lru d_hash d_lru d_hash d_lru dentry_unused

  9. 목적2. 디렉토리의계층 구조 관리 • 사용중인 파일에 대해선 반드시 상위 계층 구조가 존재한다. • /foo/bar/baz가 오픈 되어 있다면? • /foo/bar, /foo에 대한 dentry구조체도 함께 관리

  10. 디렉토리의계층 구조 관리 1

  11. 디렉토리의 계층 구조 관리 /foo /foo d_subdir /foo/car /foo/car /foo/dar /foo/dar /foo/bar /foo/bar d_parent d_child d_parent d_child d_child d_parent d_subdir : 자식리스트의 헤더 d_child : 같은 계층끼리 리스트로 묶임 d_parent : 상위 계층의 entry 구조체를 가리킴

  12. 디렉토리의 계층 구조 관리 • /foo/bar/baz가 오픈 되었다면 윗 장의 그림 처럼 denry구조체가 상위 계층부터 하위 계층까지 구조적으로 메모리에 올라가게 된다. • 파일이 close 되더라도 dentry구조체가 바로 사라지지 않는다. • 사용한 파일은 가까운 시간 내에 접근할 가능성이 높기 때문에 캐시로 남겨둔다.

  13. inode구조체와 dentry구조체의 연결 관계 하나의 inode에 두개의dentry? 같은 파일이라도 이름이 다르면 따로따로 만들어 진다? 심볼릭링크를 의미 하는 것일까요? dentry구조체는 inode구조체를 가리킴. inode구조체 또한 dentry구조체를 가리킴.

  14. File System…….

More Related