Commit c3ed85a3 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

isofs: fix up CodingStyle

fs/isofs/* had a bunch of CodingStyle issues.
* Indentation was a mix of spaces and tabs
* "int * foo" instead of "int *foo"
* "while ( foo )" instead of "while (foo)"
* if (foo) blah; on one line instead of two
* Missing printk KERN_ levels
* lots of trailing whitespace
* lines >80 columns changed to wrap.
* Unnecessary prototype removed by shuffling code order in C file.

Should be no functional changes other than slight size increase due to
printk changes.  Further improvement possible, but this is a start..
Signed-off-by: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1b28f22a
......@@ -13,22 +13,6 @@
#include <linux/smp_lock.h>
#include "isofs.h"
static int isofs_readdir(struct file *, void *, filldir_t);
const struct file_operations isofs_dir_operations =
{
.read = generic_read_dir,
.readdir = isofs_readdir,
};
/*
* directories can handle most operations...
*/
const struct inode_operations isofs_dir_inode_operations =
{
.lookup = isofs_lookup,
};
int isofs_name_translate(struct iso_directory_record *de, char *new, struct inode *inode)
{
char * old = de->name;
......@@ -62,22 +46,27 @@ int isofs_name_translate(struct iso_directory_record *de, char *new, struct inod
}
/* Acorn extensions written by Matthew Wilcox <willy@bofh.ai> 1998 */
int get_acorn_filename(struct iso_directory_record * de,
char * retname, struct inode * inode)
int get_acorn_filename(struct iso_directory_record *de,
char *retname, struct inode *inode)
{
int std;
unsigned char * chr;
unsigned char *chr;
int retnamlen = isofs_name_translate(de, retname, inode);
if (retnamlen == 0) return 0;
if (retnamlen == 0)
return 0;
std = sizeof(struct iso_directory_record) + de->name_len[0];
if (std & 1) std++;
if ((*((unsigned char *) de) - std) != 32) return retnamlen;
if (std & 1)
std++;
if ((*((unsigned char *) de) - std) != 32)
return retnamlen;
chr = ((unsigned char *) de) + std;
if (strncmp(chr, "ARCHIMEDES", 10)) return retnamlen;
if ((*retname == '_') && ((chr[19] & 1) == 1)) *retname = '!';
if (strncmp(chr, "ARCHIMEDES", 10))
return retnamlen;
if ((*retname == '_') && ((chr[19] & 1) == 1))
*retname = '!';
if (((de->flags[0] & 2) == 0) && (chr[13] == 0xff)
&& ((chr[12] & 0xf0) == 0xf0))
{
&& ((chr[12] & 0xf0) == 0xf0)) {
retname[retnamlen] = ',';
sprintf(retname+retnamlen+1, "%3.3x",
((chr[12] & 0xf) << 8) | chr[11]);
......@@ -91,7 +80,7 @@ int get_acorn_filename(struct iso_directory_record * de,
*/
static int do_isofs_readdir(struct inode *inode, struct file *filp,
void *dirent, filldir_t filldir,
char * tmpname, struct iso_directory_record * tmpde)
char *tmpname, struct iso_directory_record *tmpde)
{
unsigned long bufsize = ISOFS_BUFFER_SIZE(inode);
unsigned char bufbits = ISOFS_BUFFER_BITS(inode);
......@@ -121,9 +110,11 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
de_len = *(unsigned char *) de;
/* If the length byte is zero, we should move on to the next
CDROM sector. If we are at the end of the directory, we
kick out of the while loop. */
/*
* If the length byte is zero, we should move on to the next
* CDROM sector. If we are at the end of the directory, we
* kick out of the while loop.
*/
if (de_len == 0) {
brelse(bh);
......@@ -160,8 +151,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
&block_saved,
&offset_saved);
inode_number = isofs_get_ino(block_saved,
offset_saved,
bufbits);
offset_saved, bufbits);
}
if (de->flags[-sbi->s_high_sierra] & 0x80) {
......@@ -240,7 +230,8 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
continue;
}
if (bh) brelse(bh);
if (bh)
brelse(bh);
return 0;
}
......@@ -253,8 +244,8 @@ static int isofs_readdir(struct file *filp,
void *dirent, filldir_t filldir)
{
int result;
char * tmpname;
struct iso_directory_record * tmpde;
char *tmpname;
struct iso_directory_record *tmpde;
struct inode *inode = filp->f_path.dentry->d_inode;
tmpname = (char *)__get_free_page(GFP_KERNEL);
......@@ -270,3 +261,19 @@ static int isofs_readdir(struct file *filp,
unlock_kernel();
return result;
}
const struct file_operations isofs_dir_operations =
{
.read = generic_read_dir,
.readdir = isofs_readdir,
};
/*
* directories can handle most operations...
*/
const struct inode_operations isofs_dir_inode_operations =
{
.lookup = isofs_lookup,
};
This diff is collapsed.
......@@ -85,17 +85,15 @@ get_joliet_filename(struct iso_directory_record * de, unsigned char *outname, st
len = uni16_to_x8(outname, (__be16 *) de->name,
de->name_len[0] >> 1, nls);
}
if ((len > 2) && (outname[len-2] == ';') && (outname[len-1] == '1')) {
if ((len > 2) && (outname[len-2] == ';') && (outname[len-1] == '1'))
len -= 2;
}
/*
* Windows doesn't like periods at the end of a name,
* so neither do we
*/
while (len >= 2 && (outname[len-1] == '.')) {
while (len >= 2 && (outname[len-1] == '.'))
len--;
}
return len;
}
......@@ -15,7 +15,7 @@
* some sanity tests.
*/
static int
isofs_cmp(struct dentry * dentry, const char * compare, int dlen)
isofs_cmp(struct dentry *dentry, const char *compare, int dlen)
{
struct qstr qstr;
......@@ -48,13 +48,13 @@ isofs_cmp(struct dentry * dentry, const char * compare, int dlen)
*/
static unsigned long
isofs_find_entry(struct inode *dir, struct dentry *dentry,
unsigned long *block_rv, unsigned long* offset_rv,
char * tmpname, struct iso_directory_record * tmpde)
unsigned long *block_rv, unsigned long *offset_rv,
char *tmpname, struct iso_directory_record *tmpde)
{
unsigned long bufsize = ISOFS_BUFFER_SIZE(dir);
unsigned char bufbits = ISOFS_BUFFER_BITS(dir);
unsigned long block, f_pos, offset, block_saved, offset_saved;
struct buffer_head * bh = NULL;
struct buffer_head *bh = NULL;
struct isofs_sb_info *sbi = ISOFS_SB(dir->i_sb);
if (!ISOFS_I(dir)->i_first_extent)
......@@ -65,7 +65,7 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry,
block = 0;
while (f_pos < dir->i_size) {
struct iso_directory_record * de;
struct iso_directory_record *de;
int de_len, match, i, dlen;
char *dpnt;
......@@ -155,7 +155,7 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry,
return 0;
}
struct dentry *isofs_lookup(struct inode * dir, struct dentry * dentry, struct nameidata *nd)
struct dentry *isofs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
{
int found;
unsigned long block, offset;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment