diff options
author | Vyacheslav Dubeyko <slava@dubeyko.com> | 2013-11-12 18:11:09 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 22:09:32 -0500 |
commit | 95e0d7dbb9b28ab0dfad7c7316066b05e1f1d4cd (patch) | |
tree | 09f42df8169a4fbf3e2f60cb1b36c1e83c8d9019 /fs/hfsplus/super.c | |
parent | 099e9245e04d50bb12ed621b4fa61df0a4c9dba9 (diff) |
hfsplus: implement attributes file creation functionality
Implement functionality of creation AttributesFile metadata file on HFS+
volume in the case of absence of it.
It makes trying to open AttributesFile's B-tree during mount of HFS+
volume. If HFS+ volume hasn't AttributesFile then a pointer on
AttributesFile's B-tree keeps as NULL. Thereby, when it is discovered
absence of AttributesFile on HFS+ volume in the begin of xattr creation
operation then AttributesFile will be created.
The creation of AttributesFile will have success in the case of
availability (2 * clump) free blocks on HFS+ volume. Otherwise,
creation operation is ended with error (-ENOSPC).
Signed-off-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@infradead.org>
Acked-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hfsplus/super.c')
-rw-r--r-- | fs/hfsplus/super.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index 4c4d142cf890..80875aa640ef 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c | |||
@@ -474,12 +474,14 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) | |||
474 | pr_err("failed to load catalog file\n"); | 474 | pr_err("failed to load catalog file\n"); |
475 | goto out_close_ext_tree; | 475 | goto out_close_ext_tree; |
476 | } | 476 | } |
477 | atomic_set(&sbi->attr_tree_state, HFSPLUS_EMPTY_ATTR_TREE); | ||
477 | if (vhdr->attr_file.total_blocks != 0) { | 478 | if (vhdr->attr_file.total_blocks != 0) { |
478 | sbi->attr_tree = hfs_btree_open(sb, HFSPLUS_ATTR_CNID); | 479 | sbi->attr_tree = hfs_btree_open(sb, HFSPLUS_ATTR_CNID); |
479 | if (!sbi->attr_tree) { | 480 | if (!sbi->attr_tree) { |
480 | pr_err("failed to load attributes file\n"); | 481 | pr_err("failed to load attributes file\n"); |
481 | goto out_close_cat_tree; | 482 | goto out_close_cat_tree; |
482 | } | 483 | } |
484 | atomic_set(&sbi->attr_tree_state, HFSPLUS_VALID_ATTR_TREE); | ||
483 | } | 485 | } |
484 | sb->s_xattr = hfsplus_xattr_handlers; | 486 | sb->s_xattr = hfsplus_xattr_handlers; |
485 | 487 | ||