aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/file.c
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2008-02-08 07:20:42 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:35 -0500
commitc0b344385fa05f6bea462e707fcba89f9e2776c2 (patch)
tree391376739ffb0b5c9dfcf294c9f746d7ff2daf66 /fs/udf/file.c
parent5e0f001736651f6f859aeca95f895c829d223cdb (diff)
udf: remove UDF_I_* macros and open code them
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Acked-by: Jan Kara <jack@suse.cz> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/udf/file.c')
-rw-r--r--fs/udf/file.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/fs/udf/file.c b/fs/udf/file.c
index a984a8911167..a1e07a131623 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -50,7 +50,8 @@ static int udf_adinicb_readpage(struct file *file, struct page *page)
50 50
51 kaddr = kmap(page); 51 kaddr = kmap(page);
52 memset(kaddr, 0, PAGE_CACHE_SIZE); 52 memset(kaddr, 0, PAGE_CACHE_SIZE);
53 memcpy(kaddr, UDF_I_DATA(inode) + UDF_I_LENEATTR(inode), inode->i_size); 53 memcpy(kaddr, UDF_I(inode)->i_ext.i_data + UDF_I(inode)->i_lenEAttr,
54 inode->i_size);
54 flush_dcache_page(page); 55 flush_dcache_page(page);
55 SetPageUptodate(page); 56 SetPageUptodate(page);
56 kunmap(page); 57 kunmap(page);
@@ -68,7 +69,8 @@ static int udf_adinicb_writepage(struct page *page,
68 BUG_ON(!PageLocked(page)); 69 BUG_ON(!PageLocked(page));
69 70
70 kaddr = kmap(page); 71 kaddr = kmap(page);
71 memcpy(UDF_I_DATA(inode) + UDF_I_LENEATTR(inode), kaddr, inode->i_size); 72 memcpy(UDF_I(inode)->i_ext.i_data + UDF_I(inode)->i_lenEAttr, kaddr,
73 inode->i_size);
72 mark_inode_dirty(inode); 74 mark_inode_dirty(inode);
73 SetPageUptodate(page); 75 SetPageUptodate(page);
74 kunmap(page); 76 kunmap(page);
@@ -87,7 +89,7 @@ static int udf_adinicb_write_end(struct file *file,
87 char *kaddr; 89 char *kaddr;
88 90
89 kaddr = kmap_atomic(page, KM_USER0); 91 kaddr = kmap_atomic(page, KM_USER0);
90 memcpy(UDF_I_DATA(inode) + UDF_I_LENEATTR(inode) + offset, 92 memcpy(UDF_I(inode)->i_ext.i_data + UDF_I(inode)->i_lenEAttr + offset,
91 kaddr + offset, copied); 93 kaddr + offset, copied);
92 kunmap_atomic(kaddr, KM_USER0); 94 kunmap_atomic(kaddr, KM_USER0);
93 95
@@ -111,7 +113,7 @@ static ssize_t udf_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
111 int err, pos; 113 int err, pos;
112 size_t count = iocb->ki_left; 114 size_t count = iocb->ki_left;
113 115
114 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB) { 116 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
115 if (file->f_flags & O_APPEND) 117 if (file->f_flags & O_APPEND)
116 pos = inode->i_size; 118 pos = inode->i_size;
117 else 119 else
@@ -121,15 +123,16 @@ static ssize_t udf_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
121 (udf_file_entry_alloc_offset(inode) + 123 (udf_file_entry_alloc_offset(inode) +
122 pos + count)) { 124 pos + count)) {
123 udf_expand_file_adinicb(inode, pos + count, &err); 125 udf_expand_file_adinicb(inode, pos + count, &err);
124 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB) { 126 if (UDF_I(inode)->i_alloc_type ==
127 ICBTAG_FLAG_AD_IN_ICB) {
125 udf_debug("udf_expand_adinicb: err=%d\n", err); 128 udf_debug("udf_expand_adinicb: err=%d\n", err);
126 return err; 129 return err;
127 } 130 }
128 } else { 131 } else {
129 if (pos + count > inode->i_size) 132 if (pos + count > inode->i_size)
130 UDF_I_LENALLOC(inode) = pos + count; 133 UDF_I(inode)->i_lenAlloc = pos + count;
131 else 134 else
132 UDF_I_LENALLOC(inode) = inode->i_size; 135 UDF_I(inode)->i_lenAlloc = inode->i_size;
133 } 136 }
134 } 137 }
135 138
@@ -209,11 +212,12 @@ int udf_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
209 result = put_user(new_block, (long __user *)arg); 212 result = put_user(new_block, (long __user *)arg);
210 return result; 213 return result;
211 case UDF_GETEASIZE: 214 case UDF_GETEASIZE:
212 result = put_user(UDF_I_LENEATTR(inode), (int __user *)arg); 215 result = put_user(UDF_I(inode)->i_lenEAttr, (int __user *)arg);
213 break; 216 break;
214 case UDF_GETEABLOCK: 217 case UDF_GETEABLOCK:
215 result = copy_to_user((char __user *)arg, UDF_I_DATA(inode), 218 result = copy_to_user((char __user *)arg,
216 UDF_I_LENEATTR(inode)) ? -EFAULT : 0; 219 UDF_I(inode)->i_ext.i_data,
220 UDF_I(inode)->i_lenEAttr) ? -EFAULT : 0;
217 break; 221 break;
218 } 222 }
219 223