mirror of
https://github.com/ceph/ceph
synced 2024-12-17 00:46:05 +00:00
minor cap bit handling fixes. should tide us over until there's time for a more thorough code review.
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1113 29311d96-e01e-0410-9327-a35deaab8ce9
This commit is contained in:
parent
ecd44c704f
commit
d8814bda4f
@ -949,6 +949,7 @@ void Client::release_caps(Inode *in,
|
||||
dout(5) << "releasing caps on ino " << in->inode.ino << dec
|
||||
<< " had " << cap_string(in->file_caps())
|
||||
<< " retaining " << cap_string(retain)
|
||||
<< " want " << cap_string(in->file_caps_wanted())
|
||||
<< endl;
|
||||
|
||||
for (map<int,InodeCap>::iterator it = in->caps.begin();
|
||||
@ -2119,13 +2120,15 @@ int Client::open(const char *relpath, int flags)
|
||||
void Client::close_release(Inode *in)
|
||||
{
|
||||
dout(10) << "close_release on " << in->ino() << endl;
|
||||
dout(10) << " wr " << in->num_open_wr << " rd " << in->num_open_rd
|
||||
<< " dirty " << in->fc.is_dirty() << " cached " << in->fc.is_cached() << endl;
|
||||
|
||||
if (!in->num_open_rd)
|
||||
in->fc.release_clean();
|
||||
|
||||
int retain = 0;
|
||||
if (in->num_open_wr || in->fc.is_dirty()) retain |= CAP_FILE_WR | CAP_FILE_WRBUFFER;
|
||||
if (in->num_open_rd || in->fc.is_cached()) retain |= CAP_FILE_WR | CAP_FILE_WRBUFFER;
|
||||
if (in->num_open_wr || in->fc.is_dirty()) retain |= CAP_FILE_WR | CAP_FILE_WRBUFFER | CAP_FILE_WREXTEND;
|
||||
if (in->num_open_rd || in->fc.is_cached()) retain |= CAP_FILE_RD | CAP_FILE_RDCACHE;
|
||||
|
||||
release_caps(in, retain); // release caps now.
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ void FileCache::check_caps()
|
||||
// check callbacks
|
||||
map<int, list<Context*> >::iterator p = caps_callbacks.begin();
|
||||
while (p != caps_callbacks.end()) {
|
||||
if (used == 0 || (~(p->first) & used)) {
|
||||
if (used == 0 || (~(p->first) & used) == 0) {
|
||||
// implemented.
|
||||
dout(10) << "used is " << cap_string(used)
|
||||
<< ", caps " << cap_string(p->first) << " implemented, doing callback(s)" << endl;
|
||||
|
Loading…
Reference in New Issue
Block a user