inode.c (bef986502fa398b1785a3979b1aa17cd902d3527) inode.c (fec6d055da71fb02a76f9c2c12427fa79974018b)
1/*
2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
3 */
4
5#include <linux/time.h>
6#include <linux/fs.h>
7#include <linux/reiserfs_fs.h>
8#include <linux/reiserfs_acl.h>

--- 193 unchanged lines hidden (view full) ---

202 if (get_inode_item_key_version(inode) != KEY_FORMAT_3_5 || // it is new file.
203 block < (1 << (31 - inode->i_sb->s_blocksize_bits))) // old file, but 'block' is inside of 2gb
204 return 1;
205
206 return 0;
207}
208
209/*static*/ int restart_transaction(struct reiserfs_transaction_handle *th,
1/*
2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
3 */
4
5#include <linux/time.h>
6#include <linux/fs.h>
7#include <linux/reiserfs_fs.h>
8#include <linux/reiserfs_acl.h>

--- 193 unchanged lines hidden (view full) ---

202 if (get_inode_item_key_version(inode) != KEY_FORMAT_3_5 || // it is new file.
203 block < (1 << (31 - inode->i_sb->s_blocksize_bits))) // old file, but 'block' is inside of 2gb
204 return 1;
205
206 return 0;
207}
208
209/*static*/ int restart_transaction(struct reiserfs_transaction_handle *th,
210 struct inode *inode, struct path *path)
210 struct inode *inode, struct treepath *path)
211{
212 struct super_block *s = th->t_super;
213 int len = th->t_blocks_allocated;
214 int err;
215
216 BUG_ON(!th->t_trans_id);
217 BUG_ON(!th->t_refcount);
218

--- 346 unchanged lines hidden (view full) ---

565 out:
566 return retval;
567}
568
569static inline int _allocate_block(struct reiserfs_transaction_handle *th,
570 long block,
571 struct inode *inode,
572 b_blocknr_t * allocated_block_nr,
211{
212 struct super_block *s = th->t_super;
213 int len = th->t_blocks_allocated;
214 int err;
215
216 BUG_ON(!th->t_trans_id);
217 BUG_ON(!th->t_refcount);
218

--- 346 unchanged lines hidden (view full) ---

565 out:
566 return retval;
567}
568
569static inline int _allocate_block(struct reiserfs_transaction_handle *th,
570 long block,
571 struct inode *inode,
572 b_blocknr_t * allocated_block_nr,
573 struct path *path, int flags)
573 struct treepath *path, int flags)
574{
575 BUG_ON(!th->t_trans_id);
576
577#ifdef REISERFS_PREALLOCATE
578 if (!(flags & GET_BLOCK_NO_IMUX)) {
579 return reiserfs_new_unf_blocknrs2(th, inode, allocated_block_nr,
580 path, block);
581 }

--- 520 unchanged lines hidden (view full) ---

1102//
1103// BAD: new directories have stat data of new type and all other items
1104// of old type. Version stored in the inode says about body items, so
1105// in update_stat_data we can not rely on inode, but have to check
1106// item version directly
1107//
1108
1109// called by read_locked_inode
574{
575 BUG_ON(!th->t_trans_id);
576
577#ifdef REISERFS_PREALLOCATE
578 if (!(flags & GET_BLOCK_NO_IMUX)) {
579 return reiserfs_new_unf_blocknrs2(th, inode, allocated_block_nr,
580 path, block);
581 }

--- 520 unchanged lines hidden (view full) ---

1102//
1103// BAD: new directories have stat data of new type and all other items
1104// of old type. Version stored in the inode says about body items, so
1105// in update_stat_data we can not rely on inode, but have to check
1106// item version directly
1107//
1108
1109// called by read_locked_inode
1110static void init_inode(struct inode *inode, struct path *path)
1110static void init_inode(struct inode *inode, struct treepath *path)
1111{
1112 struct buffer_head *bh;
1113 struct item_head *ih;
1114 __u32 rdev;
1115 //int version = ITEM_VERSION_1;
1116
1117 bh = PATH_PLAST_BUFFER(path);
1118 ih = PATH_PITEM_HEAD(path);

--- 160 unchanged lines hidden (view full) ---

1279 // Sigh. i_first_direct_byte is back
1280 set_sd_v1_first_direct_byte(sd_v1,
1281 REISERFS_I(inode)->i_first_direct_byte);
1282}
1283
1284/* NOTE, you must prepare the buffer head before sending it here,
1285** and then log it after the call
1286*/
1111{
1112 struct buffer_head *bh;
1113 struct item_head *ih;
1114 __u32 rdev;
1115 //int version = ITEM_VERSION_1;
1116
1117 bh = PATH_PLAST_BUFFER(path);
1118 ih = PATH_PITEM_HEAD(path);

--- 160 unchanged lines hidden (view full) ---

1279 // Sigh. i_first_direct_byte is back
1280 set_sd_v1_first_direct_byte(sd_v1,
1281 REISERFS_I(inode)->i_first_direct_byte);
1282}
1283
1284/* NOTE, you must prepare the buffer head before sending it here,
1285** and then log it after the call
1286*/
1287static void update_stat_data(struct path *path, struct inode *inode,
1287static void update_stat_data(struct treepath *path, struct inode *inode,
1288 loff_t size)
1289{
1290 struct buffer_head *bh;
1291 struct item_head *ih;
1292
1293 bh = PATH_PLAST_BUFFER(path);
1294 ih = PATH_PITEM_HEAD(path);
1295

--- 352 unchanged lines hidden (view full) ---

1648 }
1649 return 0;
1650}
1651
1652/* stat data of new object is inserted already, this inserts the item
1653 containing "." and ".." entries */
1654static int reiserfs_new_directory(struct reiserfs_transaction_handle *th,
1655 struct inode *inode,
1288 loff_t size)
1289{
1290 struct buffer_head *bh;
1291 struct item_head *ih;
1292
1293 bh = PATH_PLAST_BUFFER(path);
1294 ih = PATH_PITEM_HEAD(path);
1295

--- 352 unchanged lines hidden (view full) ---

1648 }
1649 return 0;
1650}
1651
1652/* stat data of new object is inserted already, this inserts the item
1653 containing "." and ".." entries */
1654static int reiserfs_new_directory(struct reiserfs_transaction_handle *th,
1655 struct inode *inode,
1656 struct item_head *ih, struct path *path,
1656 struct item_head *ih, struct treepath *path,
1657 struct inode *dir)
1658{
1659 struct super_block *sb = th->t_super;
1660 char empty_dir[EMPTY_DIR_SIZE];
1661 char *body = empty_dir;
1662 struct cpu_key key;
1663 int retval;
1664

--- 42 unchanged lines hidden (view full) ---

1707 /* insert item, that is empty directory item */
1708 return reiserfs_insert_item(th, path, &key, ih, inode, body);
1709}
1710
1711/* stat data of object has been inserted, this inserts the item
1712 containing the body of symlink */
1713static int reiserfs_new_symlink(struct reiserfs_transaction_handle *th, struct inode *inode, /* Inode of symlink */
1714 struct item_head *ih,
1657 struct inode *dir)
1658{
1659 struct super_block *sb = th->t_super;
1660 char empty_dir[EMPTY_DIR_SIZE];
1661 char *body = empty_dir;
1662 struct cpu_key key;
1663 int retval;
1664

--- 42 unchanged lines hidden (view full) ---

1707 /* insert item, that is empty directory item */
1708 return reiserfs_insert_item(th, path, &key, ih, inode, body);
1709}
1710
1711/* stat data of object has been inserted, this inserts the item
1712 containing the body of symlink */
1713static int reiserfs_new_symlink(struct reiserfs_transaction_handle *th, struct inode *inode, /* Inode of symlink */
1714 struct item_head *ih,
1715 struct path *path, const char *symname,
1715 struct treepath *path, const char *symname,
1716 int item_len)
1717{
1718 struct super_block *sb = th->t_super;
1719 struct cpu_key key;
1720 int retval;
1721
1722 BUG_ON(!th->t_trans_id);
1723

--- 1290 unchanged lines hidden ---
1716 int item_len)
1717{
1718 struct super_block *sb = th->t_super;
1719 struct cpu_key key;
1720 int retval;
1721
1722 BUG_ON(!th->t_trans_id);
1723

--- 1290 unchanged lines hidden ---