Rev | Line | |
---|
[4] | 1 | See man disparm for an explanation of the external specs of disparm. |
---|
| 2 | |
---|
| 3 | I is not easy to arrange in a nfs file system that only one process |
---|
| 4 | will change a file (the poolfile), and to ensure that this process |
---|
| 5 | gets the most up-to-date version of the file. |
---|
| 6 | |
---|
| 7 | In disparm this is accomplished by three steps: |
---|
| 8 | |
---|
| 9 | - create a lock directory. This is an atomic operation, if |
---|
| 10 | many processes are doing a 'mkdir' of the same directory, |
---|
| 11 | only one process can succeed. |
---|
| 12 | - create a hard link in that directory to the poolfile. |
---|
| 13 | If the link count of that link equals 2, it is considered |
---|
| 14 | successful, otherwize it is assumed that no exclusive |
---|
| 15 | access to the file is possible at this moment. |
---|
| 16 | - open de link with O_DIRECT, and read a block, to persuade the |
---|
| 17 | system to get the latest version of the file. |
---|
| 18 | |
---|
| 19 | If the lock cannot be obtained directly, it is tried some sconds later. |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | |
---|
Note: See
TracBrowser
for help on using the repository browser.