Systems and methods for generating snapshots based on file inputs and outputs
The present disclosure includes methods and systems for processing a file input/output (I/O). A method may include beginning, by a processor, copy-on-write snapshotting for a file stored in electronic storage; establishing, by the processor, a scope of authorization within a first layer using a first authorization callback function; determining, by the processor, if a read file that is being tracked is being opened for modification; and if the read file that is being tracked is not being opened for modification, ending the copy-on-write snapshotting, or if the read file that is being tracked is being opened for modification, marking the file as a subject of the copy-on-write snapshotting and then ending the copy-on-write snapshotting.
1 . A computer-implemented method for processing a file input/output (I/O), comprising:
beginning, by a processor, copy-on-write snapshotting for a file stored on a shared network resource, and wherein the copy-on-write snapshotting is performed on file intercept callbacks, including write, set attribute file truncating, and page-out;
establishing, by the processor, a scope of authorization within a first layer using a first authorization callback function;
determining, by the processor, if a read file that is being tracked is being opened for modification; and
if the read file that is being tracked is not being opened for modification, ending the copy-on-write snapshotting, or
if the read file that is being tracked is being opened for modification, marking the file as a subject of the copy-on-write snapshotting and then ending the copy-on-write snapshotting.
2 . The computer-implemented method of claim 1 , wherein the first layer is a virtual file system layer.
3 . The computer-implemented method of claim 2 , wherein the first authorization callback function is a KAUTH callback function.
4 . The computer-implemented method of claim 3 , further comprising:
intercepting, by the processor, calls to open the file.
5 . A system for processing a file input/output (I/O), comprising:
one or more memories;
at least one hardware processor coupled with the one or more memories and configured, individually or in combination, to:
begin copy-on-write snapshotting for a file stored on a shared network resource, and wherein the copy-on-write snapshotting is performed on file intercept callbacks, including write, set attribute file truncating, and page-out;
establish a scope of authorization within a first layer using a first authorization callback function;
determine if a read file that is being tracked is being opened for modification; and
if the read file that is being tracked is not being opened for modification, end the copy-on-write snapshotting, or
if the read file that is being tracked is being opened for modification, mark the file as a subject of the copy-on-write snapshotting and then end the copy-on-write snapshotting.
6 . The system of claim 5 , wherein the first layer is a virtual file system layer.
7 . The system of claim 6 , wherein the first authorization callback function is a KAUTH callback function.
8 . The system of claim 7 , further comprising:
intercept, by the at least one hardware processor, calls to open the file.
9 . A non-transitory computer readable medium storing thereon computer executable instructions for processing a file input/output (I/O), including instructions that when executed by at least one hardware processor of a computer cause the at least one hardware processor to perform steps including:
beginning copy-on-write snapshotting for a file stored on a shared network resource, and wherein the copy-on-write snapshotting is performed on file intercept callbacks, including write, set attribute file truncating, and page-out;
establishing a scope of authorization within a first layer using a first authorization callback function;
determining if a read file that is being tracked is being opened for modification; and
if the read file that is being tracked is not being opened for modification, ending the copy-on-write snapshotting, or
if the read file that is being tracked is being opened for modification, marking the file as a subject of the copy-on-write snapshotting and then ending the copy-on-write snapshotting.
10 . The non-transitory computer readable medium of claim 9 , wherein the first layer is a virtual file system layer.
11 . The non-transitory computer readable medium of claim 10 , wherein the first authorization callback function is a KAUTH callback function.
12 . The non-transitory computer readable medium of claim 11 , further comprising:
intercepting calls to open the file.