aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/hfsplus_fs.h
diff options
context:
space:
mode:
authorVyacheslav Dubeyko <slava@dubeyko.com>2013-02-27 20:03:04 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-27 22:10:10 -0500
commit324ef39a8a4f693035d63527f16100ed27310ecc (patch)
tree1814515cf6139fe1b4ebae8d6641c9ec6293d396 /fs/hfsplus/hfsplus_fs.h
parent127e5f5ae51eff44c9bff673f24e8587caa4e29f (diff)
hfsplus: add support of manipulation by attributes file
Add support of manipulation by attributes file. Signed-off-by: Vyacheslav Dubeyko <slava@dubeyko.com> Reported-by: Hin-Tak Leung <htl10@users.sourceforge.net> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Christoph Hellwig <hch@lst.de> Cc: Jan Kara <jack@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hfsplus/hfsplus_fs.h')
-rw-r--r--fs/hfsplus/hfsplus_fs.h52
1 files changed, 43 insertions, 9 deletions
diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h
index a6da86b1b4c1..05b11f36024c 100644
--- a/fs/hfsplus/hfsplus_fs.h
+++ b/fs/hfsplus/hfsplus_fs.h
@@ -23,6 +23,7 @@
23#define DBG_SUPER 0x00000010 23#define DBG_SUPER 0x00000010
24#define DBG_EXTENT 0x00000020 24#define DBG_EXTENT 0x00000020
25#define DBG_BITMAP 0x00000040 25#define DBG_BITMAP 0x00000040
26#define DBG_ATTR_MOD 0x00000080
26 27
27#if 0 28#if 0
28#define DBG_MASK (DBG_EXTENT|DBG_INODE|DBG_BNODE_MOD) 29#define DBG_MASK (DBG_EXTENT|DBG_INODE|DBG_BNODE_MOD)
@@ -46,6 +47,13 @@ typedef int (*btree_keycmp)(const hfsplus_btree_key *,
46 47
47#define NODE_HASH_SIZE 256 48#define NODE_HASH_SIZE 256
48 49
50/* B-tree mutex nested subclasses */
51enum hfsplus_btree_mutex_classes {
52 CATALOG_BTREE_MUTEX,
53 EXTENTS_BTREE_MUTEX,
54 ATTR_BTREE_MUTEX,
55};
56
49/* An HFS+ BTree held in memory */ 57/* An HFS+ BTree held in memory */
50struct hfs_btree { 58struct hfs_btree {
51 struct super_block *sb; 59 struct super_block *sb;
@@ -223,6 +231,7 @@ struct hfsplus_inode_info {
223#define HFSPLUS_I_CAT_DIRTY 1 /* has changes in the catalog tree */ 231#define HFSPLUS_I_CAT_DIRTY 1 /* has changes in the catalog tree */
224#define HFSPLUS_I_EXT_DIRTY 2 /* has changes in the extent tree */ 232#define HFSPLUS_I_EXT_DIRTY 2 /* has changes in the extent tree */
225#define HFSPLUS_I_ALLOC_DIRTY 3 /* has changes in the allocation file */ 233#define HFSPLUS_I_ALLOC_DIRTY 3 /* has changes in the allocation file */
234#define HFSPLUS_I_ATTR_DIRTY 4 /* has changes in the attributes tree */
226 235
227#define HFSPLUS_IS_RSRC(inode) \ 236#define HFSPLUS_IS_RSRC(inode) \
228 test_bit(HFSPLUS_I_RSRC, &HFSPLUS_I(inode)->flags) 237 test_bit(HFSPLUS_I_RSRC, &HFSPLUS_I(inode)->flags)
@@ -302,7 +311,7 @@ static inline unsigned short hfsplus_min_io_size(struct super_block *sb)
302#define hfs_brec_remove hfsplus_brec_remove 311#define hfs_brec_remove hfsplus_brec_remove
303#define hfs_find_init hfsplus_find_init 312#define hfs_find_init hfsplus_find_init
304#define hfs_find_exit hfsplus_find_exit 313#define hfs_find_exit hfsplus_find_exit
305#define __hfs_brec_find __hplusfs_brec_find 314#define __hfs_brec_find __hfsplus_brec_find
306#define hfs_brec_find hfsplus_brec_find 315#define hfs_brec_find hfsplus_brec_find
307#define hfs_brec_read hfsplus_brec_read 316#define hfs_brec_read hfsplus_brec_read
308#define hfs_brec_goto hfsplus_brec_goto 317#define hfs_brec_goto hfsplus_brec_goto
@@ -324,10 +333,33 @@ static inline unsigned short hfsplus_min_io_size(struct super_block *sb)
324 */ 333 */
325#define HFSPLUS_IOC_BLESS _IO('h', 0x80) 334#define HFSPLUS_IOC_BLESS _IO('h', 0x80)
326 335
336typedef int (*search_strategy_t)(struct hfs_bnode *,
337 struct hfs_find_data *,
338 int *, int *, int *);
339
327/* 340/*
328 * Functions in any *.c used in other files 341 * Functions in any *.c used in other files
329 */ 342 */
330 343
344/* attributes.c */
345int hfsplus_create_attr_tree_cache(void);
346void hfsplus_destroy_attr_tree_cache(void);
347hfsplus_attr_entry *hfsplus_alloc_attr_entry(void);
348void hfsplus_destroy_attr_entry(hfsplus_attr_entry *entry_p);
349int hfsplus_attr_bin_cmp_key(const hfsplus_btree_key *,
350 const hfsplus_btree_key *);
351int hfsplus_attr_build_key(struct super_block *, hfsplus_btree_key *,
352 u32, const char *);
353void hfsplus_attr_build_key_uni(hfsplus_btree_key *key,
354 u32 cnid,
355 struct hfsplus_attr_unistr *name);
356int hfsplus_find_attr(struct super_block *, u32,
357 const char *, struct hfs_find_data *);
358int hfsplus_attr_exists(struct inode *inode, const char *name);
359int hfsplus_create_attr(struct inode *, const char *, const void *, size_t);
360int hfsplus_delete_attr(struct inode *, const char *);
361int hfsplus_delete_all_attrs(struct inode *dir, u32 cnid);
362
331/* bitmap.c */ 363/* bitmap.c */
332int hfsplus_block_allocate(struct super_block *, u32, u32, u32 *); 364int hfsplus_block_allocate(struct super_block *, u32, u32, u32 *);
333int hfsplus_block_free(struct super_block *, u32, u32); 365int hfsplus_block_free(struct super_block *, u32, u32);
@@ -369,8 +401,15 @@ int hfs_brec_remove(struct hfs_find_data *);
369/* bfind.c */ 401/* bfind.c */
370int hfs_find_init(struct hfs_btree *, struct hfs_find_data *); 402int hfs_find_init(struct hfs_btree *, struct hfs_find_data *);
371void hfs_find_exit(struct hfs_find_data *); 403void hfs_find_exit(struct hfs_find_data *);
372int __hfs_brec_find(struct hfs_bnode *, struct hfs_find_data *); 404int hfs_find_1st_rec_by_cnid(struct hfs_bnode *,
373int hfs_brec_find(struct hfs_find_data *); 405 struct hfs_find_data *,
406 int *, int *, int *);
407int hfs_find_rec_by_key(struct hfs_bnode *,
408 struct hfs_find_data *,
409 int *, int *, int *);
410int __hfs_brec_find(struct hfs_bnode *, struct hfs_find_data *,
411 search_strategy_t);
412int hfs_brec_find(struct hfs_find_data *, search_strategy_t);
374int hfs_brec_read(struct hfs_find_data *, void *, int); 413int hfs_brec_read(struct hfs_find_data *, void *, int);
375int hfs_brec_goto(struct hfs_find_data *, int); 414int hfs_brec_goto(struct hfs_find_data *, int);
376 415
@@ -417,11 +456,6 @@ int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end,
417 456
418/* ioctl.c */ 457/* ioctl.c */
419long hfsplus_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); 458long hfsplus_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
420int hfsplus_setxattr(struct dentry *dentry, const char *name,
421 const void *value, size_t size, int flags);
422ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name,
423 void *value, size_t size);
424ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size);
425 459
426/* options.c */ 460/* options.c */
427int hfsplus_parse_options(char *, struct hfsplus_sb_info *); 461int hfsplus_parse_options(char *, struct hfsplus_sb_info *);
@@ -446,7 +480,7 @@ int hfsplus_strcmp(const struct hfsplus_unistr *,
446int hfsplus_uni2asc(struct super_block *, 480int hfsplus_uni2asc(struct super_block *,
447 const struct hfsplus_unistr *, char *, int *); 481 const struct hfsplus_unistr *, char *, int *);
448int hfsplus_asc2uni(struct super_block *, 482int hfsplus_asc2uni(struct super_block *,
449 struct hfsplus_unistr *, const char *, int); 483 struct hfsplus_unistr *, int, const char *, int);
450int hfsplus_hash_dentry(const struct dentry *dentry, 484int hfsplus_hash_dentry(const struct dentry *dentry,
451 const struct inode *inode, struct qstr *str); 485 const struct inode *inode, struct qstr *str);
452int hfsplus_compare_dentry(const struct dentry *parent, 486int hfsplus_compare_dentry(const struct dentry *parent,