libcephfs: return -ENOTCONN when call unmounted

Adds -ENOTCONN return value for stat, fchmod, fchown, lchown.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
This commit is contained in:
Noah Watkins 2013-01-07 15:47:38 -08:00
parent c41210934c
commit 5c58aa96e4

View File

@ -477,6 +477,8 @@ extern "C" int ceph_symlink(struct ceph_mount_info *cmount, const char *existing
extern "C" int ceph_stat(struct ceph_mount_info *cmount, const char *path,
struct stat *stbuf)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->stat(path, stbuf);
}
@ -562,6 +564,8 @@ extern "C" int ceph_chmod(struct ceph_mount_info *cmount, const char *path, mode
}
extern "C" int ceph_fchmod(struct ceph_mount_info *cmount, int fd, mode_t mode)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->fchmod(fd, mode);
}
extern "C" int ceph_chown(struct ceph_mount_info *cmount, const char *path,
@ -574,11 +578,15 @@ extern "C" int ceph_chown(struct ceph_mount_info *cmount, const char *path,
extern "C" int ceph_fchown(struct ceph_mount_info *cmount, int fd,
uid_t uid, gid_t gid)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->fchown(fd, uid, gid);
}
extern "C" int ceph_lchown(struct ceph_mount_info *cmount, const char *path,
uid_t uid, gid_t gid)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->lchown(path, uid, gid);
}