summaryrefslogtreecommitdiffstats
path: root/fs/ceph/export.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-10-19 09:48:34 +1000
committerDave Airlie <airlied@redhat.com>2010-10-19 09:48:34 +1000
commitb7ae5056c94a8191c1fd0b5697707377516c0c5d (patch)
tree394f68003ea0bc2a0c24e510a7c5b13f479ce743 /fs/ceph/export.c
parent2126d0a4a205e2d6b763434f892524cd60f74228 (diff)
parent6a2a11dbea5db417d200d38dda53c30a2e5603e0 (diff)
downloadlinux-b7ae5056c94a8191c1fd0b5697707377516c0c5d.tar.gz
linux-b7ae5056c94a8191c1fd0b5697707377516c0c5d.tar.bz2
linux-b7ae5056c94a8191c1fd0b5697707377516c0c5d.zip
Merge branch 'drm-fixes' of /home/airlied/kernel/linux-2.6 into drm-core-next
Conflicts: drivers/gpu/drm/i915/intel_fb.c drivers/gpu/drm/radeon/r600_blit_kms.c drivers/gpu/drm/ttm/ttm_bo.c
Diffstat (limited to 'fs/ceph/export.c')
-rw-r--r--fs/ceph/export.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/fs/ceph/export.c b/fs/ceph/export.c
index 4480cb1c63e7..e38423e82f2e 100644
--- a/fs/ceph/export.c
+++ b/fs/ceph/export.c
@@ -42,32 +42,37 @@ struct ceph_nfs_confh {
static int ceph_encode_fh(struct dentry *dentry, u32 *rawfh, int *max_len,
int connectable)
{
+ int type;
struct ceph_nfs_fh *fh = (void *)rawfh;
struct ceph_nfs_confh *cfh = (void *)rawfh;
struct dentry *parent = dentry->d_parent;
struct inode *inode = dentry->d_inode;
- int type;
+ int connected_handle_length = sizeof(*cfh)/4;
+ int handle_length = sizeof(*fh)/4;
/* don't re-export snaps */
if (ceph_snap(inode) != CEPH_NOSNAP)
return -EINVAL;
- if (*max_len >= sizeof(*cfh)) {
+ if (*max_len >= connected_handle_length) {
dout("encode_fh %p connectable\n", dentry);
cfh->ino = ceph_ino(dentry->d_inode);
cfh->parent_ino = ceph_ino(parent->d_inode);
cfh->parent_name_hash = parent->d_name.hash;
- *max_len = sizeof(*cfh);
+ *max_len = connected_handle_length;
type = 2;
- } else if (*max_len > sizeof(*fh)) {
- if (connectable)
- return -ENOSPC;
+ } else if (*max_len >= handle_length) {
+ if (connectable) {
+ *max_len = connected_handle_length;
+ return 255;
+ }
dout("encode_fh %p\n", dentry);
fh->ino = ceph_ino(dentry->d_inode);
- *max_len = sizeof(*fh);
+ *max_len = handle_length;
type = 1;
} else {
- return -ENOSPC;
+ *max_len = handle_length;
+ return 255;
}
return type;
}