## 5 Active File Mode Change Mechanism  
The basic idea of the proposed active file mode change mechanism is to measure the activation level of a directory and actively change the file mode according to this value. When a directory is active, it means that the files in this directory are frequently accessed  
Figure 4: Local mode change process. by clients based on the current time. Conversely, when the degree of directory activation is low, it means that the files in this directory are accessed less frequently. If the file is accessed frequently, the file should be kept in the local mode rather than the online mode to shorten file access time. On the other hand, if we do not access files well, we can save local storage capacity by keeping these files in the online mode until we access them. To quantify the degree of directory activation, in this paper, we define the directory activation ratio (_DAR_) as an index indicating how often files in a directory are accessed up to the current time. The directory activation ratio is again calculated as the average value of the file activation ratio (_FAR_) of all files in the directory. The file activation ratio is defined as follows:  
\[FAR=\min\biggl{\{}\frac{DSLAT}{T_{c}-T_{l}},1\biggr{\}}\ (0\leq FAR\leq 1) \tag{1}\]  
where \(T_{c}\) is current time and \(T_{l}\) is the last access time. _DSLAT_ is the acronym of \"duration-since-last-access threshold\" of a file. This threshold represents the maximum period since the last access to a file that it can remain highest active until the next access. For example, if the _DSLAT_ is 7 days, the file activation ratio remains at its maximum value of 1 until 7 days have passed since the last time the file was accessed. When the elapsed time from the last access to the next access exceeds 7 days, the file activation ratio starts to be less than 1. When the file is accessed, the file activation ratio is set back to its maximum value of 1, and this value is maintained for the threshold of 7 days. If the elapsed time without the next access crosses the threshold, the activation ratio thereafter decreases in proportion to the elapsed time. After finding the activation ratio of all files in the directory, the directory activation ratio is defined as the average value, as follows:  
\[DAR=\frac{\sum_{i=0}^{N-1}FAR_{i}}{N}\ \ (0\leq DAR\leq 1) \tag{2}\]  
where, \(N\) is the number of all files in the directory and \(FAR_{i}\) is the activation ratio of the \(i\)-th (\(i\) is a 0-based index) file. If a sub-directory exists in the directory and the \(i\)-th file type is a directory, the activation ratio of the corresponding sub-directory is used instead of the file activation ratio. If the directory is empty, the directory activation ratio is initialized to zero. The active file mode change mechanism periodically updates the directory activation ratio to determine if it is necessary to change the file mode. Figure 5 is a flow chart showing the process in which the active file mode change mechanism determines whether to change the file mode. The active file mode change mechanism first calculates the directory activation ratio and checks if this value is less than _OMT_. _OMT_ stands for an online mode threshold and serves as a criterion for determining whether the active file mode change mechanism starts an operation of changing files to the online mode. If the directory activation ratio is less than _OMT_, the active file mode change mechanism determines that the deactivation degree of the directory exceeds the reference value and starts the operation of changing the file mode to the online mode. If the directory activation ratio is greater than or equal to _OMT_, the next check is whether it is greater than the _LMT_. _LMT_ stands for a local mode threshold and is a criterion for determining whether the active file mode change mechanism starts an operation to change files to the local mode.