aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/super.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-05-14 16:06:30 -0400
committerSage Weil <sage@newdream.net>2010-05-17 18:25:41 -0400
commit23804d91f112df09b832cd091b71af4dc2831aa8 (patch)
tree4b77c43b47d58f08ab02220c507dabfc8f6daf7a /fs/ceph/super.c
parent366837706bae00abc2edd75add2579c1be18b2b8 (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/super.c')
-rw-r--r--fs/ceph/super.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 7f5b20dc4945..bac13898b943 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -190,6 +190,8 @@ static int ceph_show_options(struct seq_file *m, struct vfsmount *mnt)
190 args->cap_release_safety); 190 args->cap_release_safety);
191 if (args->max_readdir != CEPH_MAX_READDIR_DEFAULT) 191 if (args->max_readdir != CEPH_MAX_READDIR_DEFAULT)
192 seq_printf(m, ",readdir_max_entries=%d", args->max_readdir); 192 seq_printf(m, ",readdir_max_entries=%d", args->max_readdir);
193 if (args->max_readdir_bytes != CEPH_MAX_READDIR_BYTES_DEFAULT)
194 seq_printf(m, ",readdir_max_bytes=%d", args->max_readdir_bytes);
193 if (strcmp(args->snapdir_name, CEPH_SNAPDIRNAME_DEFAULT)) 195 if (strcmp(args->snapdir_name, CEPH_SNAPDIRNAME_DEFAULT))
194 seq_printf(m, ",snapdirname=%s", args->snapdir_name); 196 seq_printf(m, ",snapdirname=%s", args->snapdir_name);
195 if (args->name) 197 if (args->name)
@@ -333,6 +335,7 @@ enum {
333 Opt_caps_wanted_delay_max, 335 Opt_caps_wanted_delay_max,
334 Opt_cap_release_safety, 336 Opt_cap_release_safety,
335 Opt_readdir_max_entries, 337 Opt_readdir_max_entries,
338 Opt_readdir_max_bytes,
336 Opt_congestion_kb, 339 Opt_congestion_kb,
337 Opt_last_int, 340 Opt_last_int,
338 /* int args above */ 341 /* int args above */
@@ -365,6 +368,7 @@ static match_table_t arg_tokens = {
365 {Opt_caps_wanted_delay_max, "caps_wanted_delay_max=%d"}, 368 {Opt_caps_wanted_delay_max, "caps_wanted_delay_max=%d"},
366 {Opt_cap_release_safety, "cap_release_safety=%d"}, 369 {Opt_cap_release_safety, "cap_release_safety=%d"},
367 {Opt_readdir_max_entries, "readdir_max_entries=%d"}, 370 {Opt_readdir_max_entries, "readdir_max_entries=%d"},
371 {Opt_readdir_max_bytes, "readdir_max_bytes=%d"},
368 {Opt_congestion_kb, "write_congestion_kb=%d"}, 372 {Opt_congestion_kb, "write_congestion_kb=%d"},
369 /* int args above */ 373 /* int args above */
370 {Opt_snapdirname, "snapdirname=%s"}, 374 {Opt_snapdirname, "snapdirname=%s"},
@@ -415,6 +419,7 @@ static struct ceph_mount_args *parse_mount_args(int flags, char *options,
415 args->snapdir_name = kstrdup(CEPH_SNAPDIRNAME_DEFAULT, GFP_KERNEL); 419 args->snapdir_name = kstrdup(CEPH_SNAPDIRNAME_DEFAULT, GFP_KERNEL);
416 args->cap_release_safety = CEPH_CAP_RELEASE_SAFETY_DEFAULT; 420 args->cap_release_safety = CEPH_CAP_RELEASE_SAFETY_DEFAULT;
417 args->max_readdir = CEPH_MAX_READDIR_DEFAULT; 421 args->max_readdir = CEPH_MAX_READDIR_DEFAULT;
422 args->max_readdir_bytes = CEPH_MAX_READDIR_BYTES_DEFAULT;
418 args->congestion_kb = default_congestion_kb(); 423 args->congestion_kb = default_congestion_kb();
419 424
420 /* ip1[:port1][,ip2[:port2]...]:/subdir/in/fs */ 425 /* ip1[:port1][,ip2[:port2]...]:/subdir/in/fs */
@@ -522,6 +527,9 @@ static struct ceph_mount_args *parse_mount_args(int flags, char *options,
522 case Opt_readdir_max_entries: 527 case Opt_readdir_max_entries:
523 args->max_readdir = intval; 528 args->max_readdir = intval;
524 break; 529 break;
530 case Opt_readdir_max_bytes:
531 args->max_readdir_bytes = intval;
532 break;
525 case Opt_congestion_kb: 533 case Opt_congestion_kb:
526 args->congestion_kb = intval; 534 args->congestion_kb = intval;
527 break; 535 break;