aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ufs')
-rw-r--r--fs/ufs/balloc.c4
-rw-r--r--fs/ufs/dir.c14
-rw-r--r--fs/ufs/inode.c2
-rw-r--r--fs/ufs/swab.h36
-rw-r--r--fs/ufs/ufs.h2
5 files changed, 20 insertions, 38 deletions
diff --git a/fs/ufs/balloc.c b/fs/ufs/balloc.c
index 1e7598fb9787..0d9ada173739 100644
--- a/fs/ufs/balloc.c
+++ b/fs/ufs/balloc.c
@@ -277,7 +277,7 @@ static void ufs_change_blocknr(struct inode *inode, sector_t beg,
277 if (!page)/* it was truncated */ 277 if (!page)/* it was truncated */
278 continue; 278 continue;
279 if (IS_ERR(page)) {/* or EIO */ 279 if (IS_ERR(page)) {/* or EIO */
280 ufs_error(inode->i_sb, __FUNCTION__, 280 ufs_error(inode->i_sb, __func__,
281 "read of page %llu failed\n", 281 "read of page %llu failed\n",
282 (unsigned long long)index); 282 (unsigned long long)index);
283 continue; 283 continue;
@@ -308,7 +308,7 @@ static void ufs_change_blocknr(struct inode *inode, sector_t beg,
308 ll_rw_block(READ, 1, &bh); 308 ll_rw_block(READ, 1, &bh);
309 wait_on_buffer(bh); 309 wait_on_buffer(bh);
310 if (!buffer_uptodate(bh)) { 310 if (!buffer_uptodate(bh)) {
311 ufs_error(inode->i_sb, __FUNCTION__, 311 ufs_error(inode->i_sb, __func__,
312 "read of block failed\n"); 312 "read of block failed\n");
313 break; 313 break;
314 } 314 }
diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c
index ef563fc8d72c..df0bef18742d 100644
--- a/fs/ufs/dir.c
+++ b/fs/ufs/dir.c
@@ -179,7 +179,7 @@ bad_entry:
179 goto fail; 179 goto fail;
180Eend: 180Eend:
181 p = (struct ufs_dir_entry *)(kaddr + offs); 181 p = (struct ufs_dir_entry *)(kaddr + offs);
182 ufs_error(sb, __FUNCTION__, 182 ufs_error(sb, __func__,
183 "entry in directory #%lu spans the page boundary" 183 "entry in directory #%lu spans the page boundary"
184 "offset=%lu", 184 "offset=%lu",
185 dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs); 185 dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs);
@@ -284,7 +284,7 @@ struct ufs_dir_entry *ufs_find_entry(struct inode *dir, struct dentry *dentry,
284 kaddr += ufs_last_byte(dir, n) - reclen; 284 kaddr += ufs_last_byte(dir, n) - reclen;
285 while ((char *) de <= kaddr) { 285 while ((char *) de <= kaddr) {
286 if (de->d_reclen == 0) { 286 if (de->d_reclen == 0) {
287 ufs_error(dir->i_sb, __FUNCTION__, 287 ufs_error(dir->i_sb, __func__,
288 "zero-length directory entry"); 288 "zero-length directory entry");
289 ufs_put_page(page); 289 ufs_put_page(page);
290 goto out; 290 goto out;
@@ -356,7 +356,7 @@ int ufs_add_link(struct dentry *dentry, struct inode *inode)
356 goto got_it; 356 goto got_it;
357 } 357 }
358 if (de->d_reclen == 0) { 358 if (de->d_reclen == 0) {
359 ufs_error(dir->i_sb, __FUNCTION__, 359 ufs_error(dir->i_sb, __func__,
360 "zero-length directory entry"); 360 "zero-length directory entry");
361 err = -EIO; 361 err = -EIO;
362 goto out_unlock; 362 goto out_unlock;
@@ -456,7 +456,7 @@ ufs_readdir(struct file *filp, void *dirent, filldir_t filldir)
456 struct page *page = ufs_get_page(inode, n); 456 struct page *page = ufs_get_page(inode, n);
457 457
458 if (IS_ERR(page)) { 458 if (IS_ERR(page)) {
459 ufs_error(sb, __FUNCTION__, 459 ufs_error(sb, __func__,
460 "bad page in #%lu", 460 "bad page in #%lu",
461 inode->i_ino); 461 inode->i_ino);
462 filp->f_pos += PAGE_CACHE_SIZE - offset; 462 filp->f_pos += PAGE_CACHE_SIZE - offset;
@@ -475,7 +475,7 @@ ufs_readdir(struct file *filp, void *dirent, filldir_t filldir)
475 limit = kaddr + ufs_last_byte(inode, n) - UFS_DIR_REC_LEN(1); 475 limit = kaddr + ufs_last_byte(inode, n) - UFS_DIR_REC_LEN(1);
476 for ( ;(char*)de <= limit; de = ufs_next_entry(sb, de)) { 476 for ( ;(char*)de <= limit; de = ufs_next_entry(sb, de)) {
477 if (de->d_reclen == 0) { 477 if (de->d_reclen == 0) {
478 ufs_error(sb, __FUNCTION__, 478 ufs_error(sb, __func__,
479 "zero-length directory entry"); 479 "zero-length directory entry");
480 ufs_put_page(page); 480 ufs_put_page(page);
481 return -EIO; 481 return -EIO;
@@ -536,7 +536,7 @@ int ufs_delete_entry(struct inode *inode, struct ufs_dir_entry *dir,
536 536
537 while ((char*)de < (char*)dir) { 537 while ((char*)de < (char*)dir) {
538 if (de->d_reclen == 0) { 538 if (de->d_reclen == 0) {
539 ufs_error(inode->i_sb, __FUNCTION__, 539 ufs_error(inode->i_sb, __func__,
540 "zero-length directory entry"); 540 "zero-length directory entry");
541 err = -EIO; 541 err = -EIO;
542 goto out; 542 goto out;
@@ -633,7 +633,7 @@ int ufs_empty_dir(struct inode * inode)
633 633
634 while ((char *)de <= kaddr) { 634 while ((char *)de <= kaddr) {
635 if (de->d_reclen == 0) { 635 if (de->d_reclen == 0) {
636 ufs_error(inode->i_sb, __FUNCTION__, 636 ufs_error(inode->i_sb, __func__,
637 "zero-length directory entry: " 637 "zero-length directory entry: "
638 "kaddr=%p, de=%p\n", kaddr, de); 638 "kaddr=%p, de=%p\n", kaddr, de);
639 goto not_empty; 639 goto not_empty;
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c
index 5446b888fc8e..39f877898565 100644
--- a/fs/ufs/inode.c
+++ b/fs/ufs/inode.c
@@ -929,7 +929,7 @@ void ufs_delete_inode (struct inode * inode)
929 old_i_size = inode->i_size; 929 old_i_size = inode->i_size;
930 inode->i_size = 0; 930 inode->i_size = 0;
931 if (inode->i_blocks && ufs_truncate(inode, old_i_size)) 931 if (inode->i_blocks && ufs_truncate(inode, old_i_size))
932 ufs_warning(inode->i_sb, __FUNCTION__, "ufs_truncate failed\n"); 932 ufs_warning(inode->i_sb, __func__, "ufs_truncate failed\n");
933 ufs_free_inode (inode); 933 ufs_free_inode (inode);
934 unlock_kernel(); 934 unlock_kernel();
935 return; 935 return;
diff --git a/fs/ufs/swab.h b/fs/ufs/swab.h
index 1683d2bee614..8d974c4fd18b 100644
--- a/fs/ufs/swab.h
+++ b/fs/ufs/swab.h
@@ -40,25 +40,7 @@ cpu_to_fs64(struct super_block *sbp, u64 n)
40 return (__force __fs64)cpu_to_be64(n); 40 return (__force __fs64)cpu_to_be64(n);
41} 41}
42 42
43static __inline u32 43static inline u32
44fs64_add(struct super_block *sbp, u32 *n, int d)
45{
46 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
47 return *n = cpu_to_le64(le64_to_cpu(*n)+d);
48 else
49 return *n = cpu_to_be64(be64_to_cpu(*n)+d);
50}
51
52static __inline u32
53fs64_sub(struct super_block *sbp, u32 *n, int d)
54{
55 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
56 return *n = cpu_to_le64(le64_to_cpu(*n)-d);
57 else
58 return *n = cpu_to_be64(be64_to_cpu(*n)-d);
59}
60
61static __inline u32
62fs32_to_cpu(struct super_block *sbp, __fs32 n) 44fs32_to_cpu(struct super_block *sbp, __fs32 n)
63{ 45{
64 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) 46 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
@@ -80,18 +62,18 @@ static inline void
80fs32_add(struct super_block *sbp, __fs32 *n, int d) 62fs32_add(struct super_block *sbp, __fs32 *n, int d)
81{ 63{
82 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) 64 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
83 *(__le32 *)n = cpu_to_le32(le32_to_cpu(*(__le32 *)n)+d); 65 le32_add_cpu((__le32 *)n, d);
84 else 66 else
85 *(__be32 *)n = cpu_to_be32(be32_to_cpu(*(__be32 *)n)+d); 67 be32_add_cpu((__be32 *)n, d);
86} 68}
87 69
88static inline void 70static inline void
89fs32_sub(struct super_block *sbp, __fs32 *n, int d) 71fs32_sub(struct super_block *sbp, __fs32 *n, int d)
90{ 72{
91 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) 73 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
92 *(__le32 *)n = cpu_to_le32(le32_to_cpu(*(__le32 *)n)-d); 74 le32_add_cpu((__le32 *)n, -d);
93 else 75 else
94 *(__be32 *)n = cpu_to_be32(be32_to_cpu(*(__be32 *)n)-d); 76 be32_add_cpu((__be32 *)n, -d);
95} 77}
96 78
97static inline u16 79static inline u16
@@ -116,18 +98,18 @@ static inline void
116fs16_add(struct super_block *sbp, __fs16 *n, int d) 98fs16_add(struct super_block *sbp, __fs16 *n, int d)
117{ 99{
118 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) 100 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
119 *(__le16 *)n = cpu_to_le16(le16_to_cpu(*(__le16 *)n)+d); 101 le16_add_cpu((__le16 *)n, d);
120 else 102 else
121 *(__be16 *)n = cpu_to_be16(be16_to_cpu(*(__be16 *)n)+d); 103 be16_add_cpu((__be16 *)n, d);
122} 104}
123 105
124static inline void 106static inline void
125fs16_sub(struct super_block *sbp, __fs16 *n, int d) 107fs16_sub(struct super_block *sbp, __fs16 *n, int d)
126{ 108{
127 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) 109 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
128 *(__le16 *)n = cpu_to_le16(le16_to_cpu(*(__le16 *)n)-d); 110 le16_add_cpu((__le16 *)n, -d);
129 else 111 else
130 *(__be16 *)n = cpu_to_be16(be16_to_cpu(*(__be16 *)n)-d); 112 be16_add_cpu((__be16 *)n, -d);
131} 113}
132 114
133#endif /* _UFS_SWAB_H */ 115#endif /* _UFS_SWAB_H */
diff --git a/fs/ufs/ufs.h b/fs/ufs/ufs.h
index fcb9231bb9ed..244a1aaa940e 100644
--- a/fs/ufs/ufs.h
+++ b/fs/ufs/ufs.h
@@ -66,7 +66,7 @@ struct ufs_inode_info {
66#ifdef CONFIG_UFS_DEBUG 66#ifdef CONFIG_UFS_DEBUG
67# define UFSD(f, a...) { \ 67# define UFSD(f, a...) { \
68 printk ("UFSD (%s, %d): %s:", \ 68 printk ("UFSD (%s, %d): %s:", \
69 __FILE__, __LINE__, __FUNCTION__); \ 69 __FILE__, __LINE__, __func__); \
70 printk (f, ## a); \ 70 printk (f, ## a); \
71 } 71 }
72#else 72#else