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

Add flush command to ipfs files #2196

Merged
merged 9 commits into from
Feb 9, 2016
Merged

Add flush command to ipfs files #2196

merged 9 commits into from
Feb 9, 2016

Conversation

whyrusleeping
Copy link
Member

No description provided.

}

// take the lock and defer the unlock
defer nd.Blockstore.PinLock()()
Copy link
Member

Choose a reason for hiding this comment

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

this notation is a bit hard to read and error prone. i think these may be better:

nd.Blockstore.PinLk.Lock()
defer nd.Blockstore.PinLk.Unlock()
// or
defer nd.Blockstore.PinLock().Unlock()

@jbenet
Copy link
Member

jbenet commented Jan 23, 2016

@whyrusleeping this looks good. is it safe ?

@whyrusleeping
Copy link
Member Author

@jbenet its too safe. I need to remove the pinning.

@jbenet
Copy link
Member

jbenet commented Jan 23, 2016

its too safe. I need to remove the pinning.

ahhaahah

@jbenet
Copy link
Member

jbenet commented Jan 23, 2016

@whyrusleeping
Copy link
Member Author

alright, this is ready. most of the review is needed on the last commit, i ripped the mfs file apart into an 'inode' type object, and a 'file descriptor' type object. This makes working with file things much easier, and i've been meaning to do it for a long time. Things should be a little more performant, way more threadsafe, the files api stuff shouldnt hang for @diasdavid, and fuse should be much happier in general.

@Kubuxu
Copy link
Member

Kubuxu commented Feb 4, 2016

From command info I can see that it causes changes not to be flushed to disk. Wouldn't it be better to call it --no-flush?

@whyrusleeping
Copy link
Member Author

@Kubuxu the default is that changes are flushed to disk. the existing --flush command defaults (when not specified) to true. If you want to not flush changes to disk, you specify --flush=false

@Kubuxu
Copy link
Member

Kubuxu commented Feb 4, 2016

Ahh, ok. Sorry for that.

@whyrusleeping
Copy link
Member Author

@Kubuxu no worries, must be a documentation issue, what can i change to make that more clear?

@Kubuxu
Copy link
Member

Kubuxu commented Feb 4, 2016

Just this wording is unfortunate. It suggests that just --flush is unsafe.

@whyrusleeping
Copy link
Member Author

@Kubuxu there, that seems a little less confusing to me

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
…them

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
@whyrusleeping
Copy link
Member Author

@RichardLitt adding 'ipfs files flush' in this PR.

whyrusleeping added a commit that referenced this pull request Feb 9, 2016
Add flush command to ipfs files
@whyrusleeping whyrusleeping merged commit 37258a2 into master Feb 9, 2016
@whyrusleeping whyrusleeping deleted the feat/mfs-flush-cmd branch February 9, 2016 00:10
@RichardLitt
Copy link
Member

Thanks @whyrusleeping. Noted in ipfs-inactive/http-api-spec#57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants