summaryrefslogtreecommitdiff
path: root/fs/ceph/dir.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-05-14 13:06:30 -0700
committerSage Weil <sage@newdream.net>2010-05-17 15:25:41 -0700
commit23804d91f112df09b832cd091b71af4dc2831aa8 (patch)
tree4b77c43b47d58f08ab02220c507dabfc8f6daf7a /fs/ceph/dir.c
parent366837706bae00abc2edd75add2579c1be18b2b8 (diff)
downloadlinux-3.10-23804d91f112df09b832cd091b71af4dc2831aa8.tar.gz
linux-3.10-23804d91f112df09b832cd091b71af4dc2831aa8.tar.bz2
linux-3.10-23804d91f112df09b832cd091b71af4dc2831aa8.zip
ceph: specify max_bytes on readdir replies
Specify max bytes in request to bound size of reply. Add associated mount option with default value of 512 KB. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/dir.c')
-rw-r--r--fs/ceph/dir.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index d3bb8132a1a..4fd30900eff 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -233,6 +233,7 @@ static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir)
u32 ftype;
struct ceph_mds_reply_info_parsed *rinfo;
const int max_entries = client->mount_args->max_readdir;
+ const int max_bytes = client->mount_args->max_readdir_bytes;
dout("readdir %p filp %p frag %u off %u\n", inode, filp, frag, off);
if (fi->at_end)
@@ -316,6 +317,7 @@ more:
req->r_readdir_offset = fi->next_offset;
req->r_args.readdir.frag = cpu_to_le32(frag);
req->r_args.readdir.max_entries = cpu_to_le32(max_entries);
+ req->r_args.readdir.max_bytes = cpu_to_le32(max_bytes);
req->r_num_caps = max_entries + 1;
err = ceph_mdsc_do_request(mdsc, NULL, req);
if (err < 0) {