aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/dir.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-07-24 07:52:45 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-08-13 04:35:16 -0400
commitdab4b4d2f915a65022343012a795f4ae4ae7e83c (patch)
tree13a1ec2c5f6b18781145bccddf2fb63017a1336b /fs/ubifs/dir.c
parent547000da6412c45456ff2ff44a171d01027bd727 (diff)
UBIFS: align inode data to eight
UBIFS aligns node lengths to 8, so budgeting has to do the same. Well, direntry, inode, and page budgets are already aligned, but not inode data budget (e.g., data in special devices or symlinks). Do this for inode data as well. Also, add corresponding debugging checks. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/dir.c')
-rw-r--r--fs/ubifs/dir.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index a79e850fee6d..eba3a8a7c333 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -525,7 +525,7 @@ static int ubifs_link(struct dentry *old_dentry, struct inode *dir,
525 struct ubifs_inode *dir_ui = ubifs_inode(dir); 525 struct ubifs_inode *dir_ui = ubifs_inode(dir);
526 int err, sz_change = CALC_DENT_SIZE(dentry->d_name.len); 526 int err, sz_change = CALC_DENT_SIZE(dentry->d_name.len);
527 struct ubifs_budget_req req = { .new_dent = 1, .dirtied_ino = 2, 527 struct ubifs_budget_req req = { .new_dent = 1, .dirtied_ino = 2,
528 .dirtied_ino_d = ui->data_len }; 528 .dirtied_ino_d = ALIGN(ui->data_len, 8) };
529 529
530 /* 530 /*
531 * Budget request settings: new direntry, changing the target inode, 531 * Budget request settings: new direntry, changing the target inode,
@@ -788,7 +788,8 @@ static int ubifs_mknod(struct inode *dir, struct dentry *dentry,
788 int sz_change = CALC_DENT_SIZE(dentry->d_name.len); 788 int sz_change = CALC_DENT_SIZE(dentry->d_name.len);
789 int err, devlen = 0; 789 int err, devlen = 0;
790 struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1, 790 struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
791 .new_ino_d = devlen, .dirtied_ino = 1 }; 791 .new_ino_d = ALIGN(devlen, 8),
792 .dirtied_ino = 1 };
792 793
793 /* 794 /*
794 * Budget request settings: new inode, new direntry and changing parent 795 * Budget request settings: new inode, new direntry and changing parent
@@ -862,7 +863,8 @@ static int ubifs_symlink(struct inode *dir, struct dentry *dentry,
862 int err, len = strlen(symname); 863 int err, len = strlen(symname);
863 int sz_change = CALC_DENT_SIZE(dentry->d_name.len); 864 int sz_change = CALC_DENT_SIZE(dentry->d_name.len);
864 struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1, 865 struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
865 .new_ino_d = len, .dirtied_ino = 1 }; 866 .new_ino_d = ALIGN(len, 8),
867 .dirtied_ino = 1 };
866 868
867 /* 869 /*
868 * Budget request settings: new inode, new direntry and changing parent 870 * Budget request settings: new inode, new direntry and changing parent
@@ -1011,7 +1013,7 @@ static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry,
1011 struct ubifs_budget_req req = { .new_dent = 1, .mod_dent = 1, 1013 struct ubifs_budget_req req = { .new_dent = 1, .mod_dent = 1,
1012 .dirtied_ino = 3 }; 1014 .dirtied_ino = 3 };
1013 struct ubifs_budget_req ino_req = { .dirtied_ino = 1, 1015 struct ubifs_budget_req ino_req = { .dirtied_ino = 1,
1014 .dirtied_ino_d = old_inode_ui->data_len }; 1016 .dirtied_ino_d = ALIGN(old_inode_ui->data_len, 8) };
1015 struct timespec time; 1017 struct timespec time;
1016 1018
1017 /* 1019 /*