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

Per directory Quota #66

Open
VRciF opened this issue Oct 30, 2013 · 1 comment
Open

Per directory Quota #66

VRciF opened this issue Oct 30, 2013 · 1 comment
Labels

Comments

@VRciF
Copy link

VRciF commented Oct 30, 2013

In one of my projects i'm aggregating a few mount points together so i'm able to scale disk operations beyond one partition - e.g. switch to another mountpoint if primary disk is full.
To test this i would create a directory structure which requires different quotas per virtual mount points.

With a bit guidance i could provide the code changes.
My modification would be to add setQuota($quotainstance) and getQuota() to vfsStreamAbstractContent whereas getQuota recursively searches its parent paths for a quota instance.
The method getQuota would then be used in vfsStreamWrapper methods stream_write and stream_truncate right before overall root-quota is used
and setQuota would get used in newDirectory by adding a new quota parameter in bytes.

@mikey179
Copy link
Member

mikey179 commented Nov 1, 2013

This would be an interesting feature, but implementing it the way you suggest would make the internals really complicated. Currently instances of vfsStreamContent just know their parent path, but for good reason don't have a reference to their parent which I don't want to change. I also don't want them to access the root directory to get their parent from there - this would create a tight coupling between things that shouldn't be coupled at all.

Having said that, I think to enable this feature it would be a good idea to introduce the concept of partitions to vfsStream. Quotas can then be bound to partitions, and vfsStreamWrapper could work with partitions, whereas vfsStreamContent could stay decoupled from the whole quota concept. I didn't think this through completely, but I guess this would introduce some major backward incompatible changes, so it could be an idea for version 2.

@mikey179 mikey179 removed this from the 2.0.0 milestone Jan 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants