Skip to contentSkip to conversation

+ hfsplus-implement-attributes-file-creation-functionality.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Sep 25, 2013 Hfsplus filesystem

lore
Share & tools
lore
#0 lore raw

Subject: + hfsplus-implement-attributes-file-creation-functionality.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Wed, 25 Sep 2013 16:02:48 -0700

The patch titled
Subject: hfsplus: implement attributes file creation functionality
has been added to the -mm tree. Its filename is
hfsplus-implement-attributes-file-creation-functionality.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/hfsplus-implement-attributes-file-creation-functionality.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/hfsplus-implement-attributes-file-creation-functionality.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Vyacheslav Dubeyko <[email protected]>
Subject: 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).

---

 fs/hfsplus/hfsplus_fs.h |    9 ++
 fs/hfsplus/super.c      |    2 
 fs/hfsplus/xattr.c      |  128 +++++++++++++++++++++++++++++++++++++-
 3 files changed, 137 insertions(+), 2 deletions(-)
fs/hfsplus/hfsplus_fs.h renamed from fs/hfsplus/hfsplus_fs.h~hfsplus-implement-attributes-file-creation-functionality +9 -0
diff -puN fs/hfsplus/hfsplus_fs.h~hfsplus-implement-attributes-file-creation-functionality fs/hfsplus/hfsplus_fs.h
@@ -127,6 +127,14 @@ struct hfs_bnode {
 #define HFS_BNODE_DELETED	4
 
 /*
+ * Attributes file states
+ */
+#define HFSPLUS_EMPTY_ATTR_TREE		0
+#define HFSPLUS_CREATING_ATTR_TREE	1
+#define HFSPLUS_VALID_ATTR_TREE		2
+#define HFSPLUS_FAILED_ATTR_TREE	3
+
+/*
  * HFS+ superblock info (built from Volume Header on disk)
  */
 
@@ -141,6 +149,7 @@ struct hfsplus_sb_info {
 	struct hfs_btree *ext_tree;
 	struct hfs_btree *cat_tree;
 	struct hfs_btree *attr_tree;
+	atomic_t attr_tree_state;
 	struct inode *alloc_file;
 	struct inode *hidden_dir;
 	struct nls_table *nls;
fs/hfsplus/super.c renamed from fs/hfsplus/super.c~hfsplus-implement-attributes-file-creation-functionality +2 -0
diff -puN fs/hfsplus/super.c~hfsplus-implement-attributes-file-creation-functionality fs/hfsplus/super.c
@@ -474,12 +474,14 @@ static int hfsplus_fill_super(struct sup
 		pr_err("failed to load catalog file\n");
 		goto out_close_ext_tree;
 	}
+	atomic_set(&sbi->attr_tree_state, HFSPLUS_EMPTY_ATTR_TREE);
 	if (vhdr->attr_file.total_blocks != 0) {
 		sbi->attr_tree = hfs_btree_open(sb, HFSPLUS_ATTR_CNID);
 		if (!sbi->attr_tree) {
 			pr_err("failed to load attributes file\n");
 			goto out_close_cat_tree;
 		}
+		atomic_set(&sbi->attr_tree_state, HFSPLUS_VALID_ATTR_TREE);
 	}
 	sb->s_xattr = hfsplus_xattr_handlers;
 
fs/hfsplus/xattr.c renamed from fs/hfsplus/xattr.c~hfsplus-implement-attributes-file-creation-functionality +126 -2

140 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are

nilfs2-fix-issue-with-race-condition-of-competition-between-segments-for-dirty-blocks.patch hfsplus-add-metadata-files-clump-size-calculation-functionality.patch hfsplus-implement-attributes-files-header-node-initialization-code.patch hfsplus-implement-attributes-file-creation-functionality.patch