Commit e60f749b authored by Luis de Bethencourt's avatar Luis de Bethencourt

befs: remove trailing whitespaces

Removing all trailing whitespaces in befs.

I was skeptic about tainting the history with this, but whitespace changes
can be ignored by using 'git blame -w' and 'git log -w'.
Signed-off-by: default avatarLuis de Bethencourt <luisbg@osg.samsung.com>
parent 50b00fc4
...@@ -79,7 +79,7 @@ enum inode_flags { ...@@ -79,7 +79,7 @@ enum inode_flags {
BEFS_INODE_WAS_WRITTEN = 0x00020000, BEFS_INODE_WAS_WRITTEN = 0x00020000,
BEFS_NO_TRANSACTION = 0x00040000, BEFS_NO_TRANSACTION = 0x00040000,
}; };
/* /*
* On-Disk datastructures of BeFS * On-Disk datastructures of BeFS
*/ */
...@@ -139,7 +139,7 @@ typedef struct { ...@@ -139,7 +139,7 @@ typedef struct {
} PACKED befs_super_block; } PACKED befs_super_block;
/* /*
* Note: the indirect and dbl_indir block_runs may * Note: the indirect and dbl_indir block_runs may
* be longer than one block! * be longer than one block!
*/ */
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
* *
* Dominic Giampaolo, author of "Practical File System * Dominic Giampaolo, author of "Practical File System
* Design with the Be File System", for such a helpful book. * Design with the Be File System", for such a helpful book.
* *
* Marcus J. Ranum, author of the b+tree package in * Marcus J. Ranum, author of the b+tree package in
* comp.sources.misc volume 10. This code is not copied from that * comp.sources.misc volume 10. This code is not copied from that
* work, but it is partially based on it. * work, but it is partially based on it.
* *
...@@ -38,38 +38,38 @@ ...@@ -38,38 +38,38 @@
*/ */
/* Befs B+tree structure: /* Befs B+tree structure:
* *
* The first thing in the tree is the tree superblock. It tells you * The first thing in the tree is the tree superblock. It tells you
* all kinds of useful things about the tree, like where the rootnode * all kinds of useful things about the tree, like where the rootnode
* is located, and the size of the nodes (always 1024 with current version * is located, and the size of the nodes (always 1024 with current version
* of BeOS). * of BeOS).
* *
* The rest of the tree consists of a series of nodes. Nodes contain a header * The rest of the tree consists of a series of nodes. Nodes contain a header
* (struct befs_btree_nodehead), the packed key data, an array of shorts * (struct befs_btree_nodehead), the packed key data, an array of shorts
* containing the ending offsets for each of the keys, and an array of * containing the ending offsets for each of the keys, and an array of
* befs_off_t values. In interior nodes, the keys are the ending keys for * befs_off_t values. In interior nodes, the keys are the ending keys for
* the childnode they point to, and the values are offsets into the * the childnode they point to, and the values are offsets into the
* datastream containing the tree. * datastream containing the tree.
*/ */
/* Note: /* Note:
* *
* The book states 2 confusing things about befs b+trees. First, * The book states 2 confusing things about befs b+trees. First,
* it states that the overflow field of node headers is used by internal nodes * it states that the overflow field of node headers is used by internal nodes
* to point to another node that "effectively continues this one". Here is what * to point to another node that "effectively continues this one". Here is what
* I believe that means. Each key in internal nodes points to another node that * I believe that means. Each key in internal nodes points to another node that
* contains key values less than itself. Inspection reveals that the last key * contains key values less than itself. Inspection reveals that the last key
* in the internal node is not the last key in the index. Keys that are * in the internal node is not the last key in the index. Keys that are
* greater than the last key in the internal node go into the overflow node. * greater than the last key in the internal node go into the overflow node.
* I imagine there is a performance reason for this. * I imagine there is a performance reason for this.
* *
* Second, it states that the header of a btree node is sufficient to * Second, it states that the header of a btree node is sufficient to
* distinguish internal nodes from leaf nodes. Without saying exactly how. * distinguish internal nodes from leaf nodes. Without saying exactly how.
* After figuring out the first, it becomes obvious that internal nodes have * After figuring out the first, it becomes obvious that internal nodes have
* overflow nodes and leafnodes do not. * overflow nodes and leafnodes do not.
*/ */
/* /*
* Currently, this code is only good for directory B+trees. * Currently, this code is only good for directory B+trees.
* In order to be used for other BFS indexes, it needs to be extended to handle * In order to be used for other BFS indexes, it needs to be extended to handle
* duplicate keys and non-string keytypes (int32, int64, float, double). * duplicate keys and non-string keytypes (int32, int64, float, double).
...@@ -237,8 +237,8 @@ befs_bt_read_node(struct super_block *sb, const befs_data_stream *ds, ...@@ -237,8 +237,8 @@ befs_bt_read_node(struct super_block *sb, const befs_data_stream *ds,
* with @key (usually the disk block number of an inode). * with @key (usually the disk block number of an inode).
* *
* On failure, returns BEFS_ERR or BEFS_BT_NOT_FOUND. * On failure, returns BEFS_ERR or BEFS_BT_NOT_FOUND.
* *
* Algorithm: * Algorithm:
* Read the superblock and rootnode of the b+tree. * Read the superblock and rootnode of the b+tree.
* Drill down through the interior nodes using befs_find_key(). * Drill down through the interior nodes using befs_find_key().
* Once at the correct leaf node, use befs_find_key() again to get the * Once at the correct leaf node, use befs_find_key() again to get the
...@@ -402,12 +402,12 @@ befs_find_key(struct super_block *sb, struct befs_btree_node *node, ...@@ -402,12 +402,12 @@ befs_find_key(struct super_block *sb, struct befs_btree_node *node,
* *
* Here's how it works: Key_no is the index of the key/value pair to * Here's how it works: Key_no is the index of the key/value pair to
* return in keybuf/value. * return in keybuf/value.
* Bufsize is the size of keybuf (BEFS_NAME_LEN+1 is a good size). Keysize is * Bufsize is the size of keybuf (BEFS_NAME_LEN+1 is a good size). Keysize is
* the number of characters in the key (just a convenience). * the number of characters in the key (just a convenience).
* *
* Algorithm: * Algorithm:
* Get the first leafnode of the tree. See if the requested key is in that * Get the first leafnode of the tree. See if the requested key is in that
* node. If not, follow the node->right link to the next leafnode. Repeat * node. If not, follow the node->right link to the next leafnode. Repeat
* until the (key_no)th key is found or the tree is out of keys. * until the (key_no)th key is found or the tree is out of keys.
*/ */
int int
...@@ -536,7 +536,7 @@ befs_btree_read(struct super_block *sb, const befs_data_stream *ds, ...@@ -536,7 +536,7 @@ befs_btree_read(struct super_block *sb, const befs_data_stream *ds,
* @node_off: Pointer to offset of current node within datastream. Modified * @node_off: Pointer to offset of current node within datastream. Modified
* by the function. * by the function.
* *
* Helper function for btree traverse. Moves the current position to the * Helper function for btree traverse. Moves the current position to the
* start of the first leaf node. * start of the first leaf node.
* *
* Also checks for an empty tree. If there are no keys, returns BEFS_BT_EMPTY. * Also checks for an empty tree. If there are no keys, returns BEFS_BT_EMPTY.
...@@ -592,10 +592,10 @@ befs_btree_seekleaf(struct super_block *sb, const befs_data_stream *ds, ...@@ -592,10 +592,10 @@ befs_btree_seekleaf(struct super_block *sb, const befs_data_stream *ds,
} }
/** /**
* befs_leafnode - Determine if the btree node is a leaf node or an * befs_leafnode - Determine if the btree node is a leaf node or an
* interior node * interior node
* @node: Pointer to node structure to test * @node: Pointer to node structure to test
* *
* Return 1 if leaf, 0 if interior * Return 1 if leaf, 0 if interior
*/ */
static int static int
...@@ -656,7 +656,7 @@ befs_bt_valarray(struct befs_btree_node *node) ...@@ -656,7 +656,7 @@ befs_bt_valarray(struct befs_btree_node *node)
* @node: Pointer to the node structure to find the keydata array within * @node: Pointer to the node structure to find the keydata array within
* *
* Returns a pointer to the start of the keydata array * Returns a pointer to the start of the keydata array
* of the node pointed to by the node header * of the node pointed to by the node header
*/ */
static char * static char *
befs_bt_keydata(struct befs_btree_node *node) befs_bt_keydata(struct befs_btree_node *node)
...@@ -702,7 +702,7 @@ befs_bt_get_key(struct super_block *sb, struct befs_btree_node *node, ...@@ -702,7 +702,7 @@ befs_bt_get_key(struct super_block *sb, struct befs_btree_node *node,
/** /**
* befs_compare_strings - compare two strings * befs_compare_strings - compare two strings
* @key1: pointer to the first key to be compared * @key1: pointer to the first key to be compared
* @keylen1: length in bytes of key1 * @keylen1: length in bytes of key1
* @key2: pointer to the second key to be compared * @key2: pointer to the second key to be compared
* @keylen2: length in bytes of key2 * @keylen2: length in bytes of key2
......
/* /*
* btree.h * btree.h
* *
*/ */
int befs_btree_find(struct super_block *sb, const befs_data_stream *ds, int befs_btree_find(struct super_block *sb, const befs_data_stream *ds,
......
...@@ -84,9 +84,9 @@ befs_read_datastream(struct super_block *sb, const befs_data_stream *ds, ...@@ -84,9 +84,9 @@ befs_read_datastream(struct super_block *sb, const befs_data_stream *ds,
* *
* Takes a file position and gives back a brun who's starting block * Takes a file position and gives back a brun who's starting block
* is block number fblock of the file. * is block number fblock of the file.
* *
* Returns BEFS_OK or BEFS_ERR. * Returns BEFS_OK or BEFS_ERR.
* *
* Calls specialized functions for each of the three possible * Calls specialized functions for each of the three possible
* datastream regions. * datastream regions.
*/ */
...@@ -118,7 +118,7 @@ befs_fblock2brun(struct super_block *sb, const befs_data_stream *data, ...@@ -118,7 +118,7 @@ befs_fblock2brun(struct super_block *sb, const befs_data_stream *data,
/** /**
* befs_read_lsmylink - read long symlink from datastream. * befs_read_lsmylink - read long symlink from datastream.
* @sb: Filesystem superblock * @sb: Filesystem superblock
* @ds: Datastream to read from * @ds: Datastream to read from
* @buff: Buffer in which to place long symlink data * @buff: Buffer in which to place long symlink data
* @len: Length of the long symlink in bytes * @len: Length of the long symlink in bytes
......
/* /*
* inode.h * inode.h
* *
*/ */
int befs_check_inode(struct super_block *sb, befs_inode *raw_inode, int befs_check_inode(struct super_block *sb, befs_inode *raw_inode,
......
...@@ -4,4 +4,3 @@ ...@@ -4,4 +4,3 @@
struct buffer_head *befs_bread_iaddr(struct super_block *sb, struct buffer_head *befs_bread_iaddr(struct super_block *sb,
befs_inode_addr iaddr); befs_inode_addr iaddr);
...@@ -84,9 +84,9 @@ static const struct address_space_operations befs_symlink_aops = { ...@@ -84,9 +84,9 @@ static const struct address_space_operations befs_symlink_aops = {
.readpage = befs_symlink_readpage, .readpage = befs_symlink_readpage,
}; };
/* /*
* Called by generic_file_read() to read a page of data * Called by generic_file_read() to read a page of data
* *
* In turn, simply calls a generic block read function and * In turn, simply calls a generic block read function and
* passes it the address of befs_get_block, for mapping file * passes it the address of befs_get_block, for mapping file
* positions to disk blocks. * positions to disk blocks.
...@@ -103,8 +103,8 @@ befs_bmap(struct address_space *mapping, sector_t block) ...@@ -103,8 +103,8 @@ befs_bmap(struct address_space *mapping, sector_t block)
return generic_block_bmap(mapping, block, befs_get_block); return generic_block_bmap(mapping, block, befs_get_block);
} }
/* /*
* Generic function to map a file position (block) to a * Generic function to map a file position (block) to a
* disk offset (passed back in bh_result). * disk offset (passed back in bh_result).
* *
* Used by many higher level functions. * Used by many higher level functions.
...@@ -337,7 +337,7 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino) ...@@ -337,7 +337,7 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino)
/* /*
* set uid and gid. But since current BeOS is single user OS, so * set uid and gid. But since current BeOS is single user OS, so
* you can change by "uid" or "gid" options. * you can change by "uid" or "gid" options.
*/ */
inode->i_uid = befs_sb->mount_opts.use_uid ? inode->i_uid = befs_sb->mount_opts.use_uid ?
befs_sb->mount_opts.uid : befs_sb->mount_opts.uid :
...@@ -352,14 +352,14 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino) ...@@ -352,14 +352,14 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino)
* BEFS's time is 64 bits, but current VFS is 32 bits... * BEFS's time is 64 bits, but current VFS is 32 bits...
* BEFS don't have access time. Nor inode change time. VFS * BEFS don't have access time. Nor inode change time. VFS
* doesn't have creation time. * doesn't have creation time.
* Also, the lower 16 bits of the last_modified_time and * Also, the lower 16 bits of the last_modified_time and
* create_time are just a counter to help ensure uniqueness * create_time are just a counter to help ensure uniqueness
* for indexing purposes. (PFD, page 54) * for indexing purposes. (PFD, page 54)
*/ */
inode->i_mtime.tv_sec = inode->i_mtime.tv_sec =
fs64_to_cpu(sb, raw_inode->last_modified_time) >> 16; fs64_to_cpu(sb, raw_inode->last_modified_time) >> 16;
inode->i_mtime.tv_nsec = 0; /* lower 16 bits are not a time */ inode->i_mtime.tv_nsec = 0; /* lower 16 bits are not a time */
inode->i_ctime = inode->i_mtime; inode->i_ctime = inode->i_mtime;
inode->i_atime = inode->i_mtime; inode->i_atime = inode->i_mtime;
...@@ -441,7 +441,7 @@ befs_init_inodecache(void) ...@@ -441,7 +441,7 @@ befs_init_inodecache(void)
} }
/* Called at fs teardown. /* Called at fs teardown.
* *
* Taken from NFS implementation by Al Viro. * Taken from NFS implementation by Al Viro.
*/ */
static void static void
...@@ -491,7 +491,7 @@ static int befs_symlink_readpage(struct file *unused, struct page *page) ...@@ -491,7 +491,7 @@ static int befs_symlink_readpage(struct file *unused, struct page *page)
/* /*
* UTF-8 to NLS charset convert routine * UTF-8 to NLS charset convert routine
* *
* Uses uni2char() / char2uni() rather than the nls tables directly * Uses uni2char() / char2uni() rather than the nls tables directly
*/ */
static int static int
...@@ -556,18 +556,18 @@ befs_utf2nls(struct super_block *sb, const char *in, ...@@ -556,18 +556,18 @@ befs_utf2nls(struct super_block *sb, const char *in,
* @in_len: Length of input string in bytes * @in_len: Length of input string in bytes
* @out: The output string in UTF-8 format * @out: The output string in UTF-8 format
* @out_len: Length of the output buffer * @out_len: Length of the output buffer
* *
* Converts input string @in, which is in the format of the loaded NLS map, * Converts input string @in, which is in the format of the loaded NLS map,
* into a utf8 string. * into a utf8 string.
* *
* The destination string @out is allocated by this function and the caller is * The destination string @out is allocated by this function and the caller is
* responsible for freeing it with kfree() * responsible for freeing it with kfree()
* *
* On return, *@out_len is the length of @out in bytes. * On return, *@out_len is the length of @out in bytes.
* *
* On success, the return value is the number of utf8 characters written to * On success, the return value is the number of utf8 characters written to
* the output buffer @out. * the output buffer @out.
* *
* On Failure, a negative number coresponding to the error code is returned. * On Failure, a negative number coresponding to the error code is returned.
*/ */
...@@ -719,7 +719,7 @@ parse_options(char *options, struct befs_mount_options *opts) ...@@ -719,7 +719,7 @@ parse_options(char *options, struct befs_mount_options *opts)
} }
/* This function has the responsibiltiy of getting the /* This function has the responsibiltiy of getting the
* filesystem ready for unmounting. * filesystem ready for unmounting.
* Basically, we free everything that we allocated in * Basically, we free everything that we allocated in
* befs_read_inode * befs_read_inode
*/ */
...@@ -780,7 +780,7 @@ befs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -780,7 +780,7 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
* Linux 2.4.10 and later refuse to read blocks smaller than * Linux 2.4.10 and later refuse to read blocks smaller than
* the logical block size for the device. But we also need to read at * the logical block size for the device. But we also need to read at
* least 1k to get the second 512 bytes of the volume. * least 1k to get the second 512 bytes of the volume.
*/ */
blocksize = sb_min_blocksize(sb, 1024); blocksize = sb_min_blocksize(sb, 1024);
if (!blocksize) { if (!blocksize) {
if (!silent) if (!silent)
...@@ -917,7 +917,7 @@ static struct file_system_type befs_fs_type = { ...@@ -917,7 +917,7 @@ static struct file_system_type befs_fs_type = {
.name = "befs", .name = "befs",
.mount = befs_mount, .mount = befs_mount,
.kill_sb = kill_block_super, .kill_sb = kill_block_super,
.fs_flags = FS_REQUIRES_DEV, .fs_flags = FS_REQUIRES_DEV,
}; };
MODULE_ALIAS_FS("befs"); MODULE_ALIAS_FS("befs");
......
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