block.c (7e0019a7196ebed177c95824875cf852e1a6f667) | block.c (e24d813b29d3a478a9309078487efc8ce8599f22) |
---|---|
1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 3996 unchanged lines hidden (view full) --- 4005 return bdi.unallocated_blocks_are_zero; 4006 } 4007 4008 return false; 4009} 4010 4011bool bdrv_can_write_zeroes_with_unmap(BlockDriverState *bs) 4012{ | 1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 3996 unchanged lines hidden (view full) --- 4005 return bdi.unallocated_blocks_are_zero; 4006 } 4007 4008 return false; 4009} 4010 4011bool bdrv_can_write_zeroes_with_unmap(BlockDriverState *bs) 4012{ |
4013 BlockDriverInfo bdi; 4014 | |
4015 if (!(bs->open_flags & BDRV_O_UNMAP)) { 4016 return false; 4017 } 4018 | 4013 if (!(bs->open_flags & BDRV_O_UNMAP)) { 4014 return false; 4015 } 4016 |
4019 if (bdrv_get_info(bs, &bdi) == 0) { 4020 return bdi.can_write_zeroes_with_unmap; 4021 } 4022 4023 return false; | 4017 return bs->supported_zero_flags & BDRV_REQ_MAY_UNMAP; |
4024} 4025 4026const char *bdrv_get_encrypted_filename(BlockDriverState *bs) 4027{ 4028 if (bs->backing && bs->backing->bs->encrypted) 4029 return bs->backing_file; 4030 else if (bs->encrypted) 4031 return bs->filename; --- 1157 unchanged lines hidden --- | 4018} 4019 4020const char *bdrv_get_encrypted_filename(BlockDriverState *bs) 4021{ 4022 if (bs->backing && bs->backing->bs->encrypted) 4023 return bs->backing_file; 4024 else if (bs->encrypted) 4025 return bs->filename; --- 1157 unchanged lines hidden --- |