mirror of
https://github.com/ceph/ceph
synced 2025-01-18 17:12:29 +00:00
*** empty log message ***
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@178 29311d96-e01e-0410-9327-a35deaab8ce9
This commit is contained in:
parent
cde8de24f6
commit
de8f631470
@ -260,7 +260,7 @@ int Client::utime(const char *path, struct utimbuf *buf)
|
||||
|
||||
// fyi: typedef int (*dirfillerfunc_t) (void *handle, const char *name, int type, inodeno_t ino);
|
||||
|
||||
int Client::getdir(const char *path, void *fill_handle, dirfillerfunc_t fill_func)
|
||||
int Client::getdir(const char *path, map<string,inode_t*> contents)
|
||||
{
|
||||
|
||||
// ...
|
||||
@ -268,8 +268,9 @@ int Client::getdir(const char *path, void *fill_handle, dirfillerfunc_t fill_fun
|
||||
|
||||
// return contents to caller
|
||||
/*
|
||||
while (...) {
|
||||
fill_func(fill_handle, dentryname, type, ino);
|
||||
for (...) {
|
||||
|
||||
contents[dentryname] = inodeptr; // ptr to inode_t in our cache
|
||||
}
|
||||
*/
|
||||
return res;
|
||||
|
@ -206,7 +206,7 @@ class Client : public Dispatcher {
|
||||
int statfs(const char *path, struct statfs *stbuf);
|
||||
|
||||
// namespace ops
|
||||
int getdir(const char *path, void *fill_handle, dirfillerfunc_t fill_func);
|
||||
int getdir(const char *path, map<string,inode_t*> contents);
|
||||
int link(const char *existing, const char *newname);
|
||||
int unlink(const char *path);
|
||||
int rename(const char *from, const char *to);
|
||||
|
@ -53,22 +53,23 @@ static int ceph_readlink(const char *path, char *buf, size_t size)
|
||||
|
||||
static int ceph_getdir(const char *path, fuse_dirh_t h, fuse_dirfil_t filler)
|
||||
{
|
||||
DIR *dp;
|
||||
struct dirent *de;
|
||||
int res = 0;
|
||||
map<string, inode_t*> contents;
|
||||
|
||||
dp = opendir(path);
|
||||
if(dp == NULL)
|
||||
return -errno;
|
||||
int res = client->readdir(path, contents);
|
||||
|
||||
if (res < 0) return res;
|
||||
|
||||
while((de = readdir(dp)) != NULL) {
|
||||
res = filler(h, de->d_name, de->d_type, de->d_ino);
|
||||
if(res != 0)
|
||||
break;
|
||||
}
|
||||
|
||||
closedir(dp);
|
||||
return res;
|
||||
// return contents to fuse via callback
|
||||
for (map<string, inodeno_t>::iterator it = contents.begin();
|
||||
it != contents.end();
|
||||
it++) {
|
||||
res = filler(h, // fuse's handle
|
||||
it->first.c_str(), // dentry as char*
|
||||
it->second->mode & INODE_TYPE_MASK, // mask type bits from mode
|
||||
it->second->ino); // ino. 64->32 bit issue? FIXME
|
||||
if (res != 0) break; // fuse has had enough
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static int ceph_mknod(const char *path, mode_t mode, dev_t rdev)
|
||||
|
@ -59,7 +59,7 @@ md_config_t g_conf = {
|
||||
client_op_mknod: 10,
|
||||
client_op_link: false,
|
||||
client_op_unlink: 10,
|
||||
client_op_rename: 00,
|
||||
client_op_rename: 100,
|
||||
|
||||
client_op_mkdir: 10,
|
||||
client_op_rmdir: 10,
|
||||
|
Loading…
Reference in New Issue
Block a user