KR20210156682A - How to manage meta-data of a file system using a database management system - Google Patents
How to manage meta-data of a file system using a database management system Download PDFInfo
- Publication number
- KR20210156682A KR20210156682A KR1020200074560A KR20200074560A KR20210156682A KR 20210156682 A KR20210156682 A KR 20210156682A KR 1020200074560 A KR1020200074560 A KR 1020200074560A KR 20200074560 A KR20200074560 A KR 20200074560A KR 20210156682 A KR20210156682 A KR 20210156682A
- Authority
- KR
- South Korea
- Prior art keywords
- file
- data
- file system
- module
- disk
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/16—File or folder operations, e.g. details of user interfaces specifically adapted to file systems
- G06F16/164—File meta data generation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/1727—Details of free space management performed by the file system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/1865—Transactional file systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2379—Updates performed during online database operations; commit processing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
본 발명은 파일 시스템에 관한 것으로, 더욱 상세하게는 데이터베이스 솔루션을 이용하여 파일 시스템의 메타데이터를 관리하는 방법에 관한 것이다.The present invention relates to a file system, and more particularly, to a method for managing metadata of a file system using a database solution.
예전과 달리, 최근 멀티미디어 기술이 발달하며 PVR(Personal Video Recorder), 캠코더, 휴대폰 등 많은 가전기기들이 하드 디스크를 장착하여 출시되고 있으며, 이에 따라 디스크를 이용하여 데이터를 효율적으로 관리하는 기술에 대한 연구가 활발히 진행되고 있다.Unlike the past, with the recent development of multimedia technology, many home appliances such as PVR (Personal Video Recorder), camcorder, and mobile phone are being released with hard disk installed. is being actively pursued.
디스크의 데이터 입출력과 관련된 다양한 정책을 결정하는 파일 시스템에서 일관성(consistency)은 매우 중요한 이슈이다. 파일 시스템의 일관성은 메타 데이터의 일관성과 데이터의 일관성으로 구분할 수 있다. 파일 시스템의 메타 데이터에는 아이노드(I-node), 디렉토리, 디스크의 빈 공간에 관한 정보, 빈(free) 아이노드에 관한 정보 등이 있는데, 이러한 메타 데이터와 관련된 동작들(operations)이 하나의 트랜잭션(transaction)으로서 수행되면 메타 데이터의 일관성이 지켜질 수 있다. 마찬가지로, 데이터의 일관성은 데이터 트랜잭션에 의해 지켜질수 있으며, 파일의 일부를 업데이트하는 데이터 트랜잭션이 업데이트 도중에 철회(abort)되면, 그 데이터 트랜잭션은 완료(complete)되거나, 또는 아예 처음부터 일어나지 않은 것처럼 버려진다.Consistency is a very important issue in a file system that determines various policies related to disk data input/output. File system consistency can be divided into metadata consistency and data consistency. Metadata of the file system includes information about I-nodes, directories, and free disk space, and information about free inodes. When performed as a transaction, the consistency of metadata can be maintained. Similarly, data consistency can be ensured by data transactions, and if a data transaction that updates a part of a file is aborted during the update, the data transaction is either complete or discarded as if it never happened in the first place. .
한편, 데이터베이스 관리 시스템(Database Management System, 이하 DBMS라 칭함)은 빠르고 효과적인 데이터 구조를 이용하여 데이터를 신뢰성있게 저장하며, 트랜잭션을 보장한다. 종래에는 이러한 DBMS 솔루션을 오퍼레이팅 시스템(Operating System, 이하 OS라고 칭함)에 적용하여 파일 시스템의 일관성을 확보하려는 시도가있었다.On the other hand, a database management system (hereinafter referred to as DBMS) reliably stores data using a fast and effective data structure and guarantees transactions. Conventionally, there has been an attempt to secure file system consistency by applying such a DBMS solution to an operating system (hereinafter referred to as an operating system).
도 1은 데이터베이스를 도입한 파일 시스템의 구성을 나타낸 도면이다.1 is a diagram showing the configuration of a file system in which a database is introduced.
도 1에 도시된 파일 시스템에서는 커널 버클리 데이터베이스(KBDM)를 DBMS로 이용하여 파일 시스템의 메타데이터 및 파일 데이터를 관리하고 있으며, 데이터베이스는 기존의 파일 시스템(Ext2)에 저장되어 있다. 이러한 구성에 의하면, 파일 시스템의 모든 동작들(operations)은 DBMS를 통하여 수행된다.In the file system shown in FIG. 1, metadata and file data of the file system are managed by using the kernel Berkeley database (KBDM) as a DBMS, and the database is stored in the existing file system (Ext2). According to this configuration, all operations of the file system are performed through the DBMS.
예를 들면, 특정 파일을 읽어올 때에는 DBMS에 액세스하여 block.db에 저장되어 있는 파일 데이터를 버퍼 캐쉬에 복사하며, 파일에 데이터를 쓸 때에는 버퍼 캐쉬에 저장된 데이터를 block.db의 해당 기록(record)에 저장한다. 그 밖에 파일 I/O 외의 동작들도 마찬가지로 관련된 데이터베이스를 통하여 수행되므로, 결국 파일 시스템의 일관성을 보장할 수 있다.For example, when reading a specific file, it accesses the DBMS and copies the file data stored in block.db to the buffer cache. When writing data to a file, the data stored in the buffer cache is copied to the corresponding record in block.db. ) is stored in In addition, since operations other than file I/O are also performed through the related database, the consistency of the file system can be guaranteed.
그러나, 이러한 파일 시스템(KBDBFS)은 데이터베이스가 저장된 파일 시스템(Ext2)에 종속적이어서 다양한 환경에 맞추어 최적화할 수 없다. 즉, DBMS(KBDB)는 단지 트랜잭셔널한 동작들(transactional operations)을 제공할 뿐, 파일 시스템의 크기, 디스크 할당(disk allocation) 등은 데이터베이스가 저장된 파일 시스템에 의해 결 정된다. 예를 들어, 이러한 파일 시스템에서 디스크에 데이터를 저장할 때 파일 시스템(KBDBFS)은 데이터를DBMS(KBDB)에 입력하고, DBMS(KBDB)는 Ext2를 통해 데이터를 디스크에 저장하므로, 파일 시스템(KBDBFS)은 실제디스크의 레이아웃(layout)에는 관여할 수 없다. 따라서, 이러한 파일 시스템에 따르면 환경에 최적화된 알고리즘이 설계되더라도 이를 반영하여 디스크의 블록을 할당할 수 없는 문제가 있다. 또한, 일반적으로 파일의 크기가 큰 멀티미디어 환경에서는 DBMS가 생성하는 로그(log)의 크기가 커지므로 파일 시스템의 성능이 저하되는 문제도 발생한다.However, this file system (KBDBFS) is dependent on the file system (Ext2) in which the database is stored, and thus cannot be optimized for various environments. That is, DBMS (KBDB) merely provides transactional operations, and the size of the file system, disk allocation, etc. are determined by the file system in which the database is stored. For example, when these file systems store data to disk, the file system (KBDBFS) puts the data into DBMS (KBDB), and the DBMS (KBDB) stores data to disk via Ext2, so the file system (KBDBFS) cannot participate in the layout of the actual disk. Therefore, according to such a file system, even if an algorithm optimized for the environment is designed, there is a problem that blocks of the disk cannot be allocated by reflecting this. In addition, in a multimedia environment where the file size is large, the size of the log generated by the DBMS increases, so that the performance of the file system is deteriorated.
본 발명은 파일 시스템의 메타 데이터는 DBMS를 이용하여 관리하고, 파일 데이터는 DBMS를 통하지 않고 직접 디스크로부터/디스크에 입출력하는 방법을 제공하는 데 그 목적이 있다.An object of the present invention is to provide a method in which metadata of a file system is managed using a DBMS and file data is directly input/output from/to a disk without going through the DBMS.
이러한 목적을 달성하기 위해 본 발명은, 파일 시스템에서 데이터를 관리하는 방법에 있어서, (a) 애플리케이션으로부터 데이터 쓰기 요청이 수신됨에 따라 상기 파일 시스템의 메타데이터를 관리하는 소정의 데이터베이스관리시스템(DataBase Management System)을 통해 디스크에 존재하는 빈 공간을 검색하는 단계; (b) 상기 검색결과를 참조하여 상기 데이터를 상기 데이터베이스관리시스템을 통하지 않고 상기 디스크의 빈 공간에 쓰는 단계; 및 (c) 상기 메타 데이터 중 상기 데이터가 써짐에 따라 변경된 부분을 상기 데이터베이스관리시스템을 통해 업데이트하는 단계를 포함하는 것을 특징으로 한다.In order to achieve this object, the present invention provides a method for managing data in a file system, (a) a predetermined database management system (DataBase Management) that manages metadata of the file system as a data write request is received from an application System) to search for free space on the disk; (b) writing the data to an empty space of the disk without going through the database management system with reference to the search result; and (c) updating a part of the metadata that is changed as the data is written through the database management system.
여기서, 상기 (a)단계 내지 상기 (c)단계는 상기 데이터베이스관리시스템에 의해 하나의 트랜잭션(transaction)으로서 관리되는 것이 바람직하다.Here, the steps (a) to (c) are preferably managed as one transaction by the database management system.
또한, 상기 파일 시스템은 사용자 레벨(User-Level)에서 동작하는 것이 바람직하다.In addition, it is preferable that the file system operates at a user-level.
또한, 상기 데이터가 저장되는 디스크는 상기 메타데이터가 저장된 디스크와 별개인 것이 바람직하다.In addition, it is preferable that the disk on which the data is stored is separate from the disk on which the metadata is stored.
상기 (c)단계는, 상기 메타데이터 중에서, 빈 공간에 관한 정보를 포함하는 데이터베이스 테이블, 이미 사용 중인 공간에 관한 정보를 포함하는 데이터베이스 테이블 및 아이노드(i-node)에 관한 정보를 포함하는 데이터베이스 테이블 중 적어도 하나를 업데이트할 것을 상기 데이터베이스관리시스템에 요청하는 단계를 포함할 수 있다.In step (c), among the metadata, a database table including information on empty space, a database table including information on space that is already in use, and a database including information on i-nodes It may include requesting the database management system to update at least one of the tables.
또한, 본 발명은 상기 데이터 관리 방법을 컴퓨터에서 실행시키기 위한 컴퓨터로 읽을 수 있는 기록 매체를 제공한다.In addition, the present invention provides a computer-readable recording medium for executing the data management method in a computer.
본 발명에 따른 파일 시스템은, DBMS가 제공하는 API를 통해 파일 시스템의 메타 데이터를 처리하므로 안정적으로 트랜잭션을 보장할 수 있고, 메타 데이터에 관한 디스크 레이아웃에는 관여하지 않지만, 파일 데이터와 관련하여서는 직접 디스크 레이아웃을 제어하므로 멀티미디어 환경에 따라 최적화된 디스크 할당 알고리즘을 설계하여 사용할 수 있다.Since the file system according to the present invention processes metadata of the file system through the API provided by the DBMS, it can ensure a stable transaction, and does not participate in the disk layout related to metadata, but is directly related to the file data. Because it controls the layout, it is possible to design and use an optimized disk allocation algorithm according to the multimedia environment.
또한, 본 발명에 따른 파일 시스템은 DBMS가 메타 데이터만을 관리할 뿐, 파일 데이터를 관리하지 않아 파일 데이터에 관한 로그를 작성하지 않으므로 파일의 크기가 커지더라도 파일 시스템의 성능 저하가 일어나지 않는다.In addition, in the file system according to the present invention, the DBMS only manages metadata and does not create a log related to the file data because the DBMS does not manage the file data, so that even if the file size increases, the performance of the file system does not deteriorate.
또한, 본 발명에 따른 파일 시스템은 커널 레벨이 아닌 사용자 레벨에서 동작하므로 파일 시스템의 소스 코드가OS에 의존하지 않아 다른 OS들로 포트(port)하기 쉽고, 유지 및 보수(maintenance)가 용이하다.In addition, since the file system according to the present invention operates at the user level rather than the kernel level, the source code of the file system does not depend on the OS, so it is easy to port to other OSs and easy to maintain and maintain.
또한, 본 발명에 따른 파일 시스템은 메타 데이터와 파일 데이터가 서로 다른 별개의 디스크에 저장되므로 디스크에 파일 데이터를 입출력할 때 기존의 파일 시스템에 비해 효율적이다.In addition, since the file system according to the present invention stores metadata and file data on separate disks, it is more efficient than the existing file system when inputting and outputting file data to the disk.
도 1은 데이터베이스를 이용하여 메타 데이터를 관리하는 종래의 <1> 파일 시스템의 구성을 나타낸 도면,
도 2는 본 발명의 일실시예에 따른 파일 시스템에서 데이터를 디스크에 저장하는 과정을 나타낸 순서도,
도 3은 본 발명의 일실시예에 따른 파일 시스템의 메타 데이터를 저장하는 데이터베이스의 스키마(schema)를 나타낸 도면,
도 4는 본 발명의 일실시예에 따른 파일 시스템을 나타낸 블록도,
도 5는 본 발명의 일실시예에 따른 파일 시스템에서 파일을 생성(create)하는 과정을 나타낸 흐름도,
도 6은 본 발명의 일실시예에 따른 파일 시스템에서 파일을 쓰는(write) 과정을 나타낸 흐름도,
도 7은 본 발명의 일실시예에 따른 파일 시스템에서 파일을 읽는(read) 과정을 나타낸 흐름도이다.1 is a diagram showing the configuration of a conventional <1> file system for managing metadata using a database;
2 is a flowchart illustrating a process of storing data on a disk in a file system according to an embodiment of the present invention;
3 is a diagram illustrating a schema of a database storing metadata of a file system according to an embodiment of the present invention;
4 is a block diagram showing a file system according to an embodiment of the present invention;
5 is a flowchart illustrating a process of creating a file in a file system according to an embodiment of the present invention;
6 is a flowchart illustrating a process of writing a file in a file system according to an embodiment of the present invention;
7 is a flowchart illustrating a process of reading a file in a file system according to an embodiment of the present invention.
이하에서 첨부된 도면을 참조하여, 본 발명의 바람직한 실시예를 상세히 설명한다.Hereinafter, with reference to the accompanying drawings, a preferred embodiment of the present invention will be described in detail.
도 2는 본 발명에 따른 파일 시스템에서 데이터를 디스크에 저장하는 과정을 나타낸 순서도이다.2 is a flowchart illustrating a process of storing data on a disk in the file system according to the present invention.
단계 210에서 본 발명에 따른 파일 시스템은 사용자의 애플리케이션으로부터 파일 데이터를 디스크에 쓸(write)것을 요청받는다. 이를 위하여 본 발명에 따른 파일 시스템은 시스템 콜에 대응되는 사용자 레벨의API(Application Programming Interface)를 애플리케이션 계층에 제공하여야 한다.In
단계 220에서 본 발명에 따른 파일 시스템은 메타 데이터를 관리하는 DBMS에게 트랜잭션의 시작을 요청한다. 따라서, 단계 220 이후에 수행되는 메타 데이터에 대한 동작들은 하나의 트랜잭션으로 간주되어 보호된다.In
단계 230에서는 애플리케이션이 요청한 파일 데이터를 쓰기하기 위하여 디스크의 빈 공간을 검색한다. 이 때,디스크의 빈 공간은 DBMS를 통해 디스크의 빈 공간에 관한 정보를 포함하는 데이터베이스 테이블을 참조하여 검색한다. DBMS에서 관리하는 데이터베이스 스키마(schema)에 관한 상세한 설명은 도 3을 참조하여 후술한다.In
단계 240에서는 파일 데이터를 디스크의 빈 공간에 쓴다. 상황에 따라 단계 230에서 검색된 빈 블록은 매우 많을 수 있는데, 그 블록들 중 어느 블록에 요청된 파일 데이터를 저장할 것인가는 사용자에 의해 정의된 디스크할당 알고리즘에 의해 결정할 수 있다. 왜냐하면, 본 발명에 따른 파일 시스템에서 메타 데이터는 ext2와 같은기존의(conventional) 파일 시스템 또는 DBMS에 의해 관리되지만, 디스크에 파일 데이터를 읽거나 쓰는 것은DBMS 또는 타 파일 시스템을 통하지 않고 본 발명에 따른 파일 시스템이 직접 수행하기 때문이다(raw I/O). 다시 말하면, 본 발명에 다른 파일 시스템은 DBMS가 제공하는 API를 통해 파일 시스템의 메타 데이터를 처리하므로 메타 데이터에 관한 디스크 레이아웃에는 관여하지 않지만, 파일 데이터와 관련하여서는 직접 디스크 레이아웃을 제어하므로 멀티미디어 환경에 따라 최적화된 디스크 할당 알고리즘을 사용할 수 있는 것이다. 또한, DBMS가 파일 데이터를 관리하지 않아 파일 데이터에 관한 로그를 작성하지 않으므로 파일의 크기가 커지더라도 파일 시스템의 성능 저하가 일어나지 않는다.In
단계 250에서는 DBMS에게 단계 240에서 디스크에 파일 데이터가 써짐에 따라 변경되어야 하는 메타데이터를 업데이트하도록 요청한다. 예를 들면, 아이노드, 디스크의 빈 공간에 관한 정보, 디스크의 사용중인 공간에 관한 정보 등에 관련된 데이터베이스 테이블들이 업데이트될 것이다.In
단계 260에서는 DBMS에게 트랜잭션의 종료를 요청한다. 따라서, DBMS는 단계 230 내지 단계 250에서 수행되는 동작들을 하나의 트랜잭션으로 간주하게 되므로 파일 시스템의 메타 데이터 일관성이 확보된다. 예를 들어 단계250에서 사용중인 공간에 관한 정보를 포함하는 데이터베이스 테이블을 업데이트하였고 디스크의 빈 공간에 관한 정보를 포함한 데이터베이스 테이블을 업데이트하기 전, 정전으로 인해 전원이 끊긴 경우 DBMS는 사용중인공간에 관한 정보를 포함하는 데이터베이스 테이블의 업데이트를 없었던 것으로 처리하고, 이에 따라 관련 데이터를 메타 데이터에 반영하지 않는다.In
또한, 단계 250이 단계 240이 수행 완료된 경우에만 수행되도록 하면, 즉 파일 데이터의 쓰기가 완료되어야 단계 250으로 넘어가도록 하면 결국 단계 240도 단계 220과 단계 260의 사이에 놓이게 되어 데이터의 일관성도 확보할 수 있다. 그러나, 파일 시스템 성능의 향상을 위해 단계 240의 완료 여부와 관계 없이 단계 250이 수행되도록 할 수도 있을 것이다.In addition, if
한편, 파일 시스템의 성능 향상을 위해서는 메타 데이터가 저장되는 디스크와 파일 데이터가 저장되는 디스크를별개로 하는 것이 바람직할 것이다.On the other hand, in order to improve the performance of the file system, it may be desirable to separate the disk where the metadata is stored and the disk where the file data is stored.
도 3은 본 발명의 일실시예에 따른 파일 시스템의 메타 데이터를 저장하는 데이터베이스의 종류를 나타낸 표이다.3 is a table showing types of databases storing metadata of a file system according to an embodiment of the present invention.
슈퍼블록 데이터베이스(super.db)는 파일 시스템의 상태(status)에 관한 정보와 아이노드 비트맵을 저장한다.The superblock database (super.db) stores information about the status of the file system and an inode bitmap.
전체 파일 시스템의 정보는 하나의 기록(record)에 저장될 수 있고, 아이노드 비트맵 역시 몇 개의 기록들만을 필요로 하므로, 이 데이터베이스는 기록번호(RECNO) 기반의 데이터 구조를 가지며 2차적인 인덱스는 필요로 하지 않을 것이다.Since the information of the entire file system can be stored in one record, and the inode bitmap also requires only a few records, this database has a data structure based on the record number (RECNO) and has a secondary index will not be needed
디렉토리 데이터베이스(directory.db)는 디렉토리 및 파일 이름을 아이노드 번호에 매핑시킨다.The directory database (directory.db) maps directory and file names to inode numbers.
아이노드 데이터베이스(inode.db)는 아이노드 번호를 파일의 크기, 마지막 수정 시간 등 해당 파일의 파일 정보에 매핑시킨다. 새로운 파일이 생성(create)되면 새로운 아이노드 기록이 이 데이터베이스에 추가되며, 파일이삭제되면 관련 아이노드 기록이 이 데이터베이스로부터 삭제된다.The inode database (inode.db) maps the inode number to the file information of the file, such as the size of the file and the last modification time. When a new file is created, a new inode record is added to this database, and when a file is deleted, the related inode record is deleted from this database.
빈공간 데이터베이스(freespace.db)는 파티션의 빈 공간들을 관리한다. 이 때, 데이터베이스 테이블에서 빈 공간들에 관한 정보는 구간(extent) 형식으로 표현되는 것이 바람직하다. 구간 형식으로 나타내는 것이 비트맵 형식으로 나타내는 것보다 정보의 크기를 줄일 수 있기 때문이다. 구간 형식은 빈 공간이 시작되는 위치를 지정하는 블록번호 및 그 빈 공간의 크기에 해당하는 블록의 개수로 나타낸 수도 있으며, 빈 공간이 시작되는 위치를바이트오프셋(byte offset)으로 나타내고 그 크기는 바이트 단위로 나타낼 수도 있을 것이다. 본 발명에 따른 파일 시스템은 파일에 데이터를 쓰기 위해 빈공간 데이터베이스를 참조하여 디스크의 빈 공간을 검색한다.The freespace database (freespace.db) manages the free space of a partition. In this case, it is preferable that information about empty spaces in the database table is expressed in the form of an extent. This is because the size of information can be reduced when represented in a section format compared to represented in a bitmap format. The section format may be expressed as a block number designating the position where the blank space starts and the number of blocks corresponding to the size of the blank space. It can also be expressed in units. The file system according to the present invention searches the free space of the disk by referring to the free space database in order to write data to the file.
구간 데이터베이스(extents.db)는 파일의 오프셋을 그 파일 데이터를 포함하는 구간의 블록 어드레스에 매핑시킨다.The span database (extents.db) maps the offset of the file to the block address of the section containing the file data.
도 4는 본 발명의 일실시예에 따른 파일 시스템을 나타낸 블록도이다.4 is a block diagram illustrating a file system according to an embodiment of the present invention.
도 4에 도시된 바와 같이, 본 발명에 따른 파일 시스템은 Syscall모듈(402), Namei모듈(403), Super모듈(404),Dir모듈(405), Inode모듈(406), File모듈(407), Alloc모듈(408), DBAL모듈(410) 및 OSAL(409)모듈을 포함한다.4, the file system according to the present invention is a
또한, 본 실시예에서는 DBMS로 버클리(Berkeley) DB(411)를 사용하고 있으며, 파일 시스템 메타 데이터는ext3(412)가 디스크에/디스크로부터 입출력하는 것으로 가정하였다.Also, in this embodiment, it is assumed that a
Syscall모듈(402)은 애플리케이션(401)이 시스템 콜을 할 수 있도록 하는 API를 제공하고, DBMS(411)에게 트랜잭션의 시작과 끝을 요청한다.The
Namei모듈(403)은 애플리케이션(401)이 호출한 API함수를 분석하여 업데이트되어야 할 데이터베이스를결정한다. Super모듈(404)은 DBMS(411)에게 super.db의 검색 및 업데이트를 요청하고 Dir모듈(405)은 dir.db의검색 및 업데이트를 요청하며, Inode모듈(406)은 inode.db를 이용하여 빈(free) 아이노드들을 관리한다. Alloc모듈(408)은 DBMS(411)를 통해 디스크의 빈 공간에 관한 정보를 획득하고, <43> 멀티미디어 환경, 또는 기타 다른 환경에 최적화된 디스크 할당 알고리즘을 이용하여 파일 데이터가 쓰여질 블록들을 결정한다.The
File모듈(407)은 커널 레벨에서 동작하는 OS모듈(도시하지 않음)을 통해 디스크로의/디스크로부터의 파일 데이터를 입출력하는데, 예를 들면 블록 디바이스 파일에 데이터를 쓰거나 블록 디바이스 파일로부터 데이터를 읽는방식을 사용하여 파일 데이터 입출력을 수행할 수 있다.The
DBAL(DB Abstract Layer)모듈(410)은 Syscall(402)와 DBMS(411)과의 호환을 위한 인터페이스이며, OSAL(OSAbstract Layer)는 OS마다 다를 수 있는 블록 디바이스 파일의 처리를 가능하게 하는 인터페이스이다.DBAL (DB Abstract Layer)
한편, 도 4에 도시된 바와 같이 본 발명에 따른 파일 시스템은 사용자 레벨에서 동작하므로 파일 시스템의 소스코드가 OS에 의존하지 않는다. 따라서, 커널 레벨에서 동작하는 파일 시스템에 비해 본 발명에 의한 파일 시스템은 다른 OS들로 포트(port)하기 쉽고, 또한 유지 및 보수(maintenance)가 용이하다.Meanwhile, as shown in FIG. 4 , since the file system according to the present invention operates at the user level, the source code of the file system does not depend on the OS. Accordingly, compared to the file system operating at the kernel level, the file system according to the present invention is easy to port to other OSs, and it is also easy to maintain and maintain.
도 5는 도 4에 도시된 파일 시스템에서 파일을 생성(create)하는 과정을 나타낸 흐름도이다. 본 실시예에서는 DBAL모듈 및 OSAL모듈은 사용되지 않는 것으로 가정한다.5 is a flowchart illustrating a process of creating a file in the file system shown in FIG. 4 . In this embodiment, it is assumed that the DBAL module and the OSAL module are not used.
단계 501에서 애플리케이션은 Syscall모듈에게 파일 이름을 제공하며 파일 생성을 요청하고, 단계 502에서Syscall모듈은 DBMS에게 트랜잭션을 시작할 것을 요청한다. 단계 503에서 DBMS는 트랜잭션을 시작한다.In
단계 504에서 Syscall모듈은 Namei모듈에게 파일 생성을 요청하고, 단계 505에서 Namei모듈은 Super모듈에게 새로운 파일에 할당할 아이노드를 요청한다. Namei모듈로부터 아이노드를 요청받은 Super모듈은 단계 506에서DBMS에게 super.db의 검색 및 수정을 요청한다. 이러한 요청을 받은 DBMS는 아이노드 비트맵을 참조하여 빈 아이노드를 새로운 파일에 할당하고, super.db를 업데이트한다(도시되지 않음).In step 504, the Syscall module requests the Namei module to create a file, and in
단계 507에서 Namei모듈은 Dir모듈에게 디렉토리에 새로운 파일을 등록할 것을 요청하고, 이에 단계 508에서 Dir모듈은 DBMS에게 dir.db의 검색 및 수정을 요청한다. 이러한 요청을 수신한 DBMS는 새로운 파일의 이름과 그에 해당하는 아이노드를 매핑하여 dir.db에 저장한다(도시되지 않음).In step 507, the Namei module requests the Dir module to register a new file in the directory, and in step 508, the Dir module requests the DBMS to search and modify dir.db. The DBMS receiving this request maps the name of the new file and the corresponding inode and stores it in dir.db (not shown).
단계 509에서 Namei모듈은 Inode모듈에게 새로운 아이노드에 대한 초기화를 요청하고, 단계 510에서 Inode모듈은 DBMS에게 inode.db에 새로운 아이노드에 관한 정보를 등록할 것을 요청한다. 이러한 요청을 수신한 DBMS는새로운 파일에 해당하는 아이노드에 새로운 파일과 관련된 정보를 저장한다(도시되지 않음).In step 509, the Namei module requests the Inode module to initialize a new inode, and in step 510, the Inode module requests the DBMS to register information about the new inode in inode.db. Upon receiving this request, the DBMS stores information related to the new file in the inode corresponding to the new file (not shown).
단계 510의 수행이 완료되면, 단계 511에서 Namei모듈은 Syscall모듈에게 파일 생성이 완료되었음을 통지하고, 단계 512에서 Syscall모듈은 DBMS에게 트랜잭션을 종료할 것을 요청한다. 단계 513에서 DBMS는 단계 503에서 시작된 트랜잭션을 종료한다.When the execution of step 510 is completed, in step 511, the Namei module notifies the Syscall module that the file creation has been completed, and in step 512, the Syscall module requests the DBMS to terminate the transaction. In step 513, the DBMS ends the transaction started in step 503.
도 6는 도 4에 도시된 파일 시스템에서 파일에 데이터를 쓰는(write) 과정을 나타낸 흐름도이다. 본 실시예에서는 DBAL모듈 및 OSAL모듈은 사용되지 않는 것으로 가정한다.6 is a flowchart illustrating a process of writing data to a file in the file system shown in FIG. 4 . In this embodiment, it is assumed that the DBAL module and the OSAL module are not used.
단계 601에서 애플리케이션은 Syscall모듈에게 파일에 데이터를 쓰도록 요청한다. 이 때, 파일 이름과 데이터,데이터의 크기 및 파일 내의 오프셋 정보가 전달된다. 단계 602에서 Syscall모듈은 DBMS에게 트랜잭션을 시작하도록 요청하고, DBMS는 단계 603에서 트랜잭션을 시작한다.In step 601, the application requests the Syscall module to write data to the file. At this time, the file name, data, data size, and offset information in the file are transmitted. In step 602, the Syscall module requests the DBMS to start a transaction, and the DBMS starts the transaction in step 603.
단계 604에서 Syscall모듈은 File모듈에게 쓰기 동작을 요청하고, 단계 605에서 File모듈은 Alloc모듈에게 파티션의 빈 블록에 대한 정보를 요청한다. 이러한 요청을 수신한 Alloc모듈은 단계 606에서 DBMS에게 freespace.db의 검색 및 수정을 요청한다(606). 이 요청을 수신한 DBMS는 freespace.db를 검색하여 빈 블록들을 찾아내고,단계 607에서 빈 블록에 대한 정보를 Alloc모듈에게 전달한다.In step 604, the Syscall module requests a write operation from the File module, and in step 605, the File module requests information about an empty block of the partition from the Alloc module. Upon receiving this request, the Alloc module requests the DBMS to search for and modify freespace.db (606). Upon receiving this request, the DBMS searches freespace.db to find free blocks, and in step 607 delivers information about the empty blocks to the Alloc module.
단계 608에서 Alloc모듈은 파티션의 빈 블록들 중 데이터가 쓰여질 블록들에 대한 정보를 File모듈에게 전달한다. 이 때 전달되는 블록들에 대한 정보는 단계 607에서 DBMS가 전달한 빈 블록들에 관한 정보와 다를 수 있다.In
즉, 단계 607에서 DBMS는 파티션의 모든 빈 블록들을 알려주지만, Alloc모듈은 소정의 디스크 할당 알고리즘을이용하여 데이터가 쓰여질 블록들을 결정한 후, File모듈에게 전달하는 것이다. 따라서 사용자는 자유롭게 디스크 할당 알고리즘을 설계하여 Alloc모듈 내에 구현함으로써, 기존의 파일 시스템에 의한 고정된 디스크 할당 방식에서 벗어나 멀티미디어 환경에 최적화된 파일 시스템을 만들 수 있다.That is, in step 607, the DBMS notifies all empty blocks of the partition, but the Alloc module uses a predetermined disk allocation algorithm to determine the blocks to which data is to be written, and then delivers them to the File module. Therefore, the user can freely design the disk allocation algorithm and implement it in the Alloc module to create a file system optimized for the multimedia environment, breaking away from the fixed disk allocation method by the existing file system.
단계 609에서 File모듈은 커널 모드에서 동작하는 OS모듈에게 파티션 이름, 파티션 내에서의 오프셋 정보, 데이터 및 데이터의 크기를 전달하며 쓰기 요청을 하고(raw input), 단계 610에서 OS모듈은 수신한 정보에 기초하여 디스크에 데이터를 쓴다.In step 609, the File module sends a partition name, offset information within the partition, data and size of data to the OS module operating in kernel mode and makes a write request (raw input), and in step 610, the OS module receives the received information Writes data to disk based on
단계 611에서 OS모듈은 File모듈에게 쓰기가 완료되었음을 통지하고, 단계 612에서 File모듈은 Inode모듈에게 쓰기가 완료되었음을 통지한다. 단계 613에서 Inode모듈은 DBMS에게 해당 파일에 발생한 변경 사항을 반영하여inode.db를 업데이트하도록 요청한다. 이에 따라 DBMS는 해당 파일의 최종 변경 시각, 파일 크기 등에 대한 정보를 변경할 것이다(도시하지 않음). 또한, 단계 614에서 File모듈은 DBMS에게 extents.db를 수정하도록 요청한다. 이 요청을 수신한 DBMS는 새로 데이터가 쓰여진 블록에 관한 정보를 반영하여 extents.db를 업데이트한다(도시하지 않음).In step 611, the OS module notifies the File module that writing has been completed, and in step 612, the File module notifies the Inode module that writing is complete. In step 613, the Inode module requests the DBMS to update inode.db to reflect the changes that have occurred in the file. Accordingly, the DBMS will change information on the last change time of the corresponding file, the file size, and the like (not shown). Also, in step 614, the File module requests the DBMS to modify extents.db. Upon receiving this request, the DBMS updates extents.db to reflect the information on the newly written block (not shown).
단계 615에서 File모듈은 Syscall모듈에게 쓰기가 완료되었음을 통지하고, 단계 616에서 Syscall모듈은 DBMS에게 트랜잭션의 종료를 요청한다. 단계 615에서, DBMS는 단계 603에서 시작된 트랜잭션을 종료한다.In step 615, the File module notifies the Syscall module that writing has been completed, and in step 616, the Syscall module requests the DBMS to end the transaction. In step 615, the DBMS ends the transaction started in step 603.
도 7은 도 4에 도시된 파일 시스템에서 데이터를 읽는(write) 과정을 나타낸 흐름도이다. 본 실시예에서는 DBAL모듈 및 OSAL모듈은 사용되지 않는 것으로 가정한다.7 is a flowchart illustrating a process of reading data from the file system shown in FIG. 4 . In this embodiment, it is assumed that the DBAL module and the OSAL module are not used.
단계 701에서 애플리케이션은 Syscall모듈에게 파일 이름, 파일 내의 오프셋 정보 및 데이터의 크기를 알려주며해당 데이터를 읽을 것을 요청한다. 단계 702에서 Syscall모듈은 File모듈에게 해당 데이터를 읽도록 요청하고,단계 703에서 File모듈은 Inode모듈에게 관련 블록에 대한 정보를 요청한다.In step 701, the application informs the Syscall module of the file name, offset information in the file, and the size of the data, and requests to read the data. In step 702, the Syscall module requests the File module to read the data, and in step 703, the File module requests the Inode module for information about the relevant block.
이러한 요청을 수신한 Inode모듈은 단계 704에서 DBMS에게 extents.db의 검색을 요청하며, DBMS는 extents.db를 검색하여 해당 데이터가 위치한 블록에 관한 정보를 추출한 후, 단계 705에서 추출한 정보를 Inode모듈에게전달한다. 단계 706에서 Inode모듈은 블록 정보를 File모듈에게 전달하고, 단계 707에서 File모듈은 OS모듈에게파티션 이름, 파티션 내에서의 오프셋 정보 및 데이터의 크기를 알려주며 해당 데이터를 읽도록 요청한다(rawoutput). 단계 708에서 OS모듈은 디스크에서 해당 데이터를 읽고, 단계 709에서 읽어온 데이터를 File모듈에게전달한다. 단계 710에서 File모듈은 Syscall모듈에게 데이터를 전달하고, 단계 711에서 Syscall모듈은 애플리케이션에게 데이터를 전달함으로써 읽기 과정이 완료된다.Upon receiving this request, the Inode module requests the DBMS to search for extents.db in step 704, and the DBMS searches extents.db to extract information about the block in which the data is located, and then returns the information extracted in step 705 to the Inode module. pass it on to In step 706, the Inode module transmits block information to the File module, and in step 707, the File module informs the OS module of the partition name, offset information within the partition, and the size of data, and requests to read the data (rawoutput). In step 708, the OS module reads the corresponding data from the disk, and transmits the data read in step 709 to the File module. In
한편, 상술한 본 발명의 실시예들은 컴퓨터에서 실행될 수 있는 프로그램으로 작성가능하고, 컴퓨터로 읽을 수있는 기록매체를 이용하여 상기 프로그램을 동작시키는 범용 디지털 컴퓨터에서 구현될 수 있다.Meanwhile, the above-described embodiments of the present invention can be written as a program that can be executed on a computer, and can be implemented in a general-purpose digital computer that operates the program using a computer-readable recording medium.
상기 컴퓨터로 읽을 수 있는 기록매체는 마그네틱 장매체(예를 들면, 롬, 플로피 디스크, 하드디스크 등), 광학적 판독 매체(예를 들면, 시디롬, 디브이디 등) 및 캐리어 웨이브(예를 들면, 인터넷을 통한 전송)와 같은 저장매체를 포함한다.The computer-readable recording medium includes a magnetic storage medium (eg, ROM, floppy disk, hard disk, etc.), an optically readable medium (eg, CD-ROM, DVD, etc.) and a carrier wave (eg, Internet storage media such as transmission).
이제까지 본 발명에 대하여 그 바람직한 실시예들을 중심으로 살펴보았다. 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 본 발명이 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현될수 있음을 이해할 수 있을 것이다. 그러므로 개시된 실시예들은 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 한다. 본 발명의 범위는 전술한 설명이 아니라 특허청구범위에 나타나 있으며, 그와 동등한 범위 내에있는 모든 차이점은 본 발명에 포함된 것으로 해석되어야 할 것이다.So far, the present invention has been looked at with respect to preferred embodiments thereof. Those of ordinary skill in the art to which the present invention pertains will understand that the present invention can be implemented in a modified form without departing from the essential characteristics of the present invention. Therefore, the disclosed embodiments are to be considered in an illustrative rather than a restrictive sense. The scope of the present invention is indicated in the claims rather than the foregoing description, and all differences within the scope equivalent thereto should be construed as being included in the present invention.
Claims (5)
(a) 애플리케이션으로부터 데이터 쓰기 요청이 수신됨에 따라 상기 파일 시스템의 메타데이터를 관리하는 데이터베이스관리시스템(DataBase Management System)을 통해 디스크에 존재하는 빈 공간을 검색하는 단계;
(b) 상기 검색 결과를 참조하여 상기 데이터를 상기 데이터베이스관리시스템을 통하지 않고 상기 디스크의 빈공간에 쓰는 단계; 및
(c) 상기 메타 데이터 중 상기 데이터가 써짐에 따라 변경된 부분을 상기 데이터베이스관리시스템을 통해 업데이트하는 단계를 포함하는 것을 특징으로 하는 방법.A method for managing data in a file system, the method comprising:
(a) searching for an empty space on the disk through a database management system that manages metadata of the file system as a data write request is received from an application;
(b) writing the data to an empty space of the disk without going through the database management system with reference to the search result; and
(c) updating a part of the metadata that is changed as the data is written through the database management system.
상기 (a)단계 내지 상기 (c)단계는 상기 데이터베이스관리시스템에 의해 하나의 트랜잭션(transaction)으로서 관리되는 것을 특징으로 하는 방법.The method of claim 1,
Steps (a) to (c) are managed as one transaction by the database management system.
상기 파일 시스템은 사용자 레벨(User-Level)에서 동작하는 것을 특징으로 하는 방법.The method of claim 1,
The method according to claim 1, wherein the file system operates at a user-level.
상기 데이터가 저장되는 디스크는 상기 메타데이터가 저장된 디스크와 별개인 것을 특징으로 하는 방법.The method of claim 1,
The method of claim 1, wherein the disk on which the data is stored is separate from the disk on which the metadata is stored.
상기 (c)단계는 상기 메타데이터 중에서, 빈 공간에 관한 정보를 포함하는 데이터베이스 테이블, 이미 사용 중인 공간에 관한 정보를 포함하는 데이터베이스 테이블 및 아이노드(i-node)에 관한 정보를 포함하는 데이터베이스 테이블 중 적어도 하나를 업데이트할 것을 상기 데이터베이스관리시스템에 요청하는 단계를 포함하는 것을 특징으로 하는 방법.The method of claim 1,
In step (c), among the metadata, a database table including information on empty space, a database table including information on space already in use, and a database table including information on i-nodes Method comprising the step of requesting the database management system to update at least one of the.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020200074560A KR20210156682A (en) | 2020-06-18 | 2020-06-18 | How to manage meta-data of a file system using a database management system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020200074560A KR20210156682A (en) | 2020-06-18 | 2020-06-18 | How to manage meta-data of a file system using a database management system |
Publications (1)
Publication Number | Publication Date |
---|---|
KR20210156682A true KR20210156682A (en) | 2021-12-27 |
Family
ID=79177331
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020200074560A KR20210156682A (en) | 2020-06-18 | 2020-06-18 | How to manage meta-data of a file system using a database management system |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR20210156682A (en) |
-
2020
- 2020-06-18 KR KR1020200074560A patent/KR20210156682A/en unknown
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100790991B1 (en) | Method for managing metadata of file system using DBMS | |
US6957362B2 (en) | Instantaneous restoration of a production copy from a snapshot copy in a data storage system | |
US6934822B2 (en) | Organization of multiple snapshot copies in a data storage system | |
US6792518B2 (en) | Data storage system having mata bit maps for indicating whether data blocks are invalid in snapshot copies | |
US7664787B2 (en) | System and method for creating an object-level snapshot in a storage system | |
US9665304B2 (en) | Storage system with fast snapshot tree search | |
CN106575297B (en) | High throughput data modification using blind update operations | |
US9183129B2 (en) | Method and system for managing large write-once tables in shadow page databases | |
US7698319B2 (en) | Database system management method, database system, database device, and backup program | |
US7433902B2 (en) | Non-disruptive backup copy in a database online reorganization environment | |
JP2005510780A (en) | Sharing objects between computer systems | |
JP2007018399A (en) | Condition-based snapshot acquisition method and system | |
US11775476B2 (en) | Techniques for snapshotting scalable multitier storage structures | |
US7693883B2 (en) | Online data volume deletion | |
US7949632B2 (en) | Database-rearranging program, database-rearranging method, and database-rearranging apparatus | |
KR20210156682A (en) | How to manage meta-data of a file system using a database management system | |
CN111258503B (en) | Management method and device of CIRROS file system | |
KR100912126B1 (en) | Method for providing snapshot of fileset of object based file system | |
CN111858516A (en) | Data processing method and device |