minor unix group tweaking

git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1308 29311d96-e01e-0410-9327-a35deaab8ce9
This commit is contained in:
anwleung 2007-03-27 19:06:25 +00:00
parent 088e5f0b26
commit f1c796857d
5 changed files with 15 additions and 11 deletions

View File

@ -1,4 +1,4 @@
1000 1000 3500 -1
100 3407 -1
1500 384 555 -1
1020 340 341 342 343 344 345 346 -1
1020 340 341 342 343 344 345 346 347 348 349 350 -1

View File

@ -249,7 +249,7 @@ ExtCap* Locker::issue_new_extcaps(CInode *in, int mode, MClientRequest *req) {
else
ext_cap = in->get_unix_world_cap();
}
if (g_conf.mds_group == 4) {
else if (g_conf.mds_group == 4) {
if (mds->predict_cap_cache[in->ino()].count(my_user) == 0)
ext_cap = 0;
else
@ -313,14 +313,14 @@ ExtCap* Locker::issue_new_extcaps(CInode *in, int mode, MClientRequest *req) {
else if (g_conf.mds_group == 4) {
// can we make any predictions?
if (mds->precompute_succ.count(in->ino()) != 0) {
cout << "Making a prediction in capability for " << in->ino() << endl;
//cout << "Making a prediction in capability for " << in->ino() << endl;
// add the hash
hash_t inode_hash = mds->precompute_succ[in->ino()];
ext_cap = new ExtCap(FILE_MODE_RW, my_user, my_group, inode_hash);
ext_cap->set_type(USER_BATCH);
}
else {
cout << "Can't make predictions for this cap for " << in->ino() << endl;
//cout << "Can't make predictions for this cap for " << in->ino() << endl;
ext_cap = new ExtCap(my_want, my_user, in->ino());
ext_cap->set_type(0);
}
@ -343,9 +343,11 @@ ExtCap* Locker::issue_new_extcaps(CInode *in, int mode, MClientRequest *req) {
// caches this capability in the inode
if (g_conf.mds_group == 1) {
if (my_user == in->get_uid())
if (my_user == in->get_uid()) {
in->set_unix_user_cap(ext_cap);
else if(my_user == in->get_gid())
in->set_unix_group_cap(ext_cap);
}
else if(my_group == in->get_gid())
in->set_unix_group_cap(ext_cap);
else
in->set_unix_world_cap(ext_cap);

View File

@ -167,14 +167,14 @@ MDS::MDS(int whoami, Messenger *m, MonMap *mm) : timer(mds_lock) {
inodeno_t prediction;
prediction = rp_predicter.predict_successor(mi->first);
cout << "Predictions for " << mi->first << ": ";
//cout << "Predictions for " << mi->first << ": ";
while(prediction != inodeno_t()) {
cout << prediction << ", ";
//cout << prediction << ", ";
inode_list.add_inode(prediction);
prediction = rp_predicter.predict_successor(prediction);
}
cout << "Cannot make any further predictions" << endl;
//cout << "Cannot make any further predictions" << endl;
// cache the list
if (inode_list.num_inodes() != 0) {

View File

@ -2495,7 +2495,7 @@ void Server::handle_client_open(MClientRequest *req,
utime_t sec_time_start = g_clock.now();
ext_cap = mds->locker->issue_new_extcaps(cur, mode, req);
utime_t sec_time_end = g_clock.now();
dout(1) << "Get security cap time " << sec_time_end - sec_time_start << endl;
dout(2) << "Get security cap time " << sec_time_end - sec_time_start << endl;
Capability *cap = mds->locker->issue_new_caps(cur, mode, req);
if (!cap) return; // can't issue (yet), so wait!
@ -2505,7 +2505,7 @@ void Server::handle_client_open(MClientRequest *req,
mds->balancer->hit_inode(cur, META_POP_IRD);
end_time = g_clock.now();
dout(1) << "Open() request latency " << end_time - start_time << endl;
dout(2) << "Open() request latency " << end_time - start_time << endl;
if (mds->logger) {
mds->logger->finc("lsum", (double) end_time - start_time);
mds->logger->inc("lnum");

View File

@ -21,6 +21,7 @@ for $file_handle(@files) {
@file_data = <FILE>;
my $line;
my @args;
my @unclosed_fds;
foreach $line (@file_data) {
my $timestamp;
@ -46,6 +47,7 @@ for $file_handle(@files) {
($op, $path, $rest) = split(/\"/, $op);
print OUT "open\n$path\n102\n$ret_val\n";
}
push @unclosed_fds;
}
elsif ($op =~ /close\(/) {
my $nothing;