xref: /haiku/src/add-ons/kernel/file_systems/ntfs/libntfs/attrlist.h (revision 80bca3d3c8c08d3c9b31d7609a7805941529e9c3)
1*80bca3d3SAxel Dörfler /*
2*80bca3d3SAxel Dörfler  * attrlist.h - Exports for attribute list attribute handling.
3*80bca3d3SAxel Dörfler  * 		Originated from Linux-NTFS project.
4*80bca3d3SAxel Dörfler  *
5*80bca3d3SAxel Dörfler  * Copyright (c) 2004 Anton Altaparmakov
6*80bca3d3SAxel Dörfler  * Copyright (c) 2004 Yura Pakhuchiy
7*80bca3d3SAxel Dörfler  *
8*80bca3d3SAxel Dörfler  * This program/include file is free software; you can redistribute it and/or
9*80bca3d3SAxel Dörfler  * modify it under the terms of the GNU General Public License as published
10*80bca3d3SAxel Dörfler  * by the Free Software Foundation; either version 2 of the License, or
11*80bca3d3SAxel Dörfler  * (at your option) any later version.
12*80bca3d3SAxel Dörfler  *
13*80bca3d3SAxel Dörfler  * This program/include file is distributed in the hope that it will be
14*80bca3d3SAxel Dörfler  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
15*80bca3d3SAxel Dörfler  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16*80bca3d3SAxel Dörfler  * GNU General Public License for more details.
17*80bca3d3SAxel Dörfler  *
18*80bca3d3SAxel Dörfler  * You should have received a copy of the GNU General Public License
19*80bca3d3SAxel Dörfler  * along with this program (in the main directory of the NTFS-3G
20*80bca3d3SAxel Dörfler  * distribution in the file COPYING); if not, write to the Free Software
21*80bca3d3SAxel Dörfler  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22*80bca3d3SAxel Dörfler  */
23*80bca3d3SAxel Dörfler 
24*80bca3d3SAxel Dörfler #ifndef _NTFS_ATTRLIST_H
25*80bca3d3SAxel Dörfler #define _NTFS_ATTRLIST_H
26*80bca3d3SAxel Dörfler 
27*80bca3d3SAxel Dörfler #include "attrib.h"
28*80bca3d3SAxel Dörfler 
29*80bca3d3SAxel Dörfler extern int ntfs_attrlist_need(ntfs_inode *ni);
30*80bca3d3SAxel Dörfler 
31*80bca3d3SAxel Dörfler extern int ntfs_attrlist_entry_add(ntfs_inode *ni, ATTR_RECORD *attr);
32*80bca3d3SAxel Dörfler extern int ntfs_attrlist_entry_rm(ntfs_attr_search_ctx *ctx);
33*80bca3d3SAxel Dörfler 
34*80bca3d3SAxel Dörfler /**
35*80bca3d3SAxel Dörfler  * ntfs_attrlist_mark_dirty - set the attribute list dirty
36*80bca3d3SAxel Dörfler  * @ni:		ntfs inode which base inode contain dirty attribute list
37*80bca3d3SAxel Dörfler  *
38*80bca3d3SAxel Dörfler  * Set the attribute list dirty so it is written out later (at the latest at
39*80bca3d3SAxel Dörfler  * ntfs_inode_close() time).
40*80bca3d3SAxel Dörfler  *
41*80bca3d3SAxel Dörfler  * This function cannot fail.
42*80bca3d3SAxel Dörfler  */
ntfs_attrlist_mark_dirty(ntfs_inode * ni)43*80bca3d3SAxel Dörfler static __inline__ void ntfs_attrlist_mark_dirty(ntfs_inode *ni)
44*80bca3d3SAxel Dörfler {
45*80bca3d3SAxel Dörfler 	if (ni->nr_extents == -1)
46*80bca3d3SAxel Dörfler 		NInoAttrListSetDirty(ni->base_ni);
47*80bca3d3SAxel Dörfler 	else
48*80bca3d3SAxel Dörfler 		NInoAttrListSetDirty(ni);
49*80bca3d3SAxel Dörfler }
50*80bca3d3SAxel Dörfler 
51*80bca3d3SAxel Dörfler #endif /* defined _NTFS_ATTRLIST_H */
52