git: kernel - Work through some memory leaks in dsched

看板DFBSD_commit作者時間15年前 (2010/09/24 08:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
commit b5d7061d1ace7a0b0583af8ceae683dbd3e9bc81 Author: Matthew Dillon <dillon@apollo.backplane.com> Date: Thu Sep 23 17:15:07 2010 -0700 kernel - Work through some memory leaks in dsched * Add a uninitbufbio() function to complement initbufbio(). Also move BUF_LOCKINIT() into initbufbio() and BUF_LOCKFREE() into uninitbufbio(). * There are several device drivers and other places where the struct buf is still being allocated manually (verses using getpbuf()). These were kfree()ing the buffer without dealing with e.g. dsched_exit_buf(). Have uninitbufbio() call dsched_exit_buf() and adjust the various manual allocations/frees of struct buf to call uninitbufbio() before kfree()ing. Also remove various manual calls to BUF_LOCKFREE() (which is now done inside uninitbufbio()). * This should hopefully deal with the memory leaks but there could be a few left. Reported-by: "Steve O'Hara-Smith" <steve@sohara.org> Summary of changes: sys/dev/disk/ata/ata-raid.c | 25 +++++++++++++++++-------- sys/dev/disk/ccd/ccd.c | 3 +-- sys/dev/disk/nata/ata-raid.c | 4 ++-- sys/dev/raid/vinum/vinuminterrupt.c | 4 ++-- sys/dev/raid/vinum/vinumrequest.c | 8 +++----- sys/kern/kern_dsched.c | 2 +- sys/kern/vfs_bio.c | 16 ++++++++++++++-- sys/sys/buf.h | 1 + sys/vfs/devfs/devfs_vnops.c | 19 ++++++++++--------- 9 files changed, 51 insertions(+), 31 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b5d7061d1ace7a0b0583af8ceae683dbd3e9bc81 -- DragonFly BSD source repository
文章代碼(AID): #1Cc_67p_ (DFBSD_commit)