diff options
Diffstat (limited to 'fs/ufs')
-rw-r--r-- | fs/ufs/balloc.c | 4 | ||||
-rw-r--r-- | fs/ufs/dir.c | 14 | ||||
-rw-r--r-- | fs/ufs/inode.c | 2 | ||||
-rw-r--r-- | fs/ufs/swab.h | 36 | ||||
-rw-r--r-- | fs/ufs/ufs.h | 2 |
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, if (!page)/* it was truncated */ continue; if (IS_ERR(page)) {/* or EIO */ - ufs_error(inode->i_sb, __FUNCTION__, + ufs_error(inode->i_sb, __func__, "read of page %llu failed\n", (unsigned long long)index); continue; @@ -308,7 +308,7 @@ static void ufs_change_blocknr(struct inode *inode, sector_t beg, ll_rw_block(READ, 1, &bh); wait_on_buffer(bh); if (!buffer_uptodate(bh)) { - ufs_error(inode->i_sb, __FUNCTION__, + ufs_error(inode->i_sb, __func__, "read of block failed\n"); break; } 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: goto fail; Eend: p = (struct ufs_dir_entry *)(kaddr + offs); - ufs_error(sb, __FUNCTION__, + ufs_error(sb, __func__, "entry in directory #%lu spans the page boundary" "offset=%lu", 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, kaddr += ufs_last_byte(dir, n) - reclen; while ((char *) de <= kaddr) { if (de->d_reclen == 0) { - ufs_error(dir->i_sb, __FUNCTION__, + ufs_error(dir->i_sb, __func__, "zero-length directory entry"); ufs_put_page(page); goto out; @@ -356,7 +356,7 @@ int ufs_add_link(struct dentry *dentry, struct inode *inode) goto got_it; } if (de->d_reclen == 0) { - ufs_error(dir->i_sb, __FUNCTION__, + ufs_error(dir->i_sb, __func__, "zero-length directory entry"); err = -EIO; goto out_unlock; @@ -456,7 +456,7 @@ ufs_readdir(struct file *filp, void *dirent, filldir_t filldir) struct page *page = ufs_get_page(inode, n); if (IS_ERR(page)) { - ufs_error(sb, __FUNCTION__, + ufs_error(sb, __func__, "bad page in #%lu", inode->i_ino); filp->f_pos += PAGE_CACHE_SIZE - offset; @@ -475,7 +475,7 @@ ufs_readdir(struct file *filp, void *dirent, filldir_t filldir) limit = kaddr + ufs_last_byte(inode, n) - UFS_DIR_REC_LEN(1); for ( ;(char*)de <= limit; de = ufs_next_entry(sb, de)) { if (de->d_reclen == 0) { - ufs_error(sb, __FUNCTION__, + ufs_error(sb, __func__, "zero-length directory entry"); ufs_put_page(page); return -EIO; @@ -536,7 +536,7 @@ int ufs_delete_entry(struct inode *inode, struct ufs_dir_entry *dir, while ((char*)de < (char*)dir) { if (de->d_reclen == 0) { - ufs_error(inode->i_sb, __FUNCTION__, + ufs_error(inode->i_sb, __func__, "zero-length directory entry"); err = -EIO; goto out; @@ -633,7 +633,7 @@ int ufs_empty_dir(struct inode * inode) while ((char *)de <= kaddr) { if (de->d_reclen == 0) { - ufs_error(inode->i_sb, __FUNCTION__, + ufs_error(inode->i_sb, __func__, "zero-length directory entry: " "kaddr=%p, de=%p\n", kaddr, de); 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) old_i_size = inode->i_size; inode->i_size = 0; if (inode->i_blocks && ufs_truncate(inode, old_i_size)) - ufs_warning(inode->i_sb, __FUNCTION__, "ufs_truncate failed\n"); + ufs_warning(inode->i_sb, __func__, "ufs_truncate failed\n"); ufs_free_inode (inode); unlock_kernel(); 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) return (__force __fs64)cpu_to_be64(n); } -static __inline u32 -fs64_add(struct super_block *sbp, u32 *n, int d) -{ - if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - return *n = cpu_to_le64(le64_to_cpu(*n)+d); - else - return *n = cpu_to_be64(be64_to_cpu(*n)+d); -} - -static __inline u32 -fs64_sub(struct super_block *sbp, u32 *n, int d) -{ - if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - return *n = cpu_to_le64(le64_to_cpu(*n)-d); - else - return *n = cpu_to_be64(be64_to_cpu(*n)-d); -} - -static __inline u32 +static inline u32 fs32_to_cpu(struct super_block *sbp, __fs32 n) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) @@ -80,18 +62,18 @@ static inline void fs32_add(struct super_block *sbp, __fs32 *n, int d) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - *(__le32 *)n = cpu_to_le32(le32_to_cpu(*(__le32 *)n)+d); + le32_add_cpu((__le32 *)n, d); else - *(__be32 *)n = cpu_to_be32(be32_to_cpu(*(__be32 *)n)+d); + be32_add_cpu((__be32 *)n, d); } static inline void fs32_sub(struct super_block *sbp, __fs32 *n, int d) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - *(__le32 *)n = cpu_to_le32(le32_to_cpu(*(__le32 *)n)-d); + le32_add_cpu((__le32 *)n, -d); else - *(__be32 *)n = cpu_to_be32(be32_to_cpu(*(__be32 *)n)-d); + be32_add_cpu((__be32 *)n, -d); } static inline u16 @@ -116,18 +98,18 @@ static inline void fs16_add(struct super_block *sbp, __fs16 *n, int d) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - *(__le16 *)n = cpu_to_le16(le16_to_cpu(*(__le16 *)n)+d); + le16_add_cpu((__le16 *)n, d); else - *(__be16 *)n = cpu_to_be16(be16_to_cpu(*(__be16 *)n)+d); + be16_add_cpu((__be16 *)n, d); } static inline void fs16_sub(struct super_block *sbp, __fs16 *n, int d) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - *(__le16 *)n = cpu_to_le16(le16_to_cpu(*(__le16 *)n)-d); + le16_add_cpu((__le16 *)n, -d); else - *(__be16 *)n = cpu_to_be16(be16_to_cpu(*(__be16 *)n)-d); + be16_add_cpu((__be16 *)n, -d); } #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 { #ifdef CONFIG_UFS_DEBUG # define UFSD(f, a...) { \ printk ("UFSD (%s, %d): %s:", \ - __FILE__, __LINE__, __FUNCTION__); \ + __FILE__, __LINE__, __func__); \ printk (f, ## a); \ } #else |