# US 12,001,406 B2 · Method and system to implement directory reads for a database file system

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,001,406 B2
- Document ID: US12001406B2
- Status: Granted
- Kind: B2
- Application number: 17/877,689
- Filed: 2022-07-29
- Published: 2024-02-01
- Granted: 2024-06-04
- Earliest claimed: 2022-07-29
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Margaret Susairaj; Jose Antonio Lasa Gutierrez; Sumanta Chatterjee
- Web page: https://patentgrep.com/patent/US12001406B2

## CPC

- G06F 16/185: Hierarchical storage management [HSM] systems, e.g. file migration or policies thereof (details of archiving G06F16/11)
- G06F 16/172: Caching, prefetching or hoarding of files
- G06F 16/2219: {Large Object storage; Management thereof}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Disclosed is an improved approach to access the contents of database file system. The contents of the database file system can be acquired and stored in a directory buffer. A parallel tree structure is used to retrieve directory contents quickly and in a consistent fashion.

## Claims

### Claim 1

A method, comprising:
implementing a database file system (DBFS) where a plurality of files in a file system are stored in a database backend;
receiving a first file system command to access a directory in the DBFS, the directory having multiple files of the plurality of files in the file system;
constructing a node tree for the multiple files in the directory in response to the first file system command, wherein the node tree is constructed based on a table for the directory in the database backend having columns that hold metadata associated with the files;
loading file contents for the files in the directory into a cache in response to the first file system command to access the directory, wherein the node tree references the file contents for the files in the cache;
receiving a second file system command to access a file of the multiple files in the directory; and
accessing, in response to the second file system command, the previously constructed node tree to identify file contents of the file in the cache based on a reference to the file contents for the file in the node tree.

### Claim 2 (depends on 1)

The method of claim 1, wherein the node tree is constructed as a red black tree.

### Claim 3 (depends on 1)

The method of claim 1, wherein an individual row in the table in the database backend corresponds to a specific file, and the individual row corresponds to a LOB that holds file content for the file.

### Claim 4 (depends on 3)

The method of claim 3, wherein the individual row comprises a pointer to a location for the LOB located outside of the table.

### Claim 5 (depends on 1)

The method of claim 1, wherein the DBFS provides an abstraction layer that is embodied as a mounted file system at a client location, and where the first file system command is translated into a database operation request that is processed at the database backend to handle the first file system command.

### Claim 6 (depends on 1)

The method of claim 1, wherein the node tree comprises nodes that correspond to the files in the directory, and where an individual node comprises a key and an offset associated with a specific file.

### Claim 7 (depends on 6)

The method of claim 6, wherein the file contents are loaded into a buffer in the cache and the offset is used to reference a location in the buffer for file system content for the specific file.

### Claim 8 (depends on 1)

The method of claim 1, wherein the node tree is walked to process the first file system command, wherein an iterative approach is taken to walk different portions of the node tree to process different subsets of the directory to implement the first file system command.

### Claim 9 (depends on 1)

The method of claim 1, wherein the node tree is not deleted until after a change to the directory or after a timeout threshold has been reached.

### Claim 10

A system, comprising:
a processor;
a memory for storing a set of instructions; and
wherein the a set of instructions, when executed by the processor cause a set of acts, the set of acts comprise: implementing a database file system (DBFS) where a plurality of files in a file system are stored in a database backend; receiving a first file system command to access a directory in the DBFS, the directory having multiple files of the plurality of files in the file system; constructing a node tree for the multiple files in the directory in response to the first file system command, wherein the node tree is constructed based on a table for the directory in the database backend having columns that hold metadata associated with the files; loading file contents for the files in the directory into a cache in response to the first file system command to access the directory, wherein the node tree references the file contents for the files in the cache; receiving a second file system command to access a file of the multiple files in the directory; and accessing, in response to the second file system command, the previously constructed node tree to identify file contents of the file in the cache based on a reference to the file contents for the file in the node tree.

### Claim 11 (depends on 10)

The system of claim 10, wherein the node tree is constructed as a red black tree.

### Claim 12 (depends on 10)

The system of claim 10, wherein an individual row in the table in the database backend corresponds to a specific file, and the individual row corresponds to a LOB that holds file content for the file.

### Claim 13 (depends on 12)

The system of claim 12, wherein the individual row comprises a pointer to a location for the LOB located outside of the table.

### Claim 14 (depends on 10)

The system of claim 10, wherein the DBFS provides an abstraction layer that is embodied as a mounted file system at a client location, and where the first file system command is translated into a database operation request that is processed at the database backend to handle the first file system command.

### Claim 15 (depends on 10)

The system of claim 10, wherein the node tree comprises nodes that correspond to the files in the directory, and where an individual node comprises a key and an offset associated with a specific file.

### Claim 16 (depends on 15)

The system of claim 15, wherein the file contents are loaded into a buffer in the cache and the offset is used to reference a location in the buffer for file system content for the specific file.

### Claim 17 (depends on 10)

The system of claim 10, wherein the node tree is walked to process the first file system command, wherein an iterative approach is taken to walk different portions of the node tree to process different subsets of the directory to implement the first file system command.

### Claim 18

A computer program product embodied on a non-transitory computer readable medium having stored thereon a sequence of instructions which, when executed by a processor, performs:
implementing a database file system (DBFS) where a plurality of files in a file system are stored in a database backend;
receiving a first file system command to access a directory in the DBFS, the directory having multiple files of the plurality of files in the file system;
constructing a node tree for the multiple files in the directory in response to the first file system command, wherein the node tree is constructed based on a table for the directory in the database backend having columns that hold metadata associated with the files;
loading file contents for the files in the directory into a cache in response to the first file system command to access the directory, wherein the node tree references the file contents for the files in the cache;
receiving a second file system command to access a file of the multiple files in the directory; and
accessing, in response to the second file system command, the previously constructed node tree to identify file contents of the file in the cache based on a reference to the file contents for the file in the node tree.

### Claim 19 (depends on 18)

The computer program product of claim 18, wherein the node tree is constructed as a red black tree.

### Claim 20 (depends on 18)

The computer program product of claim 18, wherein an individual row in the table in the database backend corresponds to a specific file, and the individual row corresponds to a LOB that holds file content for the file.

### Claim 21 (depends on 20)

The computer program product of claim 20, wherein the individual row comprises a pointer to a location for the LOB located outside of the table.

### Claim 22 (depends on 18)

The computer program product of claim 18, wherein the DBFS provides an abstraction layer that is embodied as a mounted file system at a client location, and where the first file system command is translated into a database operation request that is processed at the database backend to handle the first file system command.

### Claim 23 (depends on 18)

The computer program product of claim 18, wherein the node tree comprises nodes that correspond to the files in the directory, and where an individual node comprises a key and an offset associated with a specific file.

### Claim 24 (depends on 23)

The computer program product of claim 23, wherein the file contents are loaded into a buffer in the cache and the offset is used to reference a location in the buffer for file system content for the specific file.

### Claim 25 (depends on 18)

The computer program product of claim 18, wherein the node tree is walked to process the first file system command, wherein an iterative approach is taken to walk different portions of the node tree to process different subsets of the directory to implement the first file system command.
