Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

common/cgroup: add mountFsRO() helper function #2829

Merged
merged 1 commit into from
Jun 24, 2016
Merged

common/cgroup: add mountFsRO() helper function #2829

merged 1 commit into from
Jun 24, 2016

Conversation

0xAX
Copy link
Contributor

@0xAX 0xAX commented Jun 22, 2016

There are some places in the common/cgroup/cgroup.go which contain the same
code which collects flags to mount a filesystem in read-only mode and calls
mount system call with the given flags and a filesystem source/target.

This patch adds mountFsRO() helper function to prevent code duplication.

Signed-off-by: Alexander Kuleshov kuleshovmail@gmail.com


func mountFsRO(mountPoint string) error {
var flags uintptr

flags = syscall.MS_BIND |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just collapse this into the declaration on line 404

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonboulle Thank you for feedback, will update tge pr soon

@jonboulle jonboulle added this to the v1.10.0 milestone Jun 23, 2016
@jonboulle
Copy link
Contributor

thanks! one small comment but lgtm after that

There are some places in the common/cgroup/cgroup.go which contain the same
code which collects flags to mount a filesystem in read-only mode and calls
mount system call with the given flags and a filesystem source/target.

This patch adds mountFsRO() helper function to prevent code duplication.

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
@0xAX
Copy link
Contributor Author

0xAX commented Jun 23, 2016

@jonboulle updated

@jonboulle
Copy link
Contributor

LGTM but as there's a release going on today let's hold off on merging until after that

@ghost
Copy link

ghost commented Jun 24, 2016

Can one of the admins verify this patch?

@lucab
Copy link
Member

lucab commented Jun 24, 2016

ok to test

@lucab lucab merged commit 9249220 into rkt:master Jun 24, 2016
@0xAX 0xAX deleted the cgroup-remount-helper branch August 2, 2016 09:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants