summaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2013-02-09 15:23:03 -0500
committerTheodore Ts'o <tytso@mit.edu>2013-02-09 15:23:03 -0500
commit95eaefbdececae5e781d76d03fe7472a857c8c7a (patch)
treeabe337e1490ded4166cf4d26f97cd1fe856a84ab /fs/ext4/ext4.h
parent64044abf05d0842a7fed30e102fa411a744c7d9f (diff)
ext4: fix the number of credits needed for acl ops with inline data
Operations which modify extended attributes may need extra journal credits if inline data is used, since there is a chance that some extended attributes may need to get pushed to an external attribute block. Changes to reflect this was made in xattr.c, but they were missed in fs/ext4/acl.c. To fix this, abstract the calculation of the number of credits needed for xattr operations to an inline function defined in ext4_jbd2.h, and use it in acl.c and xattr.c. Also move the function declarations used in inline.c from xattr.h (where they are non-obviously hidden, and caused problems since ext4_jbd2.h needs to use the function ext4_has_inline_data), and move them to ext4.h. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Tao Ma <boyu.mt@taobao.com> Reviewed-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r--fs/ext4/ext4.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index a5ae87c51401..61ecf059f70c 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2456,6 +2456,75 @@ extern const struct file_operations ext4_file_operations;
2456extern loff_t ext4_llseek(struct file *file, loff_t offset, int origin); 2456extern loff_t ext4_llseek(struct file *file, loff_t offset, int origin);
2457extern void ext4_unwritten_wait(struct inode *inode); 2457extern void ext4_unwritten_wait(struct inode *inode);
2458 2458
2459/* inline.c */
2460extern int ext4_has_inline_data(struct inode *inode);
2461extern int ext4_get_inline_size(struct inode *inode);
2462extern int ext4_get_max_inline_size(struct inode *inode);
2463extern int ext4_find_inline_data_nolock(struct inode *inode);
2464extern void ext4_write_inline_data(struct inode *inode,
2465 struct ext4_iloc *iloc,
2466 void *buffer, loff_t pos,
2467 unsigned int len);
2468extern int ext4_prepare_inline_data(handle_t *handle, struct inode *inode,
2469 unsigned int len);
2470extern int ext4_init_inline_data(handle_t *handle, struct inode *inode,
2471 unsigned int len);
2472extern int ext4_destroy_inline_data(handle_t *handle, struct inode *inode);
2473
2474extern int ext4_readpage_inline(struct inode *inode, struct page *page);
2475extern int ext4_try_to_write_inline_data(struct address_space *mapping,
2476 struct inode *inode,
2477 loff_t pos, unsigned len,
2478 unsigned flags,
2479 struct page **pagep);
2480extern int ext4_write_inline_data_end(struct inode *inode,
2481 loff_t pos, unsigned len,
2482 unsigned copied,
2483 struct page *page);
2484extern struct buffer_head *
2485ext4_journalled_write_inline_data(struct inode *inode,
2486 unsigned len,
2487 struct page *page);
2488extern int ext4_da_write_inline_data_begin(struct address_space *mapping,
2489 struct inode *inode,
2490 loff_t pos, unsigned len,
2491 unsigned flags,
2492 struct page **pagep,
2493 void **fsdata);
2494extern int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos,
2495 unsigned len, unsigned copied,
2496 struct page *page);
2497extern int ext4_try_add_inline_entry(handle_t *handle, struct dentry *dentry,
2498 struct inode *inode);
2499extern int ext4_try_create_inline_dir(handle_t *handle,
2500 struct inode *parent,
2501 struct inode *inode);
2502extern int ext4_read_inline_dir(struct file *filp,
2503 void *dirent, filldir_t filldir,
2504 int *has_inline_data);
2505extern struct buffer_head *ext4_find_inline_entry(struct inode *dir,
2506 const struct qstr *d_name,
2507 struct ext4_dir_entry_2 **res_dir,
2508 int *has_inline_data);
2509extern int ext4_delete_inline_entry(handle_t *handle,
2510 struct inode *dir,
2511 struct ext4_dir_entry_2 *de_del,
2512 struct buffer_head *bh,
2513 int *has_inline_data);
2514extern int empty_inline_dir(struct inode *dir, int *has_inline_data);
2515extern struct buffer_head *ext4_get_first_inline_block(struct inode *inode,
2516 struct ext4_dir_entry_2 **parent_de,
2517 int *retval);
2518extern int ext4_inline_data_fiemap(struct inode *inode,
2519 struct fiemap_extent_info *fieinfo,
2520 int *has_inline);
2521extern int ext4_try_to_evict_inline_data(handle_t *handle,
2522 struct inode *inode,
2523 int needed);
2524extern void ext4_inline_data_truncate(struct inode *inode, int *has_inline);
2525
2526extern int ext4_convert_inline_data(struct inode *inode);
2527
2459/* namei.c */ 2528/* namei.c */
2460extern const struct inode_operations ext4_dir_inode_operations; 2529extern const struct inode_operations ext4_dir_inode_operations;
2461extern const struct inode_operations ext4_special_inode_operations; 2530extern const struct inode_operations ext4_special_inode_operations;