提交 18d1dbf1 编写于 作者: H Harvey Harrison 提交者: Linus Torvalds

ecryptfs: replace remaining __FUNCTION__ occurrences

__FUNCTION__ is gcc-specific, use __func__
Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 05db67a4
...@@ -119,21 +119,21 @@ static int ecryptfs_calculate_md5(char *dst, ...@@ -119,21 +119,21 @@ static int ecryptfs_calculate_md5(char *dst,
if (rc) { if (rc) {
printk(KERN_ERR printk(KERN_ERR
"%s: Error initializing crypto hash; rc = [%d]\n", "%s: Error initializing crypto hash; rc = [%d]\n",
__FUNCTION__, rc); __func__, rc);
goto out; goto out;
} }
rc = crypto_hash_update(&desc, &sg, len); rc = crypto_hash_update(&desc, &sg, len);
if (rc) { if (rc) {
printk(KERN_ERR printk(KERN_ERR
"%s: Error updating crypto hash; rc = [%d]\n", "%s: Error updating crypto hash; rc = [%d]\n",
__FUNCTION__, rc); __func__, rc);
goto out; goto out;
} }
rc = crypto_hash_final(&desc, dst); rc = crypto_hash_final(&desc, dst);
if (rc) { if (rc) {
printk(KERN_ERR printk(KERN_ERR
"%s: Error finalizing crypto hash; rc = [%d]\n", "%s: Error finalizing crypto hash; rc = [%d]\n",
__FUNCTION__, rc); __func__, rc);
goto out; goto out;
} }
out: out:
...@@ -437,7 +437,7 @@ static int ecryptfs_encrypt_extent(struct page *enc_extent_page, ...@@ -437,7 +437,7 @@ static int ecryptfs_encrypt_extent(struct page *enc_extent_page,
if (rc < 0) { if (rc < 0) {
printk(KERN_ERR "%s: Error attempting to encrypt page with " printk(KERN_ERR "%s: Error attempting to encrypt page with "
"page->index = [%ld], extent_offset = [%ld]; " "page->index = [%ld], extent_offset = [%ld]; "
"rc = [%d]\n", __FUNCTION__, page->index, extent_offset, "rc = [%d]\n", __func__, page->index, extent_offset,
rc); rc);
goto out; goto out;
} }
...@@ -487,7 +487,7 @@ int ecryptfs_encrypt_page(struct page *page) ...@@ -487,7 +487,7 @@ int ecryptfs_encrypt_page(struct page *page)
0, PAGE_CACHE_SIZE); 0, PAGE_CACHE_SIZE);
if (rc) if (rc)
printk(KERN_ERR "%s: Error attempting to copy " printk(KERN_ERR "%s: Error attempting to copy "
"page at index [%ld]\n", __FUNCTION__, "page at index [%ld]\n", __func__,
page->index); page->index);
goto out; goto out;
} }
...@@ -508,7 +508,7 @@ int ecryptfs_encrypt_page(struct page *page) ...@@ -508,7 +508,7 @@ int ecryptfs_encrypt_page(struct page *page)
extent_offset); extent_offset);
if (rc) { if (rc) {
printk(KERN_ERR "%s: Error encrypting extent; " printk(KERN_ERR "%s: Error encrypting extent; "
"rc = [%d]\n", __FUNCTION__, rc); "rc = [%d]\n", __func__, rc);
goto out; goto out;
} }
ecryptfs_lower_offset_for_extent( ecryptfs_lower_offset_for_extent(
...@@ -569,7 +569,7 @@ static int ecryptfs_decrypt_extent(struct page *page, ...@@ -569,7 +569,7 @@ static int ecryptfs_decrypt_extent(struct page *page,
if (rc < 0) { if (rc < 0) {
printk(KERN_ERR "%s: Error attempting to decrypt to page with " printk(KERN_ERR "%s: Error attempting to decrypt to page with "
"page->index = [%ld], extent_offset = [%ld]; " "page->index = [%ld], extent_offset = [%ld]; "
"rc = [%d]\n", __FUNCTION__, page->index, extent_offset, "rc = [%d]\n", __func__, page->index, extent_offset,
rc); rc);
goto out; goto out;
} }
...@@ -622,7 +622,7 @@ int ecryptfs_decrypt_page(struct page *page) ...@@ -622,7 +622,7 @@ int ecryptfs_decrypt_page(struct page *page)
ecryptfs_inode); ecryptfs_inode);
if (rc) if (rc)
printk(KERN_ERR "%s: Error attempting to copy " printk(KERN_ERR "%s: Error attempting to copy "
"page at index [%ld]\n", __FUNCTION__, "page at index [%ld]\n", __func__,
page->index); page->index);
goto out; goto out;
} }
...@@ -656,7 +656,7 @@ int ecryptfs_decrypt_page(struct page *page) ...@@ -656,7 +656,7 @@ int ecryptfs_decrypt_page(struct page *page)
extent_offset); extent_offset);
if (rc) { if (rc) {
printk(KERN_ERR "%s: Error encrypting extent; " printk(KERN_ERR "%s: Error encrypting extent; "
"rc = [%d]\n", __FUNCTION__, rc); "rc = [%d]\n", __func__, rc);
goto out; goto out;
} }
} }
...@@ -1215,7 +1215,7 @@ int ecryptfs_read_and_validate_header_region(char *data, ...@@ -1215,7 +1215,7 @@ int ecryptfs_read_and_validate_header_region(char *data,
ecryptfs_inode); ecryptfs_inode);
if (rc) { if (rc) {
printk(KERN_ERR "%s: Error reading header region; rc = [%d]\n", printk(KERN_ERR "%s: Error reading header region; rc = [%d]\n",
__FUNCTION__, rc); __func__, rc);
goto out; goto out;
} }
if (!contains_ecryptfs_marker(data + ECRYPTFS_FILE_SIZE_BYTES)) { if (!contains_ecryptfs_marker(data + ECRYPTFS_FILE_SIZE_BYTES)) {
...@@ -1319,7 +1319,7 @@ ecryptfs_write_metadata_to_contents(struct ecryptfs_crypt_stat *crypt_stat, ...@@ -1319,7 +1319,7 @@ ecryptfs_write_metadata_to_contents(struct ecryptfs_crypt_stat *crypt_stat,
0, crypt_stat->num_header_bytes_at_front); 0, crypt_stat->num_header_bytes_at_front);
if (rc) if (rc)
printk(KERN_ERR "%s: Error attempting to write header " printk(KERN_ERR "%s: Error attempting to write header "
"information to lower file; rc = [%d]\n", __FUNCTION__, "information to lower file; rc = [%d]\n", __func__,
rc); rc);
return rc; return rc;
} }
...@@ -1364,14 +1364,14 @@ int ecryptfs_write_metadata(struct dentry *ecryptfs_dentry) ...@@ -1364,14 +1364,14 @@ int ecryptfs_write_metadata(struct dentry *ecryptfs_dentry)
} }
} else { } else {
printk(KERN_WARNING "%s: Encrypted flag not set\n", printk(KERN_WARNING "%s: Encrypted flag not set\n",
__FUNCTION__); __func__);
rc = -EINVAL; rc = -EINVAL;
goto out; goto out;
} }
/* Released in this function */ /* Released in this function */
virt = kzalloc(crypt_stat->num_header_bytes_at_front, GFP_KERNEL); virt = kzalloc(crypt_stat->num_header_bytes_at_front, GFP_KERNEL);
if (!virt) { if (!virt) {
printk(KERN_ERR "%s: Out of memory\n", __FUNCTION__); printk(KERN_ERR "%s: Out of memory\n", __func__);
rc = -ENOMEM; rc = -ENOMEM;
goto out; goto out;
} }
...@@ -1379,7 +1379,7 @@ int ecryptfs_write_metadata(struct dentry *ecryptfs_dentry) ...@@ -1379,7 +1379,7 @@ int ecryptfs_write_metadata(struct dentry *ecryptfs_dentry)
ecryptfs_dentry); ecryptfs_dentry);
if (unlikely(rc)) { if (unlikely(rc)) {
printk(KERN_ERR "%s: Error whilst writing headers; rc = [%d]\n", printk(KERN_ERR "%s: Error whilst writing headers; rc = [%d]\n",
__FUNCTION__, rc); __func__, rc);
goto out_free; goto out_free;
} }
if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR) if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR)
...@@ -1390,7 +1390,7 @@ int ecryptfs_write_metadata(struct dentry *ecryptfs_dentry) ...@@ -1390,7 +1390,7 @@ int ecryptfs_write_metadata(struct dentry *ecryptfs_dentry)
ecryptfs_dentry, virt); ecryptfs_dentry, virt);
if (rc) { if (rc) {
printk(KERN_ERR "%s: Error writing metadata out to lower file; " printk(KERN_ERR "%s: Error writing metadata out to lower file; "
"rc = [%d]\n", __FUNCTION__, rc); "rc = [%d]\n", __func__, rc);
goto out_free; goto out_free;
} }
out_free: out_free:
...@@ -1584,7 +1584,7 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry) ...@@ -1584,7 +1584,7 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
if (!page_virt) { if (!page_virt) {
rc = -ENOMEM; rc = -ENOMEM;
printk(KERN_ERR "%s: Unable to allocate page_virt\n", printk(KERN_ERR "%s: Unable to allocate page_virt\n",
__FUNCTION__); __func__);
goto out; goto out;
} }
rc = ecryptfs_read_lower(page_virt, 0, crypt_stat->extent_size, rc = ecryptfs_read_lower(page_virt, 0, crypt_stat->extent_size,
......
...@@ -500,7 +500,7 @@ ecryptfs_set_dentry_lower_mnt(struct dentry *dentry, struct vfsmount *lower_mnt) ...@@ -500,7 +500,7 @@ ecryptfs_set_dentry_lower_mnt(struct dentry *dentry, struct vfsmount *lower_mnt)
} }
#define ecryptfs_printk(type, fmt, arg...) \ #define ecryptfs_printk(type, fmt, arg...) \
__ecryptfs_printk(type "%s: " fmt, __FUNCTION__, ## arg); __ecryptfs_printk(type "%s: " fmt, __func__, ## arg);
void __ecryptfs_printk(const char *fmt, ...); void __ecryptfs_printk(const char *fmt, ...);
extern const struct file_operations ecryptfs_main_fops; extern const struct file_operations ecryptfs_main_fops;
......
...@@ -121,7 +121,7 @@ ecryptfs_do_create(struct inode *directory_inode, ...@@ -121,7 +121,7 @@ ecryptfs_do_create(struct inode *directory_inode,
ecryptfs_dentry, mode, nd); ecryptfs_dentry, mode, nd);
if (rc) { if (rc) {
printk(KERN_ERR "%s: Failure to create dentry in lower fs; " printk(KERN_ERR "%s: Failure to create dentry in lower fs; "
"rc = [%d]\n", __FUNCTION__, rc); "rc = [%d]\n", __func__, rc);
goto out_lock; goto out_lock;
} }
rc = ecryptfs_interpose(lower_dentry, ecryptfs_dentry, rc = ecryptfs_interpose(lower_dentry, ecryptfs_dentry,
......
...@@ -219,7 +219,7 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct dentry *dentry, ...@@ -219,7 +219,7 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct dentry *dentry,
if (rc) { if (rc) {
printk(KERN_ERR "%s: Error attempting to initialize the " printk(KERN_ERR "%s: Error attempting to initialize the "
"persistent file for the dentry with name [%s]; " "persistent file for the dentry with name [%s]; "
"rc = [%d]\n", __FUNCTION__, dentry->d_name.name, rc); "rc = [%d]\n", __func__, dentry->d_name.name, rc);
goto out; goto out;
} }
out: out:
......
...@@ -153,7 +153,7 @@ ecryptfs_copy_up_encrypted_with_header(struct page *page, ...@@ -153,7 +153,7 @@ ecryptfs_copy_up_encrypted_with_header(struct page *page,
flush_dcache_page(page); flush_dcache_page(page);
if (rc) { if (rc) {
printk(KERN_ERR "%s: Error reading xattr " printk(KERN_ERR "%s: Error reading xattr "
"region; rc = [%d]\n", __FUNCTION__, rc); "region; rc = [%d]\n", __func__, rc);
goto out; goto out;
} }
} else { } else {
...@@ -169,7 +169,7 @@ ecryptfs_copy_up_encrypted_with_header(struct page *page, ...@@ -169,7 +169,7 @@ ecryptfs_copy_up_encrypted_with_header(struct page *page,
if (rc) { if (rc) {
printk(KERN_ERR "%s: Error attempting to read " printk(KERN_ERR "%s: Error attempting to read "
"extent at offset [%lld] in the lower " "extent at offset [%lld] in the lower "
"file; rc = [%d]\n", __FUNCTION__, "file; rc = [%d]\n", __func__,
lower_offset, rc); lower_offset, rc);
goto out; goto out;
} }
...@@ -212,7 +212,7 @@ static int ecryptfs_readpage(struct file *file, struct page *page) ...@@ -212,7 +212,7 @@ static int ecryptfs_readpage(struct file *file, struct page *page)
"the encrypted content from the lower " "the encrypted content from the lower "
"file whilst inserting the metadata " "file whilst inserting the metadata "
"from the xattr into the header; rc = " "from the xattr into the header; rc = "
"[%d]\n", __FUNCTION__, rc); "[%d]\n", __func__, rc);
goto out; goto out;
} }
...@@ -293,7 +293,7 @@ static int ecryptfs_prepare_write(struct file *file, struct page *page, ...@@ -293,7 +293,7 @@ static int ecryptfs_prepare_write(struct file *file, struct page *page,
if (rc) { if (rc) {
printk(KERN_ERR "%s: Error attemping to read " printk(KERN_ERR "%s: Error attemping to read "
"lower page segment; rc = [%d]\n", "lower page segment; rc = [%d]\n",
__FUNCTION__, rc); __func__, rc);
ClearPageUptodate(page); ClearPageUptodate(page);
goto out; goto out;
} else } else
...@@ -308,7 +308,7 @@ static int ecryptfs_prepare_write(struct file *file, struct page *page, ...@@ -308,7 +308,7 @@ static int ecryptfs_prepare_write(struct file *file, struct page *page,
"from the lower file whilst " "from the lower file whilst "
"inserting the metadata from " "inserting the metadata from "
"the xattr into the header; rc " "the xattr into the header; rc "
"= [%d]\n", __FUNCTION__, rc); "= [%d]\n", __func__, rc);
ClearPageUptodate(page); ClearPageUptodate(page);
goto out; goto out;
} }
...@@ -320,7 +320,7 @@ static int ecryptfs_prepare_write(struct file *file, struct page *page, ...@@ -320,7 +320,7 @@ static int ecryptfs_prepare_write(struct file *file, struct page *page,
if (rc) { if (rc) {
printk(KERN_ERR "%s: Error reading " printk(KERN_ERR "%s: Error reading "
"page; rc = [%d]\n", "page; rc = [%d]\n",
__FUNCTION__, rc); __func__, rc);
ClearPageUptodate(page); ClearPageUptodate(page);
goto out; goto out;
} }
...@@ -331,7 +331,7 @@ static int ecryptfs_prepare_write(struct file *file, struct page *page, ...@@ -331,7 +331,7 @@ static int ecryptfs_prepare_write(struct file *file, struct page *page,
if (rc) { if (rc) {
printk(KERN_ERR "%s: Error decrypting page " printk(KERN_ERR "%s: Error decrypting page "
"at index [%ld]; rc = [%d]\n", "at index [%ld]; rc = [%d]\n",
__FUNCTION__, page->index, rc); __func__, page->index, rc);
ClearPageUptodate(page); ClearPageUptodate(page);
goto out; goto out;
} }
...@@ -348,7 +348,7 @@ static int ecryptfs_prepare_write(struct file *file, struct page *page, ...@@ -348,7 +348,7 @@ static int ecryptfs_prepare_write(struct file *file, struct page *page,
if (rc) { if (rc) {
printk(KERN_ERR "%s: Error on attempt to " printk(KERN_ERR "%s: Error on attempt to "
"truncate to (higher) offset [%lld];" "truncate to (higher) offset [%lld];"
" rc = [%d]\n", __FUNCTION__, " rc = [%d]\n", __func__,
prev_page_end_size, rc); prev_page_end_size, rc);
goto out; goto out;
} }
...@@ -389,7 +389,7 @@ static int ecryptfs_write_inode_size_to_header(struct inode *ecryptfs_inode) ...@@ -389,7 +389,7 @@ static int ecryptfs_write_inode_size_to_header(struct inode *ecryptfs_inode)
kfree(file_size_virt); kfree(file_size_virt);
if (rc) if (rc)
printk(KERN_ERR "%s: Error writing file size to header; " printk(KERN_ERR "%s: Error writing file size to header; "
"rc = [%d]\n", __FUNCTION__, rc); "rc = [%d]\n", __func__, rc);
out: out:
return rc; return rc;
} }
......
...@@ -55,7 +55,7 @@ int ecryptfs_write_lower(struct inode *ecryptfs_inode, char *data, ...@@ -55,7 +55,7 @@ int ecryptfs_write_lower(struct inode *ecryptfs_inode, char *data,
set_fs(fs_save); set_fs(fs_save);
if (octets_written < 0) { if (octets_written < 0) {
printk(KERN_ERR "%s: octets_written = [%td]; " printk(KERN_ERR "%s: octets_written = [%td]; "
"expected [%td]\n", __FUNCTION__, octets_written, size); "expected [%td]\n", __func__, octets_written, size);
rc = -EINVAL; rc = -EINVAL;
} }
mutex_unlock(&inode_info->lower_file_mutex); mutex_unlock(&inode_info->lower_file_mutex);
...@@ -153,7 +153,7 @@ int ecryptfs_write(struct file *ecryptfs_file, char *data, loff_t offset, ...@@ -153,7 +153,7 @@ int ecryptfs_write(struct file *ecryptfs_file, char *data, loff_t offset,
rc = PTR_ERR(ecryptfs_page); rc = PTR_ERR(ecryptfs_page);
printk(KERN_ERR "%s: Error getting page at " printk(KERN_ERR "%s: Error getting page at "
"index [%ld] from eCryptfs inode " "index [%ld] from eCryptfs inode "
"mapping; rc = [%d]\n", __FUNCTION__, "mapping; rc = [%d]\n", __func__,
ecryptfs_page_idx, rc); ecryptfs_page_idx, rc);
goto out; goto out;
} }
...@@ -165,7 +165,7 @@ int ecryptfs_write(struct file *ecryptfs_file, char *data, loff_t offset, ...@@ -165,7 +165,7 @@ int ecryptfs_write(struct file *ecryptfs_file, char *data, loff_t offset,
if (rc) { if (rc) {
printk(KERN_ERR "%s: Error decrypting " printk(KERN_ERR "%s: Error decrypting "
"page; rc = [%d]\n", "page; rc = [%d]\n",
__FUNCTION__, rc); __func__, rc);
ClearPageUptodate(ecryptfs_page); ClearPageUptodate(ecryptfs_page);
page_cache_release(ecryptfs_page); page_cache_release(ecryptfs_page);
goto out; goto out;
...@@ -202,7 +202,7 @@ int ecryptfs_write(struct file *ecryptfs_file, char *data, loff_t offset, ...@@ -202,7 +202,7 @@ int ecryptfs_write(struct file *ecryptfs_file, char *data, loff_t offset,
page_cache_release(ecryptfs_page); page_cache_release(ecryptfs_page);
if (rc) { if (rc) {
printk(KERN_ERR "%s: Error encrypting " printk(KERN_ERR "%s: Error encrypting "
"page; rc = [%d]\n", __FUNCTION__, rc); "page; rc = [%d]\n", __func__, rc);
goto out; goto out;
} }
pos += num_bytes; pos += num_bytes;
...@@ -254,7 +254,7 @@ int ecryptfs_read_lower(char *data, loff_t offset, size_t size, ...@@ -254,7 +254,7 @@ int ecryptfs_read_lower(char *data, loff_t offset, size_t size,
set_fs(fs_save); set_fs(fs_save);
if (octets_read < 0) { if (octets_read < 0) {
printk(KERN_ERR "%s: octets_read = [%td]; " printk(KERN_ERR "%s: octets_read = [%td]; "
"expected [%td]\n", __FUNCTION__, octets_read, size); "expected [%td]\n", __func__, octets_read, size);
rc = -EINVAL; rc = -EINVAL;
} }
mutex_unlock(&inode_info->lower_file_mutex); mutex_unlock(&inode_info->lower_file_mutex);
...@@ -327,7 +327,7 @@ int ecryptfs_read(char *data, loff_t offset, size_t size, ...@@ -327,7 +327,7 @@ int ecryptfs_read(char *data, loff_t offset, size_t size,
printk(KERN_ERR "%s: Attempt to read data past the end of the " printk(KERN_ERR "%s: Attempt to read data past the end of the "
"file; offset = [%lld]; size = [%td]; " "file; offset = [%lld]; size = [%td]; "
"ecryptfs_file_size = [%lld]\n", "ecryptfs_file_size = [%lld]\n",
__FUNCTION__, offset, size, ecryptfs_file_size); __func__, offset, size, ecryptfs_file_size);
goto out; goto out;
} }
pos = offset; pos = offset;
...@@ -345,14 +345,14 @@ int ecryptfs_read(char *data, loff_t offset, size_t size, ...@@ -345,14 +345,14 @@ int ecryptfs_read(char *data, loff_t offset, size_t size,
rc = PTR_ERR(ecryptfs_page); rc = PTR_ERR(ecryptfs_page);
printk(KERN_ERR "%s: Error getting page at " printk(KERN_ERR "%s: Error getting page at "
"index [%ld] from eCryptfs inode " "index [%ld] from eCryptfs inode "
"mapping; rc = [%d]\n", __FUNCTION__, "mapping; rc = [%d]\n", __func__,
ecryptfs_page_idx, rc); ecryptfs_page_idx, rc);
goto out; goto out;
} }
rc = ecryptfs_decrypt_page(ecryptfs_page); rc = ecryptfs_decrypt_page(ecryptfs_page);
if (rc) { if (rc) {
printk(KERN_ERR "%s: Error decrypting " printk(KERN_ERR "%s: Error decrypting "
"page; rc = [%d]\n", __FUNCTION__, rc); "page; rc = [%d]\n", __func__, rc);
ClearPageUptodate(ecryptfs_page); ClearPageUptodate(ecryptfs_page);
page_cache_release(ecryptfs_page); page_cache_release(ecryptfs_page);
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册