shmem.c (860f2759d94bf9db637d85d75d074de88af54688) | shmem.c (5f00110f7273f9ff04ac69a5f85bb535a4fd0987) |
---|---|
1/* 2 * Resizable virtual memory filesystem for Linux. 3 * 4 * Copyright (C) 2000 Linus Torvalds. 5 * 2000 Transmeta Corp. 6 * 2000-2001 Christoph Rohland 7 * 2000-2001 SAP AG 8 * 2002 Red Hat Inc. --- 2472 unchanged lines hidden (view full) --- 2481 2482static int shmem_remount_fs(struct super_block *sb, int *flags, char *data) 2483{ 2484 struct shmem_sb_info *sbinfo = SHMEM_SB(sb); 2485 struct shmem_sb_info config = *sbinfo; 2486 unsigned long inodes; 2487 int error = -EINVAL; 2488 | 1/* 2 * Resizable virtual memory filesystem for Linux. 3 * 4 * Copyright (C) 2000 Linus Torvalds. 5 * 2000 Transmeta Corp. 6 * 2000-2001 Christoph Rohland 7 * 2000-2001 SAP AG 8 * 2002 Red Hat Inc. --- 2472 unchanged lines hidden (view full) --- 2481 2482static int shmem_remount_fs(struct super_block *sb, int *flags, char *data) 2483{ 2484 struct shmem_sb_info *sbinfo = SHMEM_SB(sb); 2485 struct shmem_sb_info config = *sbinfo; 2486 unsigned long inodes; 2487 int error = -EINVAL; 2488 |
2489 config.mpol = NULL; |
|
2489 if (shmem_parse_options(data, &config, true)) 2490 return error; 2491 2492 spin_lock(&sbinfo->stat_lock); 2493 inodes = sbinfo->max_inodes - sbinfo->free_inodes; 2494 if (percpu_counter_compare(&sbinfo->used_blocks, config.max_blocks) > 0) 2495 goto out; 2496 if (config.max_inodes < inodes) --- 8 unchanged lines hidden (view full) --- 2505 if (config.max_inodes && !sbinfo->max_inodes) 2506 goto out; 2507 2508 error = 0; 2509 sbinfo->max_blocks = config.max_blocks; 2510 sbinfo->max_inodes = config.max_inodes; 2511 sbinfo->free_inodes = config.max_inodes - inodes; 2512 | 2490 if (shmem_parse_options(data, &config, true)) 2491 return error; 2492 2493 spin_lock(&sbinfo->stat_lock); 2494 inodes = sbinfo->max_inodes - sbinfo->free_inodes; 2495 if (percpu_counter_compare(&sbinfo->used_blocks, config.max_blocks) > 0) 2496 goto out; 2497 if (config.max_inodes < inodes) --- 8 unchanged lines hidden (view full) --- 2506 if (config.max_inodes && !sbinfo->max_inodes) 2507 goto out; 2508 2509 error = 0; 2510 sbinfo->max_blocks = config.max_blocks; 2511 sbinfo->max_inodes = config.max_inodes; 2512 sbinfo->free_inodes = config.max_inodes - inodes; 2513 |
2513 mpol_put(sbinfo->mpol); 2514 sbinfo->mpol = config.mpol; /* transfers initial ref */ | 2514 /* 2515 * Preserve previous mempolicy unless mpol remount option was specified. 2516 */ 2517 if (config.mpol) { 2518 mpol_put(sbinfo->mpol); 2519 sbinfo->mpol = config.mpol; /* transfers initial ref */ 2520 } |
2515out: 2516 spin_unlock(&sbinfo->stat_lock); 2517 return error; 2518} 2519 2520static int shmem_show_options(struct seq_file *seq, struct dentry *root) 2521{ 2522 struct shmem_sb_info *sbinfo = SHMEM_SB(root->d_sb); --- 466 unchanged lines hidden --- | 2521out: 2522 spin_unlock(&sbinfo->stat_lock); 2523 return error; 2524} 2525 2526static int shmem_show_options(struct seq_file *seq, struct dentry *root) 2527{ 2528 struct shmem_sb_info *sbinfo = SHMEM_SB(root->d_sb); --- 466 unchanged lines hidden --- |