主权项 |
1. A method, comprising:
receiving, by a processing device that executes a server in a network file system, a first file access request from a client in the network file system for accessing a file in the network file system, wherein the first file access request comprises a file handle for the file, and wherein the file handle comprises a unique identifier for the file; in response to receiving the first file access request, creating and assigning, by the server, a simulated file descriptor to the file without issuing a file open request to an operating system to open the file to create an actual file descriptor, wherein the simulated file descriptor is not provided by a kernel of the operating system; associating, by the server, the simulated file descriptor with the file handle; in response to receiving a second file access request comprising the simulated file descriptor:
identifying the file handle associated with the simulated file descriptor in view of the simulated file descriptor in the second file access request and associated with the file handle;identifying a path to the file in view of the identified file handle, wherein identifying the path comprises at least one of identifying a hard link associated with the file or identifying the path in a database that stores mapping data that maps the path to the file handle; andopening the file in view of the identified path. |