diff options
author | Sage Weil <sage@newdream.net> | 2010-05-14 16:06:30 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-05-17 18:25:41 -0400 |
commit | 23804d91f112df09b832cd091b71af4dc2831aa8 (patch) | |
tree | 4b77c43b47d58f08ab02220c507dabfc8f6daf7a /fs/ceph/dir.c | |
parent | 366837706bae00abc2edd75add2579c1be18b2b8 (diff) |
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.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index d3bb8132a1aa..4fd30900eff7 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) | |||
233 | u32 ftype; | 233 | u32 ftype; |
234 | struct ceph_mds_reply_info_parsed *rinfo; | 234 | struct ceph_mds_reply_info_parsed *rinfo; |
235 | const int max_entries = client->mount_args->max_readdir; | 235 | const int max_entries = client->mount_args->max_readdir; |
236 | const int max_bytes = client->mount_args->max_readdir_bytes; | ||
236 | 237 | ||
237 | dout("readdir %p filp %p frag %u off %u\n", inode, filp, frag, off); | 238 | dout("readdir %p filp %p frag %u off %u\n", inode, filp, frag, off); |
238 | if (fi->at_end) | 239 | if (fi->at_end) |
@@ -316,6 +317,7 @@ more: | |||
316 | req->r_readdir_offset = fi->next_offset; | 317 | req->r_readdir_offset = fi->next_offset; |
317 | req->r_args.readdir.frag = cpu_to_le32(frag); | 318 | req->r_args.readdir.frag = cpu_to_le32(frag); |
318 | req->r_args.readdir.max_entries = cpu_to_le32(max_entries); | 319 | req->r_args.readdir.max_entries = cpu_to_le32(max_entries); |
320 | req->r_args.readdir.max_bytes = cpu_to_le32(max_bytes); | ||
319 | req->r_num_caps = max_entries + 1; | 321 | req->r_num_caps = max_entries + 1; |
320 | err = ceph_mdsc_do_request(mdsc, NULL, req); | 322 | err = ceph_mdsc_do_request(mdsc, NULL, req); |
321 | if (err < 0) { | 323 | if (err < 0) { |