CN106126272A - File system discharging method and device - Google Patents

File system discharging method and device Download PDF

Info

Publication number
CN106126272A
CN106126272A CN201610425469.9A CN201610425469A CN106126272A CN 106126272 A CN106126272 A CN 106126272A CN 201610425469 A CN201610425469 A CN 201610425469A CN 106126272 A CN106126272 A CN 106126272A
Authority
CN
China
Prior art keywords
file
target disk
function
file system
umount
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.)
Pending
Application number
CN201610425469.9A
Other languages
Chinese (zh)
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 Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201610425469.9A priority Critical patent/CN106126272A/en
Publication of CN106126272A publication Critical patent/CN106126272A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading

Landscapes

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

Abstract

A kind of file system discharging method of disclosure offer and device, a kind of file system discharging method, including: the file on detection target disk subregion is the most accessed;If there being file to be accessed, then search the process accessing described file;Kill described process, and unload the file system on described target disk subregion.As can be seen here, disclosure technical scheme can the file in disk partition when being accessed by process, find out this process and kill, unload the file system in this disk partition the most again, it is thus possible to avoid because process takies the file system dismount failure that file is caused, on the one hand, improve the unloading success rate of file system, on the other hand, improve the stability of system.

Description

File system discharging method and device
Technical field
It relates to operation system technology field, particularly to a kind of file system discharging method and device.
Background technology
At present at system closedown or before subregion is operated, it usually needs the file in the corresponding disk partition of unloading System, to avoid damaging the file system in this disk partition or file.In correlation technique, if the file in disk partition It is currently being used, then cannot complete the unloading of file system in this disk partition, cause dismount failure.
Summary of the invention
In order to solve the problems referred to above, the disclosure provides a kind of file system discharging method and device.
Specifically, the disclosure is achieved by the following technical solution:
First aspect according to disclosure embodiment, it is provided that a kind of file system discharging method, described method includes:
File on detection target disk subregion is the most accessed;
If there being file to be accessed, then search the process accessing described file;
Kill described process, and unload the file system on described target disk subregion.
In one embodiment, the file on described detection target disk subregion is the most accessed, including:
Call umount function, to the mount point catalogue of described umount function passes target disk subregion;
If the file system failure unloaded by described umount function on described target disk subregion, then check that unloading is lost Whether the error code errno lost is EBUSY;
Wherein, if described error code errno is EBUSY, the most described target disk subregion there is file to be accessed.
In one embodiment, described lookup is accessing the process of described file, including:
Determine/proc catalogue under with the subdirectory of numerical designation;
Travel through the filec descriptor in fd catalogue under described subdirectory;
Judge that described filec descriptor is the most identical with the directory name of the mount point catalogue of described target disk subregion, if Identical, then the process that this document descriptor is corresponding is the process accessing described file.
In one embodiment, described in kill described process, including:
Obtain the mark of described process;
Call kill function, to the mark of process described in described kill function passes.
In one embodiment, the file system on described unloading described target disk subregion, including:
Call umount function, to the mount point catalogue of described umount function passes target disk subregion.
Second aspect according to disclosure embodiment, it is provided that a kind of file system discharge mechanism, described device includes:
Detection module, the file being configured to detect on target disk subregion is the most accessed;
Search module, be configured to the testing result at described detection module for being in the case of, lookup is accessing institute State the process of file;
Terminate module, be configured to kill the process that described lookup module searches arrives;
Unload module, is configured to, after described termination module kills described process, unload on described target disk subregion File system.
In one embodiment, described detection module, including:
First function call submodule, is configured to call umount function, to described umount function passes target magnetic The mount point catalogue of dish subregion;
Check submodule, be configured in the file system unloading on described target disk subregion by described umount function In the case of uniting unsuccessfully, check whether the error code errno of dismount failure is EBUSY;
Wherein, if the inspection result of described inspection submodule is yes, the most described target disk subregion has file by Access.
In one embodiment, described lookup module, including:
Determine submodule, be configured to determine that/proc catalogue under with the subdirectory of numerical designation;
Traversal submodule, is configured to travel through the described file determined under the subdirectory that submodule determines in fd catalogue and describes Symbol;
Judge submodule, be configured to judge filec descriptor that described traversal submodule traverses and described target disk The directory name of the mount point catalogue of subregion is the most identical, if identical, then the process that this document descriptor is corresponding is for access The process of described file.
In one embodiment, described termination module, including:
Mark obtains submodule, is configured to obtain the mark of described process;
Second function call submodule, is configured to call kill function, obtains to identifying described in described kill function passes Take the mark of the described process that submodule gets.
In one embodiment, described Unload module, including:
3rd function call submodule, is configured to call umount function, to described umount function passes target magnetic The mount point catalogue of dish subregion.
The third aspect according to disclosure embodiment, it is provided that a kind of file system discharge mechanism, including:
Processor;
For storing the memorizer of processor executable;
Wherein, described processor is configured to:
File on detection target disk subregion is the most accessed;
If there being file to be accessed, then search the process accessing described file;
Kill described process, and unload the file system on described target disk subregion.
The present embodiment can the file in disk partition when being accessed by process, find out this process and kill, unloading the most again Carry the file system in this disk partition such that it is able to avoid because process takies the file system dismount failure that file is caused, On the one hand, improve the unloading success rate of file system, on the other hand, improve the stability of system.
The present embodiment the most can be accessed by process by the file that umount function judges in disk partition, if Accessed by process, then by the way of traversal/proc catalogue, find out this process and kill, unloading again by umount function afterwards Carry the file system in this disk partition, thus the process that solves takies file and causes the failed problem of unloading of file system, a side Face, improves the unloading success rate of file system, on the other hand, improves the stability of system.
It should be appreciated that it is only exemplary that above general description and details hereinafter describe, can not be limited this Open.
Accompanying drawing explanation
Accompanying drawing herein is merged in description and constitutes the part of this specification, it is shown that meet the enforcement of the present invention Example, and for explaining the principle of the present invention together with description.
Fig. 1 is the disclosure flow chart according to a kind of file system discharging method shown in an exemplary embodiment;
Fig. 2 is the disclosure flow chart according to the another kind of file system discharging method shown in an exemplary embodiment;
Fig. 3 is the disclosure block diagram according to a kind of file system discharge mechanism shown in an exemplary embodiment;
Fig. 4 is the disclosure block diagram according to the another kind of file system discharge mechanism shown in an exemplary embodiment;
Fig. 5 is the disclosure block diagram according to the another kind of file system discharge mechanism shown in an exemplary embodiment;
Fig. 6 is the disclosure block diagram according to the another kind of file system discharge mechanism shown in an exemplary embodiment;
Fig. 7 is the disclosure block diagram according to the another kind of file system discharge mechanism shown in an exemplary embodiment;
Fig. 8 is that the disclosure is shown according to a kind of structure for file system discharge mechanism shown in an exemplary embodiment It is intended to.
Detailed description of the invention
Here will illustrate exemplary embodiment in detail, its example represents in the accompanying drawings.Explained below relates to During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represents same or analogous key element.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with the disclosure.On the contrary, they are only with the most appended The example of the apparatus and method that some aspects that described in detail in claims, the disclosure are consistent.
The term used in the disclosure is only merely for describing the purpose of specific embodiment, and is not intended to be limiting the disclosure. " a kind of ", " described " and " being somebody's turn to do " of singulative used in disclosure and the accompanying claims book is also intended to include majority Form, unless context clearly shows that other implications.It is also understood that term "and/or" used herein refers to and wraps Any or all containing one or more projects of listing being associated may combination.
Although should be appreciated that in the disclosure possible employing term first, second, third, etc. to describe various information, but this A little information should not necessarily be limited by these terms.These terms are only used for same type of information is distinguished from each other out.Such as, without departing from In the case of disclosure scope, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as One information.Depend on linguistic context, word as used in this " if " can be construed to " ... time " or " when ... Time " or " in response to determining ".
At present at system closedown or before subregion is operated, it usually needs the file in the corresponding disk partition of unloading System, to avoid damaging the file system in this disk partition or file.In correlation technique, if the file in disk partition It is currently being used, then cannot complete the unloading of file system in this disk partition, cause dismount failure.In order to solve above-mentioned asking Topic, present disclose provides a kind of file system discharging method and device.
A kind of file system discharging method provided the disclosure first below is introduced.
It should be noted that the method that the disclosure provides is applicable to terminal unit, in actual applications, this terminal unit can To include: smart mobile phone, panel computer and computer equipment etc., this is not limited by the disclosure.
As it is shown in figure 1, Fig. 1 is the disclosure stream according to a kind of file system discharging method shown in an exemplary embodiment Cheng Tu, the method may comprise steps of:
In a step 101, the file on detection target disk subregion is the most accessed.
The storage device being used for the information that stores in terminal unit is mainly hard disk, but hard disk can not be used directly, Hard disk must be split, a piece, the hard disk areas (i.e. disk partition) of a piece being divided into, then to disk partition through lattice After formula (i.e. creating file system in disk partition), can be used.
File system be the operating system of terminal unit for organizing the method for file in disk partition, be also used for clear and definite magnetic File data structure on dish subregion.From the point of view of system perspective, file system be the space to file-storage device carry out tissue and Distribution, is responsible for file storage the system that the file being stored in is protected and retrieved.Specifically, it is responsible for user's foundation File, is stored in, reads, revises, dump file, controls the access of file, when user not in use by time cancel file etc..
In a step 102, when having file the most when accessed on above-mentioned target disk subregion, search and accessing above-mentioned literary composition The process of part.
It is directed to some type of operating system, in the present embodiment, can be by running lsof (list open Files) order or fuser (find user processes) order, identify and access target disk subregion above The PID (Process Identification, Process identifier) of the process of part.Or, it is possible to use in correlation technique Any one process lookup method, reaches to search the purpose of the process accessing above-mentioned file, and this is not done by the present embodiment Limit.
In step 103, the process accessing above-mentioned file is killed.
In the present embodiment, just can terminate by running kill function or some Premium Features of fuser order In the process accessing above-mentioned file.Or, it is possible to use any one process lookup method in correlation technique, reach to kill Falling the purpose of the process accessing above-mentioned file, this is not limited by the present embodiment.
At step 104, the file system on above-mentioned target disk subregion is unloaded.
In the present embodiment, the file system unloading of routine can by running umount function, be performed.Or, also Any one process lookup method in correlation technique can be used, reach to unload the file system on above-mentioned target disk subregion The purpose of system, this is not limited by the present embodiment.
As seen from the above-described embodiment, this embodiment can the file in disk partition when being accessed by process, find out this and enter Journey also kills, and unloads the file system in this disk partition the most again such that it is able to avoid because process takies what file was caused File system dismount failure, on the one hand, improve the unloading success rate of file system, on the other hand, improve stablizing of system Property.
As in figure 2 it is shown, Fig. 2 is that the disclosure is according to the another kind of file system discharging method shown in an exemplary embodiment Flow chart, is directed to the terminal unit of the type such as smart mobile phone, panel computer, and the method may comprise steps of:
In step 201, call umount function, to the mount point mesh of this umount function passes target disk subregion Record, when being unloaded the file system failure on above-mentioned target disk subregion by this umount function, checks the mistake of dismount failure Whether error code errno is EBUSY.
Mount point is the entrance catalogue of disk partition file system, and carry is that disk partition is associated with a certain assigned catalogue Process, carry disk partition enables the disk partition originating in this assigned catalogue (i.e. mount point) to be used, such as Userdata subregion, its mount point catalogue is /data.
In the present embodiment, the method for file system in the unloading disk partition of umount function of calling is: to umount function The mount point of the corresponding disk partition of transmission, such as disk partition: userdata subregion, its mount point catalogue is /data, the most only Need to umount function passes/data catalogue, if the file system on userdata subregion unloads successfully, the most directly Return;If the file system dismount failure on userdata subregion, then check the error code errno of file system dismount failure Whether it is EBUSY, if error code is EBUSY, then has file to be accessed by process on explanation userdata subregion.
In step 202., when above-mentioned error code errno is EBUSY, determine/proc catalogue under with the son of numerical designation Catalogue, travels through the filec descriptor in fd catalogue under above-mentioned subdirectory, it is judged that above-mentioned filec descriptor divides with above-mentioned target disk The directory name of the mount point catalogue in district is the most identical, if identical, then the process that this document descriptor is corresponding is for accessing institute State the process of file.
It should be noted that/proc catalogue saves all of details of current operation system, including process, literary composition Part system, hardware parameter etc.;Wherein ,/proc catalogue comprises some subdirectories with numeral as title, aforementioned each specific item Record represents a process being currently running in system, is the details about this process under subdirectory.Subdirectory Numeral name is exactly the PID of corresponding process, and whenever a new process initiation, a new catalogue will be created, and in like manner, process is tied The when of bundle, corresponding catalogue also can disappear.
In the present embodiment, when file system dismount failure on target disk subregion ,/proc catalogue can be opened, Searching all directory names under this catalogue is the subdirectory of numerical designation.Afterwards, travel through the above-mentioned subdirectory found, often travel through To an above-mentioned subdirectory, then composition "/proc/PID/fd ", afterwards, travel through fd catalogue in each subdirectory above-mentioned further Under all of symbol threaded file, such as process 1, the file under its fd catalogue is as follows:
As above these files are i.e. the files that process 1 is opened.
Connect the example in step 201, read respectively these file name simultaneous interpretations go forward one by one come mount point "/data " compare Relatively, above-mentioned process 1 file opened, the most all files opened of process 1 do not comprise on userdata subregion File.
Continuing traversal, until traversing the fd catalogue of process 2619, finding that this process 2619 is opening following file:
As can be seen here, it is that therefore No. 2619 processes are opened with the explanation of/data beginning due to above-mentioned file File on userdata subregion.
In step 203, obtain the mark of the process accessing above-mentioned file, call kill function, to this kill letter Number transmits the mark of above-mentioned process.
Connect the example in step 202, can according to the search procedure of process 2619, find all take/data catalogue under All processes of file, then call the PID of kill function passes correspondence process, kill this process releasing document handle.
In step 204, call umount function, to the mount point of this umount function passes above-mentioned target disk subregion Catalogue.
Determine do not have file occupied on target disk subregion time, can again call umount function and unload this disk File system on subregion.
As seen from the above-described embodiment, this embodiment can by umount function judge the file in disk partition whether by Process accesses, if accessed by process, then finds out this process by the way of traversal/proc catalogue and kills, the most again leading to Cross umount function and unload the file system in this disk partition, thus the process that solves takies file and causes unloading of file system to lose The problem lost, on the one hand, improve the unloading success rate of file system, on the other hand, improve the stability of system.
Although it should be noted that, describe the operation of the inventive method in the accompanying drawings with particular order, but, this does not requires that Or hint must perform these operations according to this particular order, or having to carry out the most shown operation could realize the phase The result hoped.On the contrary, the step described in flow chart can change execution sequence.Additionally or alternatively, it is convenient to omit some Multiple steps are merged into a step and are performed by step, and/or a step is decomposed into the execution of multiple step.
Corresponding with the embodiment of aforementioned document system uninstallation method, the disclosure additionally provides the reality of file system discharge mechanism Execute example.
As it is shown on figure 3, Fig. 3 is the disclosure frame according to a kind of file system discharge mechanism shown in an exemplary embodiment Figure, this device may include that
Detection module 310, the file being configured to detect on target disk subregion is the most accessed;
Search module 320, be configured to the testing result at above-mentioned detection module 310 for being in the case of, lookup is Access the process of above-mentioned file;
Terminate module 330, be configured to kill the process that above-mentioned lookup module 320 finds;
Unload module 340, is configured to, after above-mentioned termination module 330 kills above-mentioned process, unload above-mentioned target disk File system on subregion.
As seen from the above-described embodiment, this embodiment can the file in disk partition when being accessed by process, find out this and enter Journey also kills, and unloads the file system in this disk partition the most again such that it is able to avoid because process takies what file was caused File system dismount failure, on the one hand, improve the unloading success rate of file system, on the other hand, improve stablizing of system Property.
As shown in Figure 4, Fig. 4 is that the disclosure is according to the another kind of file system discharge mechanism shown in an exemplary embodiment Block diagram, this embodiment can be on the basis of embodiment illustrated in fig. 3, and above-mentioned detection module 310 may include that
First function call submodule 311, is configured to call umount function, to above-mentioned umount function passes target The mount point catalogue of disk partition;
Check submodule 312, be configured at the literary composition unloading on above-mentioned target disk subregion by above-mentioned umount function In the case of part thrashing, check whether the error code errno of dismount failure is EBUSY;
Wherein, if the inspection result of above-mentioned inspection submodule is yes, the most above-mentioned target disk subregion has file by Access.
As it is shown in figure 5, Fig. 5 is that the disclosure is according to the another kind of file system discharge mechanism shown in an exemplary embodiment Block diagram, this embodiment can be on the basis of Fig. 3 or embodiment illustrated in fig. 4, and above-mentioned lookup module 320 may include that
Determine submodule 321, be configured to determine that/proc catalogue under with the subdirectory of numerical designation;
Traversal submodule 322, is configured to travel through the above-mentioned literary composition determined under the subdirectory that submodule 321 determines in fd catalogue Part descriptor;
Judge submodule 323, be configured to judge filec descriptor that above-mentioned traversal submodule 322 traverses and above-mentioned mesh The directory name of the mount point catalogue of mark disk partition is the most identical, if identical, then the process that this document descriptor is corresponding is just In the process accessing above-mentioned file.
As shown in Figure 6, Fig. 6 is that the disclosure is according to the another kind of file system discharge mechanism shown in an exemplary embodiment Block diagram, this embodiment can be on the basis of any embodiment shown in Fig. 3~Fig. 5, and above-mentioned termination module 330 may include that
Mark obtains submodule 331, is configured to obtain the mark of above-mentioned process;
Second function call submodule 332, is configured to call kill function, to the above-mentioned above-mentioned mark of kill function passes Obtain the mark of the above-mentioned process that submodule 331 gets.
As it is shown in fig. 7, Fig. 7 is that the disclosure is according to the another kind of file system discharge mechanism shown in an exemplary embodiment Block diagram, this embodiment can be on the basis of any embodiment shown in Fig. 3~Fig. 6, and above-mentioned Unload module 340 may include that
3rd function call submodule 341, is configured to call umount function, to above-mentioned umount function passes target The mount point catalogue of disk partition.
In said apparatus, the function of modules and the process that realizes of effect specifically refer to corresponding step in said method Realize process, do not repeat them here.
For device embodiment, owing to it corresponds essentially to embodiment of the method, so relevant part sees method in fact The part executing example illustrates.Device embodiment described above is only schematically, wherein said as separating component The unit illustrated can be or may not be physically separate, and the parts shown as unit can be or can also It not physical location, i.e. may be located at a place, or can also be distributed on multiple NE.Can be according to reality Need to select some or all of module therein to realize the purpose of disclosure scheme.Those of ordinary skill in the art are not paying In the case of going out creative work, i.e. it is appreciated that and implements.
Accordingly, the disclosure additionally provides a kind of file system discharge mechanism, including: processor;For storing processor The memorizer of executable instruction;Wherein, described processor is configured to: detection target disk subregion on file the most by Access;If there being file to be accessed, then search the process accessing described file;Kill described process, and unload described File system on target disk subregion.
As shown in Figure 8, Fig. 8 be the disclosure according to the one shown in an exemplary embodiment for file system discharge mechanism One structural representation of 800.Such as, device 800 can be mobile phone, computer, digital broadcast terminal, and information receiving and transmitting sets Standby, game console, tablet device, armarium, body-building equipment, personal digital assistant, aircraft etc..
With reference to Fig. 8, device 800 can include following one or more assembly: processes assembly 802, memorizer 804, power supply Assembly 806, multimedia groupware 808, audio-frequency assembly 810, the interface 812 of input/output (I/O), sensor cluster 814, and Communications component 816.
Process assembly 802 and generally control the integrated operation of device 800, such as with display, call, data communication, phase The operation that machine operation and record operation are associated.Treatment element 802 can include that one or more processor 820 performs to refer to Order, to complete all or part of step of above-mentioned method.Additionally, process assembly 802 can include one or more module, just Mutual in process between assembly 802 and other assemblies.Such as, processing component 802 can include multi-media module, many to facilitate Media component 808 and process between assembly 802 mutual.
Memorizer 804 is configured to store various types of data to support the operation at equipment 800.Showing of these data Example includes any application program for operation on device 800 or the instruction of method, contact data, telephone book data, disappears Breath, picture, video etc..Memorizer 804 can be by any kind of volatibility or non-volatile memory device or their group Close and realize, such as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM), erasable compile Journey read only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash Device, disk or CD.
The various assemblies that electric power assembly 806 is device 800 provide electric power.Electric power assembly 806 can include power management system System, one or more power supplys, and other generate, manage and distribute, with for device 800, the assembly that electric power is associated.
The screen of one output interface of offer that multimedia groupware 808 is included between device 800 and user.Real at some Executing in example, screen can include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screen can To be implemented as touch screen, to receive the input signal from user.Touch panel include one or more touch sensor with Gesture on sensing touch, slip and touch panel.Touch sensor can not only sense touch or the border of sliding action, and And also detect and touch or persistent period that slide is relevant and pressure.In certain embodiments, multimedia groupware 808 includes One front-facing camera and/or post-positioned pick-up head.When equipment 800 is in operator scheme, during such as screening-mode or video mode, front Put photographic head and/or post-positioned pick-up head can receive outside multi-medium data.Each front-facing camera and post-positioned pick-up head can To be a fixing optical lens system or there is focal length and optical zoom ability.
Audio-frequency assembly 810 is configured to output and/or input audio signal.Such as, audio-frequency assembly 810 includes a Mike Wind (MIC), when device 800 is in operator scheme, during such as call model, logging mode and speech recognition mode, mike is joined It is set to receive external audio signal.The audio signal received can be further stored at memorizer 804 or via communication set Part 816 sends.In certain embodiments, audio-frequency assembly 810 also includes a speaker, is used for exporting audio signal.
I/O interface 812 provides interface for processing between assembly 802 and peripheral interface module, above-mentioned peripheral interface module can To be keyboard, put striking wheel, button etc..These buttons may include but be not limited to: home button, volume button, start button and lock Set button.
Sensor cluster 814 includes one or more sensor, for providing the state of various aspects to comment for device 800 Estimate.Such as, what sensor cluster 814 can detect equipment 800 opens/closed mode, the relative localization of assembly, such as described Assembly is display and the keypad of device 800, and sensor cluster 814 can also detect device 800 or 800 1 assemblies of device Position change, the presence or absence that user contacts with device 600, device 800 orientation or acceleration/deceleration and device 800 Variations in temperature.Sensor cluster 814 can include proximity transducer, is configured to when not having any physical contact detect The existence of neighbouring object.Sensor cluster 814 can also include optical sensor, such as CMOS or ccd image sensor, is used for becoming Use as in application.In certain embodiments, this sensor cluster 814 can also include acceleration transducer, gyro sensors Device, Magnetic Sensor, pressure transducer or temperature sensor.
Communications component 816 is configured to facilitate the communication of wired or wireless mode between device 800 and other equipment.Device 800 can access wireless network based on communication standard, such as WiFi, 2G or 3G, or combinations thereof.An exemplary enforcement In example, communication component 816 receives the broadcast singal from external broadcasting management system or broadcast related information via broadcast channel. In one exemplary embodiment, described communication component 816 also includes near-field communication (NFC) module, to promote junction service.Example As, can be 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 800 can be by one or more application specific integrated circuits (ASIC), numeral letter Number processor (DSP), digital signal processing appts (DSPD), PLD (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components realize, be used for performing said method.
In the exemplary embodiment, a kind of non-transitory computer-readable recording medium including instruction, example are additionally provided As included the memorizer 804 of instruction, above-mentioned instruction can have been performed said method by the processor 820 of device 800.Such as, Described non-transitory computer-readable recording medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk With optical data storage devices etc..
Those skilled in the art, after considering description and putting into practice disclosure disclosed herein, will readily occur to its of the disclosure Its embodiment.The application is intended to any modification, purposes or the adaptations of the disclosure, these modification, purposes or Person's adaptations is followed the general principle of the disclosure and includes the undocumented common 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 by following Claim is pointed out.
It should be appreciated that the disclosure is not limited to precision architecture described above and illustrated in the accompanying drawings, and And various modifications and changes can carried out without departing from the scope.The scope of the present disclosure is only limited by appended claim.

Claims (11)

1. a file system discharging method, it is characterised in that described method includes:
File on detection target disk subregion is the most accessed;
If there being file to be accessed, then search the process accessing described file;
Kill described process, and unload the file system on described target disk subregion.
Method the most according to claim 1, it is characterised in that the file on described detection target disk subregion is the most Accessed, including:
Call umount function, to the mount point catalogue of described umount function passes target disk subregion;
If the file system failure unloaded by described umount function on described target disk subregion, then check dismount failure Whether error code errno is EBUSY;
Wherein, if described error code errno is EBUSY, the most described target disk subregion there is file to be accessed.
Method the most according to claim 1, it is characterised in that described lookup is accessing the process of described file, including:
Determine/proc catalogue under with the subdirectory of numerical designation;
Travel through the filec descriptor in fd catalogue under described subdirectory;
Judge that described filec descriptor is the most identical with the directory name of the mount point catalogue of described target disk subregion, if phase With, then the process that this document descriptor is corresponding is the process accessing described file.
Method the most according to claim 1, it is characterised in that described in kill described process, including:
Obtain the mark of described process;
Call kill function, to the mark of process described in described kill function passes.
Method the most according to claim 1, it is characterised in that the file system on described unloading described target disk subregion System, including:
Call umount function, to the mount point catalogue of described umount function passes target disk subregion.
6. a file system discharge mechanism, it is characterised in that described device includes:
Detection module, the file being configured to detect on target disk subregion is the most accessed;
Search module, be configured to the testing result at described detection module for being in the case of, lookup is accessing described literary composition The process of part;
Terminate module, be configured to kill the process that described lookup module searches arrives;
Unload module, is configured to, after described termination module kills described process, unload the literary composition on described target disk subregion Part system.
Device the most according to claim 6, it is characterised in that described detection module, including:
First function call submodule, is configured to call umount function, divides to described umount function passes target disk The mount point catalogue in district;
Check submodule, be configured to lose in the file system unloading on described target disk subregion by described umount function In the case of losing, check whether the error code errno of dismount failure is EBUSY;
Wherein, if the inspection result of described inspection submodule is yes, the most described target disk subregion there is file to be accessed.
Device the most according to claim 6, it is characterised in that described lookup module, including:
Determine submodule, be configured to determine that/proc catalogue under with the subdirectory of numerical designation;
Traversal submodule, is configured to travel through the described filec descriptor determined under the subdirectory that submodule determines in fd catalogue;
Judge submodule, be configured to judge filec descriptor that described traversal submodule traverses and described target disk subregion The directory name of mount point catalogue the most identical, if identical, then the process that this document descriptor is corresponding is described for accessing The process of file.
Device the most according to claim 6, it is characterised in that described termination module, including:
Mark obtains submodule, is configured to obtain the mark of described process;
Second function call submodule, is configured to call kill function, obtains son to mark described in described kill function passes The mark of the described process that module gets.
Device the most according to claim 6, it is characterised in that described Unload module, including:
3rd function call submodule, is configured to call umount function, divides to described umount function passes target disk The mount point catalogue in district.
11. 1 kinds of file system discharge mechanisms, it is characterised in that including:
Processor;
For storing the memorizer of processor executable;
Wherein, described processor is configured to:
File on detection target disk subregion is the most accessed;
If there being file to be accessed, then search the process accessing described file;
Kill described process, and unload the file system on described target disk subregion.
CN201610425469.9A 2016-06-15 2016-06-15 File system discharging method and device Pending CN106126272A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610425469.9A CN106126272A (en) 2016-06-15 2016-06-15 File system discharging method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610425469.9A CN106126272A (en) 2016-06-15 2016-06-15 File system discharging method and device

Publications (1)

Publication Number Publication Date
CN106126272A true CN106126272A (en) 2016-11-16

Family

ID=57469984

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610425469.9A Pending CN106126272A (en) 2016-06-15 2016-06-15 File system discharging method and device

Country Status (1)

Country Link
CN (1) CN106126272A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107608852A (en) * 2017-09-01 2018-01-19 清华大学 A kind of process monitoring method and device
CN107766142A (en) * 2017-11-15 2018-03-06 深圳市沃特沃德股份有限公司 Method and device based on android system unloading storage device
CN108763403A (en) * 2018-05-22 2018-11-06 中国建设银行股份有限公司 A kind of data unloading method and device
CN108833668A (en) * 2018-04-27 2018-11-16 Oppo广东移动通信有限公司 Closedown method and Related product
CN108920480A (en) * 2018-04-17 2018-11-30 Oppo广东移动通信有限公司 A kind of processing method and equipment, computer storage medium of file system exception
CN110297664A (en) * 2018-03-22 2019-10-01 合肥杰发科技有限公司 Onboard system, vehicle device and its method quickly shut down
CN112015350A (en) * 2020-08-28 2020-12-01 北京浪潮数据技术有限公司 Method, device and medium for unloading data disk of virtual machine
CN117573234A (en) * 2024-01-15 2024-02-20 龙芯中科技术股份有限公司 Software package uninstallation management method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100198843A1 (en) * 2009-02-03 2010-08-05 Bmc Software, Inc. Software Title Discovery
CN102955720A (en) * 2011-08-25 2013-03-06 北京中科智网科技有限公司 Method for improving stability of EXT (extended) file system
CN105005502A (en) * 2015-07-15 2015-10-28 上海斐讯数据通信技术有限公司 Method and system for ending SD card using process through kernel

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100198843A1 (en) * 2009-02-03 2010-08-05 Bmc Software, Inc. Software Title Discovery
CN102955720A (en) * 2011-08-25 2013-03-06 北京中科智网科技有限公司 Method for improving stability of EXT (extended) file system
CN105005502A (en) * 2015-07-15 2015-10-28 上海斐讯数据通信技术有限公司 Method and system for ending SD card using process through kernel

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
崔连和 主编: "《Linux系统与网络管理》", 31 March 2014, 机械工业出版社 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107608852A (en) * 2017-09-01 2018-01-19 清华大学 A kind of process monitoring method and device
CN107766142A (en) * 2017-11-15 2018-03-06 深圳市沃特沃德股份有限公司 Method and device based on android system unloading storage device
CN110297664A (en) * 2018-03-22 2019-10-01 合肥杰发科技有限公司 Onboard system, vehicle device and its method quickly shut down
CN108920480A (en) * 2018-04-17 2018-11-30 Oppo广东移动通信有限公司 A kind of processing method and equipment, computer storage medium of file system exception
CN108920480B (en) * 2018-04-17 2021-09-03 Oppo广东移动通信有限公司 Processing method and device for file system exception and computer storage medium
CN108833668A (en) * 2018-04-27 2018-11-16 Oppo广东移动通信有限公司 Closedown method and Related product
CN108833668B (en) * 2018-04-27 2020-12-15 Oppo广东移动通信有限公司 Shutdown method and related product
CN108763403A (en) * 2018-05-22 2018-11-06 中国建设银行股份有限公司 A kind of data unloading method and device
CN112015350A (en) * 2020-08-28 2020-12-01 北京浪潮数据技术有限公司 Method, device and medium for unloading data disk of virtual machine
CN112015350B (en) * 2020-08-28 2022-03-22 北京浪潮数据技术有限公司 Method, device and medium for unloading data disk of virtual machine
CN117573234A (en) * 2024-01-15 2024-02-20 龙芯中科技术股份有限公司 Software package uninstallation management method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106126272A (en) File system discharging method and device
CN106488251A (en) Realize the live middle even method and device of wheat, main broadcaster's client and subscription client
CN106406657A (en) Fast operation method and device and terminal
CN106227848A (en) The display packing of notification message, device and terminal
CN105120084A (en) Image-based communication method and apparatus
CN105095025B (en) Restore the method and device of deleted document in ext file system
CN104965732B (en) Desktop starts method and device
CN106484593A (en) Log processing method, device and electronic equipment
CN106598488A (en) Distributed data reading method and device
CN106066770A (en) Memory space management and device
CN106598704A (en) Application program recovery method and apparatus
CN106528735A (en) Method and device for controlling browser to play media resources
CN104992088A (en) Device security protection method and apparatus
CN105704016A (en) Group message shielding processing method, device and terminal
CN106919334A (en) Application program access method and device
CN106547547A (en) Collecting method and device
CN105515923A (en) Equipment control method and device
CN105045686B (en) File access pattern method and device
CN107423378A (en) Image display method and device
CN105868624A (en) Application program authority management method and device
CN108319835A (en) User's space access control method, device, equipment and storage medium
CN107463419A (en) Using method for restarting, device and computer-readable recording medium
CN107239236A (en) Method for writing data and device
CN107329744A (en) The functional module of application program starts method and device
CN106598858A (en) Resource calling analysis method and resource calling analysis 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20161116