From: Christoph Hellwig <hch@lst.de>
To: cotte@de.ibm.com, akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] xip cleanups
Date: Tue, 28 Jun 2005 14:01:59 +0200 [thread overview]
Message-ID: <20050628120159.GA1745@lst.de> (raw)
adjust to kernel style and remove some unneeded NULL checks
Index: linux-2.6/fs/ext2/xip.c
===================================================================
--- linux-2.6.orig/fs/ext2/xip.c 2005-06-26 13:26:24.000000000 +0200
+++ linux-2.6/fs/ext2/xip.c 2005-06-26 13:30:39.000000000 +0200
@@ -15,42 +15,39 @@
#include "xip.h"
static inline int
-__inode_direct_access(struct inode *inode, sector_t sector, unsigned long *data) {
+__inode_direct_access(struct inode *inode, sector_t sector, unsigned long *data)
+{
BUG_ON(!inode->i_sb->s_bdev->bd_disk->fops->direct_access);
return inode->i_sb->s_bdev->bd_disk->fops
->direct_access(inode->i_sb->s_bdev,sector,data);
}
int
-ext2_clear_xip_target(struct inode *inode, int block) {
- sector_t sector = block*(PAGE_SIZE/512);
+ext2_clear_xip_target(struct inode *inode, int block)
+{
+ sector_t sector = block * (PAGE_SIZE/512);
unsigned long data;
int rc;
rc = __inode_direct_access(inode, sector, &data);
- if (rc)
- return rc;
- clear_page((void*)data);
- return 0;
+ if (!rc)
+ clear_page(data);
+ return rc;
}
void ext2_xip_verify_sb(struct super_block *sb)
{
struct ext2_sb_info *sbi = EXT2_SB(sb);
- if ((sbi->s_mount_opt & EXT2_MOUNT_XIP)) {
- if ((sb->s_bdev == NULL) ||
- sb->s_bdev->bd_disk == NULL ||
- sb->s_bdev->bd_disk->fops == NULL ||
- sb->s_bdev->bd_disk->fops->direct_access == NULL) {
- sbi->s_mount_opt &= (~EXT2_MOUNT_XIP);
- ext2_warning(sb, __FUNCTION__,
- "ignoring xip option - not supported by bdev");
- }
+ if ((sbi->s_mount_opt & EXT2_MOUNT_XIP) &&
+ !sb->s_bdev->bd_disk->fops->direct_access) {
+ sbi->s_mount_opt &= ~EXT2_MOUNT_XIP;
+ ext2_warning(sb, __FUNCTION__,
+ "ignoring xip option - not supported by bdev");
}
}
-struct page*
+struct page *
ext2_get_xip_page(struct address_space *mapping, sector_t blockno,
int create)
{
@@ -60,7 +57,7 @@
tmp.b_state = 0;
tmp.b_blocknr = 0;
- rc = ext2_get_block(mapping->host, blockno/(PAGE_SIZE/512) , &tmp,
+ rc = ext2_get_block(mapping->host, blockno/(PAGE_SIZE/512), &tmp,
create);
if (rc)
return ERR_PTR(rc);
@@ -71,7 +68,7 @@
}
rc = __inode_direct_access
- (mapping->host,tmp.b_blocknr*(PAGE_SIZE/512) ,&data);
+ (mapping->host,tmp.b_blocknr * (PAGE_SIZE/512), &data);
if (rc)
return ERR_PTR(rc);
next reply other threads:[~2005-06-28 12:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-28 12:01 Christoph Hellwig [this message]
2005-06-28 12:40 ` [PATCH] xip cleanups Jörn Engel
2005-06-30 13:46 ` Christoph Hellwig
[not found] ` <200506281421.09893.arnd@arndb.de>
2005-06-30 13:44 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050628120159.GA1745@lst.de \
--to=hch@lst.de \
--cc=akpm@osdl.org \
--cc=cotte@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox