본문 바로가기
리눅스

[리눅스] YAFFS2

by 목가 2015. 8. 15.
반응형

YAFFS2

YAFFS는 JFFS가 모든 페이지에 대해서 데이터를 읽어야 한다는 초기화 알고리즘의 단점을 극복하기 위해 파일의 메타데이터인 아이노드를 한 페이지에 저장하는 방법을 사용하고 있다. YAFFS는여분 공간(spare area)의 ChunkID를 통해 메타데이터와 파일 데이터의 구분을 할 수 있다. 그렇기때문에 JFFS와는 달리 메타데이터가 있는 페이지가아닌 경우에는 여분 공간의 읽기만 하고 지나 갈수 있어 효율적인 초기화가 가능하다
JFFS에 비해 개선되었기는 하지만 전체 여분 공간을 읽어야 하는 이 알고리즘은 플래쉬 메모리 용량이 증가함에 따라 수행시간도 선형적으로 증가할것을 쉽게 예측할 수 있다

YAFFS는 역맵핑 기법을 사용한다.  --> 모든 데이터 페이지의 여분공간에 맵핑되는 아이노드번호를 기록한다. 이는 전체 공간을 읽어야한다.  1G는 수십초 , 따라서 대용량에서는 현실적으로 어렵다.

YAFFS2는 backward compatibility(하위 호환성)을 통해서 YAFFS1 data format 을 지원한다.
YAFFS1과의 주된 차이점은 파일이 작은 크기로 변경될 때, YAFFS1은 dirty 로 chunk들을 모두 마킹하지만 YAFFS 는 'write once' 규칙때문에 하지 않는다. (뭔소리지???) 아래 내용을 참고하자.. 

YAFFS2 is similar in concept to YAFFS1, and shares much of the same code; the YAFFS2 code base supports YAFFS1 data formats through backward compatibility. The main difference is that YAFFS2 needs to jump through significant hoops to meet the "write once" requirement of modern NAND flash.[2]

YAFFS2 marks every newly written block with a sequence number that is monotonically increasing. The sequence of the chunks can be inferred from the block sequence number and the chunk offset within the block. Thereby when YAFFS2 scans the flash and detects multiple chunks that have identical ObjectIDs and ChunkNumbers, it can choose which to use by taking the greatest sequence number. For efficiency reasons YAFFS2 also introduces the concept of shrink headers. For example when a file is resized to a smaller size, YAFFS1 will mark all of the affected chunks as dirty - YAFFS2 cannot do this due to the "write once" rule. YAFFS2 instead writes a "shrink header", which indicates that a certain number of pages before that point are invalid. This lets YAFFS2 reconstruct the final state of the filesystem when the system reboots.

YAFFS2 uses a more abstract definition of the NAND flash allowing it to be used with a wider variety of flash parts with different geometries, bad block handling rules etc.

YAFFS2 later added support for checkpointing, which bypasses normal mount scanning, allowing very fast mount times. Performance will vary, but mount times of 3 seconds for 2 GB have been reported.[citation needed]

반응형

'리눅스' 카테고리의 다른 글

[Vi 편집기] ^M 제거(없애기)  (0) 2015.08.20
[리눅스] UBIFS  (0) 2015.08.15
[리눅스] JFFS2  (0) 2015.08.15
[리눅스] MAC 충돌로 eth0이 안보일 때 해결방법  (0) 2015.08.15
[코딩] printf, printk 사용 자제  (0) 2015.08.14

댓글