block: Modify block module
1. Merge Block interface to BlockManager
- Before, deviced creates new object for every device node,
sends signal and receives dbus methods requests using Block interface.
It cause some timing issues.
- Now, block module will not creates new object for each node,
and only have BlockManager interface.
2. Check queue has unmount operation before mount
- If operation queue has unmount operation, then deviced doesn't need to mount device.
So, deviced dequeue operations before unmount operation.
3. Check operation is already done
- If operation is already done, deviced doesn't need to do it again.
4. Use specific number of thread
- Maximum number of thread is 5.
- If new block_device which use same devnode is inserted,
same thread which used before dealt with the new block_device.
- Each thread processes operation in the order of block_device is added to block_dev_list.
- After operation queue is empty from one block_device, thread processes operation for next block_device.
5. Add thread mutex and thread wait condition
- Add thread mutex for operation queue and op_len
- Remove block_device mutex (which was for operation queue)
- Wait when all operation queue of thread is empty (op_len == 0)
- Wakeup when first operation is added (op_len is changed to 1)
6. Make block_dev_list for each thread
- Use thread mutex for each block_dev_list of thread
- Dbus method calls should not get information about physically removed block device
7. Same device is dealt with the same thread
- All partitions from same device is dealt with the same thread
8. Remove BLOCK_DEV_DEQUEUE pipe command
Change-Id: Ia4064de11afafdcbeb9811cf4884978f22f27b25
Signed-off-by: pr.jung <pr.jung@samsung.com>