CN105701146A - Directory creating method and apparatus - Google Patents

Directory creating method and apparatus Download PDF

Info

Publication number
CN105701146A
CN105701146A CN201511000891.1A CN201511000891A CN105701146A CN 105701146 A CN105701146 A CN 105701146A CN 201511000891 A CN201511000891 A CN 201511000891A CN 105701146 A CN105701146 A CN 105701146A
Authority
CN
China
Prior art keywords
described target
node
target directory
directory
node corresponding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201511000891.1A
Other languages
Chinese (zh)
Other versions
CN105701146B (en
Inventor
李明浩
闫昊
张墅潇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Technology Co Ltd
Xiaomi Inc
Original Assignee
Xiaomi Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiaomi Inc filed Critical Xiaomi Inc
Priority to CN201511000891.1A priority Critical patent/CN105701146B/en
Publication of CN105701146A publication Critical patent/CN105701146A/en
Application granted granted Critical
Publication of CN105701146B publication Critical patent/CN105701146B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present disclosure relates to a directory creating method and apparatus. The method comprises: determining a root directory name of a to-be-created target directory; according to the root directory name, determining a target partition where a root directory of the target directory is located; reading a super block of the target partition, and acquiring a node state of a node corresponding to the target directory; refreshing node information of the node corresponding to the target directory according to the node state of the node corresponding to the target directory; and creating the target directory. The method and apparatus provided by the present disclosure are capable of solving the problem that the node corresponding to a file is not released timely, which is caused by not closing the file and thus results in a failure in creating the file.

Description

The method and apparatus creatied directory
Technical field
It relates to field of computer technology, particularly relate to a kind of method and apparatus creatied directory。
Background technology
In the related, when user opens certain file B under a certain directory A (can also be called file A) and is not turned off this document B, if deleting this directory A, then user can find that the file B just now opened disappears, if now user wants to rebuild directory A it is possible that the problem that cannot rebuild directory A。
Summary of the invention
For overcoming Problems existing in correlation technique, the disclosure provides a kind of method and apparatus creatied directory。
First aspect according to disclosure embodiment, it is provided that a kind of method creatied directory, described method includes:
Determine the root name of target directory to be created;
The target partition at the root place of described target directory is determined according to described root name;
Read the superblock of described target partition, obtain the node state of the node corresponding with described target directory;
Node state according to node corresponding to described target directory refreshes the nodal information of node corresponding to described target directory;
Create described target directory。
Optionally, the target partition at the described root place determining described target directory according to described root name includes:
When described root Symbolic Links by name, obtain the true root that described Symbolic Links point to;
Directory name according to described true root, and the corresponding relation of catalogue and subregion determines the subregion at described true root place。
Optionally, the superblock of the described target partition of described reading, the node state obtaining the node corresponding with described target directory includes:
Reading the superblock of described target partition, described superblock includes the nodal information of node corresponding to All Files in described target partition;
The directory name utilizing described target directory searches the nodal information of the node corresponding with described target directory in described target partition in the nodal information of node corresponding to All Files;
Nodal information according to the node corresponding with described target directory, it is determined that the node state of the node corresponding with described target directory。
Optionally, the nodal information of the node that the node state described target directory of refreshing of the described node corresponding according to described target directory is corresponding includes:
When the node state of node corresponding to described target directory is dirty, refreshes the nodal information of node corresponding to described target directory and discharge, from internal memory, the node that described target directory is corresponding。
Optionally, when the node state of the described node corresponding when described target directory is dirty, the nodal information refreshing node corresponding to described target directory the node discharging described target directory corresponding from internal memory include:
When the node state of node corresponding to described target directory is dirty, enters kernel state and utilize the system call interfaces that parameter preset parameter performs for discharging node to force the nodal information by node corresponding for the described target directory in internal memory to be updated to disk;And
The node that described target directory is corresponding is discharged from internal memory。
Second aspect according to disclosure embodiment, it is provided that a kind of device creatied directory, described device includes:
Root determines module, is configured to determine that the root name of target directory to be created;
Subregion determines module, is configured to determine the target partition at the root place of described target directory according to described root name;
State determining module, is configured to read the superblock of described target partition, obtains the node state of the node corresponding with described target directory;
Refresh module, the node state being configured to the node corresponding according to described target directory refreshes the nodal information of node corresponding to described target directory;
Creation module, is configured to create described target directory。
Optionally, described subregion determines that module includes:
Obtain submodule, when being configured as the by name Symbolic Links of described root, obtain the true root that described Symbolic Links point to;
Determine submodule, be configured to the directory name according to described true root, and the corresponding relation of catalogue and subregion determines the subregion at described true root place。
Optionally, described state determining module includes:
Reading submodule, is configured to read the superblock of described target partition, and described superblock includes the nodal information of node corresponding to All Files in described target partition;
Searching submodule, the directory name being configured to, with described target directory searches the nodal information of the node corresponding with described target directory in described target partition in the nodal information of node corresponding to All Files;
Determine submodule, be configured to the nodal information according to the node corresponding with described target directory, it is determined that the node state of the node corresponding with described target directory。
Optionally, described refresh module is configured to:
When the node state of node corresponding to described target directory is dirty, refreshes the nodal information of node corresponding to described target directory and discharge, from internal memory, the node that described target directory is corresponding。
Optionally, described refresh module is configured to:
When the node state of node corresponding to described target directory is dirty, enters kernel state and utilize the system call interfaces that parameter preset parameter performs for discharging node to force the nodal information by node corresponding for the described target directory in internal memory to be updated to disk;And
The node that described target directory is corresponding is discharged from internal memory。
The third aspect according to disclosure embodiment, it is provided that a kind of device creatied directory, described device includes:
Processor;
For storing the memorizer of processor executable;
Wherein, described processor is configured to:
Determine the root name of target directory to be created;
The target partition at the root place of described target directory is determined according to described root name;
Read the superblock of described target partition, obtain the node state of the node corresponding with described target directory;
Node state according to node corresponding to described target directory refreshes the nodal information of node corresponding to described target directory;
Create described target directory。
Embodiment of the disclosure that the technical scheme of offer can include following beneficial effect:
It is determined by the root name of target directory to be created;The target partition at the root place of described target directory is determined according to described root name;Read the superblock of described target partition, obtain the node state of the node corresponding with described target directory;Node state according to node corresponding to described target directory refreshes the nodal information of node corresponding to described target directory;Create described target directory。The disclosure can solve the problem that the node being not turned off this document of causing corresponding due to file in correlation technique is what be timely released, and thus cause create the problem that file is failed。
It should be appreciated that it is only exemplary and explanatory that above general description and details hereinafter describe, the disclosure can not be limited。
Accompanying drawing explanation
Accompanying drawing herein is merged in description and constitutes the part of this specification, it is shown that meets and embodiment of the disclosure, and for explaining the principle of the disclosure together with description。
Fig. 1 is the flow chart of a kind of method creatied directory according to an exemplary embodiment;
Fig. 2 A is the flow chart of a kind of method creatied directory according to another exemplary embodiment;
Fig. 2 B is the flow chart of a kind of method determining root place subregion shown in Fig. 2 A illustrated embodiment;
Fig. 3 A is the block diagram of a kind of device creatied directory according to an exemplary embodiment;
Fig. 3 B is the block diagram that a kind of subregion according to Fig. 3 A illustrated embodiment determines module;
Fig. 3 C is the block diagram of a kind of state determining module according to Fig. 3 A illustrated embodiment;
Fig. 4 is the block diagram of a kind of device creatied directory according to an exemplary embodiment。
Detailed description of the invention
Here in detail exemplary embodiment being illustrated, its example representation is in the accompanying drawings。When as explained below relates to accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represents same or analogous key element。Embodiment described in following exemplary embodiment does not represent all embodiments consistent with the disclosure。On the contrary, they only with in appended claims describe in detail, the disclosure some in the example of consistent apparatus and method。
Before introducing the method creatied directory that the disclosure provides, first application scenarios involved by the disclosure is introduced, this application scenarios can include a terminal, this terminal is run the operating system having linux system, or other operating systems based on linux system exploitation, for instance android system etc.。
In linux system, order, hardware and software equipment, operating system, process, catalogue, file etc. are for operating system nucleus, it is considered as having the file of respective characteristic or type, namely can be understood as in linux system that all are considered as file, therefore, in each embodiment of the disclosure, target directory to be created can be considered as a kind of catalogue file。In each embodiment of the disclosure, catalogue can also be called file, node refers to inode (index node, it is alternatively referred to as i-node, hereinafter referred to as node), (new file is such as created during one new file when system creation, or create new directory, or with the addition of new equipment etc.), system can for its one node of distribution, the nodal information of the node that each file is corresponding includes: the size of this document, the ID of file owner, the group ID of file owner, the reading of file, write, perform authority, timestamp (the time of node last time variation of file, the time of file content last time variation, the time that the file last time opens), the link number of file and the position of file data blocks etc.。When a task is when using a certain file, node corresponding to this document is just by EMS memory occupation, and another needs to use the task of this document to need to wait that the node that this document is corresponding just can use this document after being discharged by internal memory。Therefore, exist and by EMS memory occupation if the node that target directory to be created is corresponding (includes the node that the file under the node of target directory oneself correspondence and target directory is corresponding), then can cause creating when creating this target directory failed problem。
It addition, above-mentioned terminal can be smart mobile phone, panel computer, intelligent television, intelligent watch, PDA (PersonalDigitalAssistant, personal digital assistant), pocket computer, desk computer etc.。
Fig. 1 is the flow chart of a kind of method creatied directory according to an exemplary embodiment, and the method may be used in terminal, and this terminal can be the terminal in above-mentioned application scenarios, as it is shown in figure 1, the method includes may comprise steps of。
In step S101, it is determined that the root name of target directory to be created。
In step s 102, the target partition at the root place of described target directory is determined according to described root name。
In an operating system, it is possible to by the storage medium of terminal, such as disk, flash memory etc. are divided at least one subregion, therefore here it needs to be determined that the subregion at the root place of described target directory。
In step s 103, read the superblock of described target partition, obtain the node state of the node corresponding with described target directory。
Wherein, node state includes totally, or dirty。Illustratively, the corresponding file system of each subregion, the corresponding superblock of each file system, each superblock have recorded the information of all nodes in corresponding subregion。It addition, when, after os starting, system kernel can copy to the content in superblock in internal memory, and the what be new in internal memory is periodically utilized to update the content in the superblock on disk。When, in the process that operating system restarts, both can be compared by system kernel, according to the difference between them, stamp clean or dirty label to file system。For node, node state is clean, refers to that the nodal information of this node has been updated to disk from internal memory, thus this node is consistent with the nodal information in disk in internal memory, internal memory can discharge this node;Node state is dirty, refers to that the nodal information of this node is but without being updated to disk, thus the nodal information that this node is in internal memory and in disk there are differences, internal memory can not discharge this node。Such as, when a certain file is used by a certain application program, the node corresponding with this document is not zero, these nodes are owing to being in occupied state, therefore the nodal information of these nodes is but without being updated to disk, thus these nodes cannot be discharged by internal memory in time, therefore the node state of these nodes that this document is corresponding is dirty。Therefore, in the present embodiment, also including node in the described target partition read in the superblock of the described target partition from internal memory in the nodal information of each node is clean or dirty state such that it is able to determine the node state of the node that described target directory is corresponding。It addition, node corresponding to target directory described in the present embodiment can refer to the node that the file under the node of self correspondence of described target directory and described target directory is corresponding。
In step S104, refresh the nodal information of node corresponding to described target directory according to the node state of node corresponding to described target directory。
Illustratively, the nodal information of node corresponding to described target directory is refreshed, it is possible to understand that for being updated in disk by the nodal information of node corresponding for the described target directory in internal memory。After the nodal information of node corresponding to the described target directory in internal memory is saved to disk, internal memory just can discharge this node。
In step S105, create described target directory。
It addition, the disk described in the present embodiment can be hard disk, include but not limited to mechanical hard disk or solid state hard disc, it is also possible to be other power down memorizeies of not losing data。
In sum, the method creatied directory that disclosure embodiment provides, it is determined by the root name of target directory to be created;The target partition at the root place of described target directory is determined according to described root name;Read the superblock of described target partition, obtain the node state of the node corresponding with described target directory;Node state according to node corresponding to described target directory refreshes the nodal information of node corresponding to described target directory;Create described target directory。The disclosure can solve the problem that the node being not turned off this document of causing corresponding due to file in correlation technique is what be timely released, and thus cause create the problem that file is failed。
Fig. 2 A is the flow chart of a kind of method creatied directory according to another exemplary embodiment, and the method may be used in terminal, and this terminal can be the terminal in above-mentioned application scenarios, as in figure 2 it is shown, the method includes may comprise steps of。
In step 201, it is determined that the root name of target directory to be created。
In step 202., the target partition at the root place of described target directory is determined according to described root name。
In an operating system, can by the storage medium of terminal, such as disk, flash memories etc. are divided at least one subregion, therefore here it needs to be determined that the subregion at the root place of described target directory, but the root determined in step 201 is likely to be Symbolic Links, and (Symbolic Links are named again soft link, it it is the special file of a class, this file contains the pathname of another file, this pathname is probably relative path or absolute path, this path can be any file or catalogue, the file of different file can be linked), therefore, referring to Fig. 2 B, following steps 2021~2023 can be carried out, Fig. 2 B is the flow chart of a kind of method determining root place subregion shown in Fig. 2 A illustrated embodiment, wherein:
Step 2021, identifies whether the root of target directory is Symbolic Links。
Step 2022, if the root of target directory is true root, then can utilize the corresponding relation of catalogue and subregion to determine the subregion at described true root place。
Step 2023, if the root of target directory is not true root but Symbolic Links, can first obtaining the true root that described Symbolic Links point to, further according to the directory name of described true root, and the corresponding relation of catalogue and subregion determines the subregion at described true root place。
Illustratively, in android system, the relation of above-mentioned catalogue and subregion can pass through/proc/mounts file acquisition, wherein, should/proc/mounts file in have recorded the file system of current system institute carry, should/proc/mounts file in each entry can a corresponding subregion, and each entry can embody with the form of catalogue, for instance:
Assume that target directory to be created is /sdcard/Android file, then may determine that its root is /sdcard, if this root were /sdcard would be Symbolic Links, then need the true root that acquisition/sdcard points to, the true root assuming its sensing is /storage/sdcard0, then can open/proc/mounts file, directory name/the storage/sdcard0 of true root is utilized to mate in the entry of/proc/mounts file, such as match entry/dev/fuse/storage/sdcard0, then may determine that the subregion at the root place of file/sdcard/Android file is for/dev/fuse/, and carry out step 203。
In step 203, reading the superblock of described target partition, described superblock includes the nodal information of node corresponding to All Files in described target partition。
Superblock is the heart of file system, it saves the global profile information of file system, such as disk is with space, data block free space, nodal information etc., therefore read superblock to obtain All Files in described target partition (file here includes multimedia file, catalogue, the equipment added, mounted program etc.) corresponding to the nodal information of node, illustratively, the nodal information of each node includes: the size of the file that node is corresponding, the ID of file owner, the group ID of file owner, the reading of file, write, perform authority, timestamp (the time of node last time variation of file, the time of file content last time variation, the time that the file last time opens), the link number of file and the position of file data blocks etc.。Additionally, due to when after os starting, system kernel can copy in internal memory the content in superblock, and periodically utilize the what be new in internal memory to update the content in the superblock on disk, and when in the process that operating system restarts, both can be compared by system kernel, according to the difference between them, stamps clean or dirty label to the content of the superblock copied in internal memory。Therefore, by reading the nodal information of all nodes in this target partition that the superblock in internal memory obtains, in addition to the above-described information, also should include node state is clean (clear) or dirty (dirty)。
In step 204, the directory name utilizing described target directory searches the nodal information of the node corresponding with described target directory in described target partition in the nodal information of node corresponding to All Files。
In step 205, the nodal information according to the node corresponding with described target directory, it is determined that the node state of the node corresponding with described target directory。
Illustratively, the node that described target directory is corresponding can include the node that described target directory is corresponding, and the node that file under described target directory is corresponding。
In step 206, when the node state of node corresponding to described target directory is dirty, refreshes the nodal information of node corresponding to described target directory and discharge, from internal memory, the node that described target directory is corresponding。
Illustratively, when the node state of node corresponding to described target directory is dirty, entering kernel state utilizes the parameter preset execution system call interfaces for discharging node to force to refresh the nodal information of node corresponding to described target directory, here the nodal information forcing to refresh node corresponding to the described target directory that can be understood as in just internal memory is updated to disk immediately, after the up-to-date nodal information of the node that described target directory in such internal memory is corresponding is saved, internal memory just can discharge the node that described target directory is corresponding。Carrying out step 207 after discharging, from internal memory, the node that described target directory is corresponding, wherein, described parameter preset can be kill_dirty, and the described system call interfaces for discharging node can be invalidate_inode。
In step 207, described target directory is created。
The node corresponding due to described target directory is released, therefore, it is possible to avoid creating failed problem。
It addition, the disk described in the present embodiment can be hard disk, include but not limited to mechanical hard disk or solid state hard disc, it is also possible to be other power down memorizeies of not losing data。
In sum, the method creatied directory that disclosure embodiment provides, it is determined by the root name of target directory to be created;The target partition at the root place of described target directory is determined according to described root name;Read the superblock of described target partition, obtain the node state of the node corresponding with described target directory;Node state according to node corresponding to described target directory refreshes the nodal information of node corresponding to described target directory;Create described target directory。The disclosure can solve the problem that the node being not turned off this document of causing corresponding due to file in correlation technique is what be timely released, and thus cause create the problem that file is failed。
Fig. 3 A is the block diagram of a kind of device creatied directory according to an exemplary embodiment。This device 300 may be used for the method shown in Fig. 1 or Fig. 2 that performs, this device 300 can apply to terminal, the some or all of of this terminal can be constituted by the form of software or hardware or the two combination, this terminal can be the terminal described in above-mentioned application scenarios, with reference to Fig. 3, this device 300 can include root and determine that module 310, subregion determine module 320, state determining module 330, refresh module 340 and creation module 350。
Root determines module 310, is configured to determine that the root name of target directory to be created;
Subregion determines module 320, is configured to determine the target partition at the root place of described target directory according to described root name;
State determining module 330, is configured to read the superblock of described target partition, obtains the node state of the node corresponding with described target directory;
Refresh module 340, the node state being configured to the node corresponding according to described target directory refreshes the nodal information of node corresponding to described target directory;
Creation module 350, is configured to create described target directory。
Optionally, Fig. 3 B is the block diagram that a kind of subregion according to Fig. 3 A illustrated embodiment determines module, and referring to Fig. 3 B, described subregion determines that module 320 includes:
Obtain submodule 321, when being configured as the by name Symbolic Links of described root, obtain the true root that described Symbolic Links point to;
Determine submodule 322, be configured to the directory name according to described true root, and the corresponding relation of catalogue and subregion determines the subregion at described true root place。
Optionally, Fig. 3 C is the block diagram of a kind of state determining module according to Fig. 3 A illustrated embodiment, and referring to Fig. 3 C, described state determining module 330 includes:
Reading submodule 331, is configured to read the superblock of described target partition, and described superblock includes the nodal information of node corresponding to All Files in described target partition;
Searching submodule 332, the directory name being configured to, with described target directory searches the nodal information of the node corresponding with described target directory in described target partition in the nodal information of node corresponding to All Files;
Determine submodule 333, be configured to the nodal information according to the node corresponding with described target directory, it is determined that the node state of the node corresponding with described target directory。
Optionally, described refresh module 340 is configured to:
When the node state of node corresponding to described target directory is dirty, refreshes the nodal information of node corresponding to described target directory and discharge, from internal memory, the node that described target directory is corresponding。
Optionally, described refresh module 340 is configured to:
When the node state of node corresponding to described target directory is dirty, enters kernel state and utilize the system call interfaces that parameter preset parameter performs for discharging node to force the nodal information by node corresponding for the described target directory in internal memory to be updated to disk;And
The node that described target directory is corresponding is discharged from internal memory。
In sum, the device creatied directory that disclosure embodiment provides, it is determined by the root name of target directory to be created;The target partition at the root place of described target directory is determined according to described root name;Read the superblock of described target partition, obtain the node state of the node corresponding with described target directory;Node state according to node corresponding to described target directory refreshes the nodal information of node corresponding to described target directory;Create described target directory。The disclosure can solve the problem that the node being not turned off this document of causing corresponding due to file in correlation technique is what be timely released, and thus cause create the problem that file is failed。
About the device in above-described embodiment, the concrete mode that wherein modules performs to operate has been described in detail in about the embodiment of the method, and explanation will be not set forth in detail herein。
Fig. 4 is the block diagram of a kind of device 400 creatied directory according to an exemplary embodiment。Such as, device 400 can be mobile phone, computer, digital broadcast terminal, messaging devices, game console, tablet device, armarium, body-building equipment, personal digital assistant etc.。
With reference to Fig. 4, device 400 can include following one or more assembly: processes assembly 402, memorizer 404, electric power assembly 406, multimedia groupware 408, audio-frequency assembly 410, the interface 412 of input/output (I/O), sensor cluster 414, and communications component 416。
Process assembly 402 and generally control the integrated operation of device 400, such as with display, call, data communication, the operation that camera operation and record operation are associated。Process assembly 402 and can include one or more processor 420 to perform instruction, to complete all or part of step of the method shown in above-mentioned Fig. 1 or Fig. 2。Additionally, process assembly 402 can include one or more module, it is simple to what process between assembly 402 and other assemblies is mutual。Such as, process assembly 402 and can include multi-media module, with facilitate multimedia groupware 408 and process between assembly 402 mutual。
Memorizer 404 is configured to store various types of data to support the operation at device 400。The example of these data includes any application program for operation on device 400 or the instruction of method, contact data, telephone book data, message, picture, video etc.。Memorizer 404 can be realized by any kind of volatibility or non-volatile memory device or their combination, such as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash memory, disk or CD。
The various assemblies that electric power assembly 406 is device 400 provide electric power。Electric power assembly 406 can include power-supply management system, one or more power supplys, and other generate, manage and distribute, with for device 400, the assembly that electric power is associated。
Multimedia groupware 408 includes the screen providing an output interface between described device 400 and user。In certain embodiments, screen can include liquid crystal display (LCD) and touch panel (TP)。If screen includes touch panel, screen may be implemented as touch screen, to receive the input signal from user。Touch panel includes one or more touch sensor to sense the gesture on touch, slip and touch panel。Described touch sensor can not only sense the border of touch or sliding action, but also detects the persistent period relevant to described touch or slide and pressure。In certain embodiments, multimedia groupware 408 includes a front-facing camera and/or post-positioned pick-up head。When device 400 is in operator scheme, during such as screening-mode or video mode, front-facing camera and/or post-positioned pick-up head can receive the multi-medium data of outside。Each front-facing camera and post-positioned pick-up head can be a fixing optical lens system or have focal length and optical zoom ability。
Audio-frequency assembly 410 is configured to output and/or input audio signal。Such as, audio-frequency assembly 410 includes a mike (MIC), and when device 400 is in operator scheme, during such as call model, logging mode and speech recognition mode, mike is configured to receive external audio signal。The audio signal received can be further stored at memorizer 404 or send via communications component 416。In certain embodiments, audio-frequency assembly 410 also includes a speaker, is used for exporting audio signal。
I/O interface 412 provides interface for processing between assembly 402 and peripheral interface module, above-mentioned peripheral interface module can be keyboard, puts striking wheel, button etc.。These buttons may include but be not limited to: home button, volume button, startup button and locking press button。
Sensor cluster 414 includes one or more sensor, for providing the state estimation of various aspects for device 400。Such as, what sensor cluster 414 can detect device 400 opens/closed mode, the relative localization of assembly, such as described assembly is display and the keypad of device 400, the position change of all right detecting device 400 of sensor cluster 414 or 400 1 assemblies of device, the presence or absence that user contacts with device 400, the variations in temperature of device 400 orientation or acceleration/deceleration and device 400。Sensor cluster 414 can include proximity transducer, is configured to when not having any physical contact object near detection。Sensor cluster 414 can also include optical sensor, such as CMOS or ccd image sensor, for using in imaging applications。In certain embodiments, this sensor cluster 414 can also include acceleration transducer, gyro sensor, Magnetic Sensor, pressure transducer or temperature sensor。
Communications component 416 is configured to facilitate between device 400 and other equipment the communication of wired or wireless mode。Device 400 can access the wireless network based on communication standard, such as WiFi, 2G or 3G, or their combination。In one exemplary embodiment, communications component 416 receives the broadcast singal or the broadcast related information that manage system from external broadcasting via broadcast channel。In one exemplary embodiment, described communications component 416 also includes near-field communication (NFC) module, to promote junction service。Such as, can based on RF identification (RFID) technology in NFC module, Infrared Data Association (IrDA) technology, ultra broadband (UWB) technology, bluetooth (BT) technology and other technologies realize。
In the exemplary embodiment, device 400 can be realized by one or more application specific integrated circuits (ASIC), digital signal processor (DSP), digital signal processing appts (DSPD), PLD (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components, for performing the method shown in above-mentioned Fig. 1 or Fig. 2。
In the exemplary embodiment, additionally providing a kind of non-transitory computer-readable recording medium including instruction, for instance include the memorizer 404 of instruction, above-mentioned instruction can have been performed the method shown in above-mentioned Fig. 1 or Fig. 2 by the processor 420 of device 400。Such as, described non-transitory computer-readable recording medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk and optical data storage devices etc.。
Those skilled in the art, after considering description and putting into practice the disclosure, will readily occur to other embodiment of the disclosure。The application is intended to any modification of the disclosure, purposes or adaptations, and these modification, purposes or adaptations are followed the general principle of the disclosure and include the undocumented known general knowledge in the art of the disclosure or conventional techniques means。Description and embodiments is considered only as exemplary, and the true scope of the disclosure and spirit are pointed out by claim below。
It should be appreciated that the disclosure is not limited to precision architecture described above and illustrated in the accompanying drawings, and various amendment and change can carried out without departing from the scope。The scope of the present disclosure is only limited by appended claim。

Claims (11)

1. the method creatied directory, it is characterised in that described method includes:
Determine the root name of target directory to be created;
The target partition at the root place of described target directory is determined according to described root name;
Read the superblock of described target partition, obtain the node state of the node corresponding with described target directory;
Node state according to node corresponding to described target directory refreshes the nodal information of node corresponding to described target directory;
Create described target directory。
2. method according to claim 1, it is characterised in that the target partition at the described root place determining described target directory according to described root name includes:
When described root Symbolic Links by name, obtain the true root that described Symbolic Links point to;
Directory name according to described true root, and the corresponding relation of catalogue and subregion determines the subregion at described true root place。
3. method according to claim 1, it is characterised in that the superblock of the described target partition of described reading, the node state obtaining the node corresponding with described target directory includes:
Reading the superblock of described target partition, described superblock includes the nodal information of node corresponding to All Files in described target partition;
The directory name utilizing described target directory searches the nodal information of the node corresponding with described target directory in described target partition in the nodal information of node corresponding to All Files;
Nodal information according to the node corresponding with described target directory, it is determined that the node state of the node corresponding with described target directory。
4. method according to claim 1, it is characterised in that the node state of the described node corresponding according to described target directory refreshes the nodal information of node corresponding to described target directory and includes:
When the node state of node corresponding to described target directory is dirty, refreshes the nodal information of node corresponding to described target directory and discharge, from internal memory, the node that described target directory is corresponding。
5. method according to claim 4, it is characterised in that when the node state of the described node corresponding when described target directory is dirty, the nodal information refreshing node corresponding to described target directory the node discharging described target directory corresponding from internal memory include:
When the node state of node corresponding to described target directory is dirty, enters kernel state and utilize the system call interfaces that parameter preset parameter performs for discharging node to force the nodal information by node corresponding for the described target directory in internal memory to be updated to disk;And
The node that described target directory is corresponding is discharged from internal memory。
6. the device creatied directory, it is characterised in that described device includes:
Root determines module, is configured to determine that the root name of target directory to be created;
Subregion determines module, is configured to determine the target partition at the root place of described target directory according to described root name;
State determining module, is configured to read the superblock of described target partition, obtains the node state of the node corresponding with described target directory;
Refresh module, the node state being configured to the node corresponding according to described target directory refreshes the nodal information of node corresponding to described target directory;
Creation module, is configured to create described target directory。
7. device according to claim 6, it is characterised in that described subregion determines that module includes:
Obtain submodule, when being configured as the by name Symbolic Links of described root, obtain the true root that described Symbolic Links point to;
Determine submodule, be configured to the directory name according to described true root, and the corresponding relation of catalogue and subregion determines the subregion at described true root place。
8. device according to claim 6, it is characterised in that described state determining module includes:
Reading submodule, is configured to read the superblock of described target partition, and described superblock includes the nodal information of node corresponding to All Files in described target partition;
Searching submodule, the directory name being configured to, with described target directory searches the nodal information of the node corresponding with described target directory in described target partition in the nodal information of node corresponding to All Files;
Determine submodule, be configured to the nodal information according to the node corresponding with described target directory, it is determined that the node state of the node corresponding with described target directory。
9. device according to claim 6, it is characterised in that described refresh module is configured to:
When the node state of node corresponding to described target directory is dirty, refreshes the nodal information of node corresponding to described target directory and discharge, from internal memory, the node that described target directory is corresponding。
10. device according to claim 9, it is characterised in that described refresh module is configured to:
When the node state of node corresponding to described target directory is dirty, enters kernel state and utilize the system call interfaces that parameter preset parameter performs for discharging node to force the nodal information by node corresponding for the described target directory in internal memory to be updated to disk;And
The node that described target directory is corresponding is discharged from internal memory。
11. the device creatied directory, it is characterised in that described device includes:
Processor;
For storing the memorizer of processor executable;
Wherein, described processor is configured to:
Determine the root name of target directory to be created;
The target partition at the root place of described target directory is determined according to described root name;
Read the superblock of described target partition, obtain the node state of the node corresponding with described target directory;
Node state according to node corresponding to described target directory refreshes the nodal information of node corresponding to described target directory;
Create described target directory。
CN201511000891.1A 2015-12-28 2015-12-28 The method and apparatus to create directory Active CN105701146B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201511000891.1A CN105701146B (en) 2015-12-28 2015-12-28 The method and apparatus to create directory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201511000891.1A CN105701146B (en) 2015-12-28 2015-12-28 The method and apparatus to create directory

Publications (2)

Publication Number Publication Date
CN105701146A true CN105701146A (en) 2016-06-22
CN105701146B CN105701146B (en) 2019-07-05

Family

ID=56225883

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201511000891.1A Active CN105701146B (en) 2015-12-28 2015-12-28 The method and apparatus to create directory

Country Status (1)

Country Link
CN (1) CN105701146B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113127141A (en) * 2019-12-31 2021-07-16 重庆小雨点小额贷款有限公司 Container system management method and device, terminal equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110173154A1 (en) * 2010-01-09 2011-07-14 International Business Machines Corporation Catalog reorganization apparatus and method
CN103744961A (en) * 2014-01-06 2014-04-23 清华大学 Method for prolonging service life of nonvolatile storage with reconfigurable file system directory tree
CN104199967A (en) * 2014-09-22 2014-12-10 广东欧珀移动通信有限公司 Cellphone file recovery method and device
CN104199750A (en) * 2014-08-26 2014-12-10 上海天脉聚源文化传媒有限公司 File recovery method and device of linux system
CN104537050A (en) * 2014-12-25 2015-04-22 华中科技大学 Method for batch and rapid establishment of metadata and data of file system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110173154A1 (en) * 2010-01-09 2011-07-14 International Business Machines Corporation Catalog reorganization apparatus and method
CN103744961A (en) * 2014-01-06 2014-04-23 清华大学 Method for prolonging service life of nonvolatile storage with reconfigurable file system directory tree
CN104199750A (en) * 2014-08-26 2014-12-10 上海天脉聚源文化传媒有限公司 File recovery method and device of linux system
CN104199967A (en) * 2014-09-22 2014-12-10 广东欧珀移动通信有限公司 Cellphone file recovery method and device
CN104537050A (en) * 2014-12-25 2015-04-22 华中科技大学 Method for batch and rapid establishment of metadata and data of file system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113127141A (en) * 2019-12-31 2021-07-16 重庆小雨点小额贷款有限公司 Container system management method and device, terminal equipment and storage medium
CN113127141B (en) * 2019-12-31 2024-03-15 重庆小雨点小额贷款有限公司 Container system management method and device, terminal equipment and storage medium

Also Published As

Publication number Publication date
CN105701146B (en) 2019-07-05

Similar Documents

Publication Publication Date Title
CN104156233B (en) Light application off-line update method, device and terminal
CN105488112A (en) Information pushing method and device
CN105204959A (en) Method and device for restoring deleted files in ext file system
CN104484200A (en) Method and device for updating firmware
CN104375828A (en) Method and device for optimizing memory
CN105808050A (en) Information search method and device
CN105095025B (en) Restore the method and device of deleted document in ext file system
CN106126685A (en) Page loading method and device
KR20160034839A (en) Method and device for back up file
CN105208177B (en) Address book updating method and device
CN106201734A (en) Sharing files method and device
CN105094904A (en) Application program installation method and device
CN105808305A (en) Static resource loading method and device
CN106648730A (en) Processing method and device of abnormal application
CN104049864A (en) Object control method and device
CN104615546A (en) File data management method and device
CN105183586A (en) Method and apparatus for restoring accidentally deleted file in EXT file system and intelligent device
CN105630546A (en) System updating method and system updating device
CN105843486A (en) Method and apparatus for interface display
CN105045686B (en) File access pattern method and device
CN104714826A (en) Application theme loading method and device
CN104503786A (en) Method and device for refreshing firmware
CN105681455A (en) Method, device and system for acquiring images
CN107239771A (en) Fingerprint calibration method and device
CN103870361A (en) Image recovery method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant