diff options
author | Jeremy Allison <jra@samba.org> | 2002-10-03 19:05:36 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-10-03 19:05:36 +0000 |
commit | 474340e4403648812e7d8eb9eeb4c4111afbf725 (patch) | |
tree | 67d0812bea41cd9ca55f8c91c70489f2272bb62f /source3 | |
parent | a4f7b7bec191c1603f004a14d5b8b49e99305f48 (diff) | |
download | samba-474340e4403648812e7d8eb9eeb4c4111afbf725.tar.gz samba-474340e4403648812e7d8eb9eeb4c4111afbf725.tar.bz2 samba-474340e4403648812e7d8eb9eeb4c4111afbf725.zip |
Added ASCII art to make this clearer.
Jeremy.
(This used to be commit 31c0dd7e213509c3bed1061f140f2ea9c6e95a9d)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/fileio.c | 74 |
1 files changed, 73 insertions, 1 deletions
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c index a29336d3a2..d5df9826df 100644 --- a/source3/smbd/fileio.c +++ b/source3/smbd/fileio.c @@ -256,6 +256,18 @@ nonop=%u allocated=%u active=%u direct=%u perfect=%u readhits=%u\n", if ((pos >= wcp->offset) && (pos <= wcp->offset + wcp->data_size)) { + /* ASCII art.... JRA. + + +--------------+----- + | Cached data | Rest of allocated cache buffer.... + +--------------+----- + + +-------------------+ + | Data to write | + +-------------------+ + + */ + /* * Start of write overlaps or abutts the existing data. */ @@ -305,6 +317,18 @@ nonop=%u allocated=%u active=%u direct=%u perfect=%u readhits=%u\n", } else if ((pos < wcp->offset) && (pos + n > wcp->offset) && (pos + n <= wcp->offset + wcp->alloc_size)) { + /* ASCII art.... JRA. + + +---------------+ + | Cache buffer | + +---------------+ + + +-------------------+ + | Data to write | + +-------------------+ + + */ + /* * End of write overlaps the existing data. */ @@ -350,6 +374,20 @@ nonop=%u allocated=%u active=%u direct=%u perfect=%u readhits=%u\n", (pos > wcp->offset + wcp->data_size) && (pos < wcp->offset + wcp->alloc_size) ) { + /* ASCII art.... JRA. + + End of file ---->| + + +---------------+---------------+ + | Cached data | Cache buffer | + +---------------+---------------+ + + +-------------------+ + | Data to write | + +-------------------+ + + */ + /* * Non-contiguous write part of which fits within * the cache buffer and is extending the file @@ -413,7 +451,41 @@ nonop=%u allocated=%u active=%u direct=%u perfect=%u readhits=%u\n", } else { - /* + /* ASCII art..... JRA. + + Case 1). + + +---------------+---------------+ + | Cached data | Cache buffer | + +---------------+---------------+ + + +-------------------+ + | Data to write | + +-------------------+ + + Case 2). + + +---------------+---------------+ + | Cached data | Cache buffer | + +---------------+---------------+ + + +-------------------+ + | Data to write | + +-------------------+ + + Case 3). + + +---------------+---------------+ + | Cached data | Cache buffer | + +---------------+---------------+ + + +-----------------------------------------------------+ + | Data to write | + +-----------------------------------------------------+ + + */ + + /* * Write is bigger than buffer, or there is no overlap on the * low or high ends. */ |