aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/udf/udf_i.h4
-rw-r--r--fs/udf/udfdecl.h29
2 files changed, 21 insertions, 12 deletions
diff --git a/fs/udf/udf_i.h b/fs/udf/udf_i.h
index d6d9a774a1c1..4f86b1d98a5d 100644
--- a/fs/udf/udf_i.h
+++ b/fs/udf/udf_i.h
@@ -12,8 +12,8 @@ struct udf_inode_info {
12 __u32 i_next_alloc_block; 12 __u32 i_next_alloc_block;
13 __u32 i_next_alloc_goal; 13 __u32 i_next_alloc_goal;
14 unsigned i_alloc_type : 3; 14 unsigned i_alloc_type : 3;
15 unsigned i_efe : 1; 15 unsigned i_efe : 1; /* extendedFileEntry */
16 unsigned i_use : 1; 16 unsigned i_use : 1; /* unallocSpaceEntry */
17 unsigned i_strat4096 : 1; 17 unsigned i_strat4096 : 1;
18 unsigned reserved : 26; 18 unsigned reserved : 26;
19 union { 19 union {
diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h
index 26bc9c237cb7..cc15f58d497a 100644
--- a/fs/udf/udfdecl.h
+++ b/fs/udf/udfdecl.h
@@ -11,6 +11,7 @@
11 11
12#include "udf_sb.h" 12#include "udf_sb.h"
13#include "udfend.h" 13#include "udfend.h"
14#include "udf_i.h"
14 15
15#define UDF_PREALLOCATE 16#define UDF_PREALLOCATE
16#define UDF_DEFAULT_PREALLOC_BLOCKS 8 17#define UDF_DEFAULT_PREALLOC_BLOCKS 8
@@ -42,16 +43,24 @@ do { \
42#define UDF_NAME_LEN 256 43#define UDF_NAME_LEN 256
43#define UDF_PATH_LEN 1023 44#define UDF_PATH_LEN 1023
44 45
45#define udf_file_entry_alloc_offset(inode)\ 46static inline size_t udf_file_entry_alloc_offset(struct inode *inode)
46 (UDF_I(inode)->i_use ?\ 47{
47 sizeof(struct unallocSpaceEntry) :\ 48 struct udf_inode_info *iinfo = UDF_I(inode);
48 ((UDF_I(inode)->i_efe ?\ 49 if (iinfo->i_use)
49 sizeof(struct extendedFileEntry) :\ 50 return sizeof(struct unallocSpaceEntry);
50 sizeof(struct fileEntry)) + UDF_I(inode)->i_lenEAttr)) 51 else if (iinfo->i_efe)
51 52 return sizeof(struct extendedFileEntry) + iinfo->i_lenEAttr;
52#define udf_ext0_offset(inode)\ 53 else
53 (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB ?\ 54 return sizeof(struct fileEntry) + iinfo->i_lenEAttr;
54 udf_file_entry_alloc_offset(inode) : 0) 55}
56
57static inline size_t udf_ext0_offset(struct inode *inode)
58{
59 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
60 return udf_file_entry_alloc_offset(inode);
61 else
62 return 0;
63}
55 64
56#define udf_get_lb_pblock(sb,loc,offset) udf_get_pblock((sb), (loc).logicalBlockNum, (loc).partitionReferenceNum, (offset)) 65#define udf_get_lb_pblock(sb,loc,offset) udf_get_pblock((sb), (loc).logicalBlockNum, (loc).partitionReferenceNum, (offset))
57 66