Moving CrushWrapper::crush from public member to private

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi List,
       The CrushWrapper(https://github.com/ceph/ceph/blob/master/src/crush/CrushWrapper.cc) is a wrapper for crush so we can use such C++ wrapper instead of playing directly with crush C-API. 
       But currently, in CrushWrapper, the member   struct crush_map *crush  is a public member, so people can break the encapsulation and manipulate directly to the crush structure. I think this is not a good practice for encapsulation and will lead to inconsistent if code mix use the CrushWrapper API and crush C API, a simple example could be : if you use crush_add_rule(C-API) to add a rule, which will not set the have_rmap flag to false in CrushWrapper, then other code using CrushWrapper trying to look up the newly added rule by name will get a -ENOENT.
        So I am not sure why this member is public currently? And what's the impact if we wish to clean up and make it private? Any hard-to-fix dependency?

Thanks
                                                                                                                                                                                                                                                                                Xiaoxi
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux