Avoid unnecessary lseek() calls by cleanups in md.c. mdfd_lstbcnt was
authorTom Lane <[email protected]>
Thu, 10 May 2001 20:38:49 +0000 (20:38 +0000)
committerTom Lane <[email protected]>
Thu, 10 May 2001 20:38:49 +0000 (20:38 +0000)
commit642107d5baa06c21bc9d9a937e4710008e4826a9
tree2d4cef5702ca144fb89c0e131b3fcbb598a9f3dc
parenta26ad8a643d4ae44be16a773e19f7ae32df048ac
Avoid unnecessary lseek() calls by cleanups in md.c.  mdfd_lstbcnt was
not being consulted anywhere, so remove it and remove the _mdnblocks()
calls that were used to set it.  Change smgrextend interface to pass in
the target block number (ie, current file length) --- the caller always
knows this already, having already done smgrnblocks(), so it's silly to
do it over again inside mdextend.  Net result: extension of a file now
takes one lseek(SEEK_END) and a write(), not three lseeks and a write.
src/backend/commands/sequence.c
src/backend/storage/buffer/bufmgr.c
src/backend/storage/smgr/md.c
src/backend/storage/smgr/mm.c
src/backend/storage/smgr/smgr.c
src/include/storage/smgr.h