Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libct/cg: mv fscommon.{Open,Read,Write}File to cgroups #3024

Merged
merged 2 commits into from
Jun 14, 2021

Conversation

kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Jun 11, 2021

This is a better place as cgroups itself is using these.
Should help with moving more stuff common in between fs and fs2 to
fscommon. For example, it should help #2883 to have RDMA code
common between fs and fs2 in fscommon (see discussion at
#2883 (comment))

Looks big, but this is just moving the implementation of fscommon.{Open,Read,Write}File
and its test case to cgroups pkg:

fscommon/{fscommon,open}.go -> cgroups/file.go
fscommon/fscommon_test.go   -> cgroups/file_test.go

There's no functional change.

Signed-off-by: Kir Kolyshkin [email protected]

@kolyshkin
Copy link
Contributor Author

From one thing, this is a public API that we'd rather not change after 1.0, so it's better to change in before, and there is no functional change here, so it's relatively safe to merge.

OTOH I don't like moving things around right before a release.

@kolyshkin
Copy link
Contributor Author

Found two existing users of the functionality that is being moved:

So I think we should do the change before 1.0 and I will help these two packages to adopt accordingly.

@kolyshkin kolyshkin added this to the 1.0.0 milestone Jun 13, 2021
@kolyshkin kolyshkin marked this pull request as draft June 13, 2021 19:32
@kolyshkin
Copy link
Contributor Author

(split into two commits; testing the first one thus draft for now)

This is a better place as cgroups itself is using these.
Should help with moving more stuff common in between fs and fs2 to
fscommon.

Looks big, but this is just moving the code around:

 fscommon/{fscommon,open}.go -> cgroups/file.go
 fscommon/fscommon_test.go   -> cgroups/file_test.go

and fixes for TestMode moved to a different package.

There's no functional change.

Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin
Copy link
Contributor Author

So I think we should do the change before 1.0 and I will help these two packages to adopt accordingly.

Yet better, I have added the backward-compatible aliases and marked them as deprecated, so there's no breakage plus a hint from a linter to switch to new names.

@kolyshkin
Copy link
Contributor Author

Yet better, I have added the backward-compatible aliases and marked them as deprecated, so there's no breakage plus a hint from a linter to switch to new names.

OTOH that means we don't have to change before 1.0, although it's still better to do it before.

... and switch to using the ones from cgroups.

Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin kolyshkin marked this pull request as ready for review June 14, 2021 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/refactor refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants