|
@@ -23,14 +23,13 @@
|
|
|
|
|
|
static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
|
|
static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
|
|
{
|
|
{
|
|
- struct super_block *sb = dir->i_sb;
|
|
|
|
- struct f2fs_sb_info *sbi = F2FS_SB(sb);
|
|
|
|
|
|
+ struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb);
|
|
nid_t ino;
|
|
nid_t ino;
|
|
struct inode *inode;
|
|
struct inode *inode;
|
|
bool nid_free = false;
|
|
bool nid_free = false;
|
|
int err;
|
|
int err;
|
|
|
|
|
|
- inode = new_inode(sb);
|
|
|
|
|
|
+ inode = new_inode(dir->i_sb);
|
|
if (!inode)
|
|
if (!inode)
|
|
return ERR_PTR(-ENOMEM);
|
|
return ERR_PTR(-ENOMEM);
|
|
|
|
|
|
@@ -103,8 +102,7 @@ static inline void set_cold_files(struct f2fs_sb_info *sbi, struct inode *inode,
|
|
static int f2fs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
|
static int f2fs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
|
bool excl)
|
|
bool excl)
|
|
{
|
|
{
|
|
- struct super_block *sb = dir->i_sb;
|
|
|
|
- struct f2fs_sb_info *sbi = F2FS_SB(sb);
|
|
|
|
|
|
+ struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb);
|
|
struct inode *inode;
|
|
struct inode *inode;
|
|
nid_t ino = 0;
|
|
nid_t ino = 0;
|
|
int err;
|
|
int err;
|
|
@@ -147,8 +145,7 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir,
|
|
struct dentry *dentry)
|
|
struct dentry *dentry)
|
|
{
|
|
{
|
|
struct inode *inode = old_dentry->d_inode;
|
|
struct inode *inode = old_dentry->d_inode;
|
|
- struct super_block *sb = dir->i_sb;
|
|
|
|
- struct f2fs_sb_info *sbi = F2FS_SB(sb);
|
|
|
|
|
|
+ struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb);
|
|
int err;
|
|
int err;
|
|
|
|
|
|
f2fs_balance_fs(sbi);
|
|
f2fs_balance_fs(sbi);
|
|
@@ -208,8 +205,7 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
|
|
|
|
|
|
static int f2fs_unlink(struct inode *dir, struct dentry *dentry)
|
|
static int f2fs_unlink(struct inode *dir, struct dentry *dentry)
|
|
{
|
|
{
|
|
- struct super_block *sb = dir->i_sb;
|
|
|
|
- struct f2fs_sb_info *sbi = F2FS_SB(sb);
|
|
|
|
|
|
+ struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb);
|
|
struct inode *inode = dentry->d_inode;
|
|
struct inode *inode = dentry->d_inode;
|
|
struct f2fs_dir_entry *de;
|
|
struct f2fs_dir_entry *de;
|
|
struct page *page;
|
|
struct page *page;
|
|
@@ -243,8 +239,7 @@ fail:
|
|
static int f2fs_symlink(struct inode *dir, struct dentry *dentry,
|
|
static int f2fs_symlink(struct inode *dir, struct dentry *dentry,
|
|
const char *symname)
|
|
const char *symname)
|
|
{
|
|
{
|
|
- struct super_block *sb = dir->i_sb;
|
|
|
|
- struct f2fs_sb_info *sbi = F2FS_SB(sb);
|
|
|
|
|
|
+ struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb);
|
|
struct inode *inode;
|
|
struct inode *inode;
|
|
size_t symlen = strlen(symname) + 1;
|
|
size_t symlen = strlen(symname) + 1;
|
|
int err;
|
|
int err;
|
|
@@ -331,8 +326,7 @@ static int f2fs_rmdir(struct inode *dir, struct dentry *dentry)
|
|
static int f2fs_mknod(struct inode *dir, struct dentry *dentry,
|
|
static int f2fs_mknod(struct inode *dir, struct dentry *dentry,
|
|
umode_t mode, dev_t rdev)
|
|
umode_t mode, dev_t rdev)
|
|
{
|
|
{
|
|
- struct super_block *sb = dir->i_sb;
|
|
|
|
- struct f2fs_sb_info *sbi = F2FS_SB(sb);
|
|
|
|
|
|
+ struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb);
|
|
struct inode *inode;
|
|
struct inode *inode;
|
|
int err = 0;
|
|
int err = 0;
|
|
|
|
|
|
@@ -370,8 +364,7 @@ out:
|
|
static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
|
static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
|
struct inode *new_dir, struct dentry *new_dentry)
|
|
struct inode *new_dir, struct dentry *new_dentry)
|
|
{
|
|
{
|
|
- struct super_block *sb = old_dir->i_sb;
|
|
|
|
- struct f2fs_sb_info *sbi = F2FS_SB(sb);
|
|
|
|
|
|
+ struct f2fs_sb_info *sbi = F2FS_SB(old_dir->i_sb);
|
|
struct inode *old_inode = old_dentry->d_inode;
|
|
struct inode *old_inode = old_dentry->d_inode;
|
|
struct inode *new_inode = new_dentry->d_inode;
|
|
struct inode *new_inode = new_dentry->d_inode;
|
|
struct page *old_dir_page;
|
|
struct page *old_dir_page;
|
|
@@ -490,8 +483,7 @@ out:
|
|
|
|
|
|
static int f2fs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
|
|
static int f2fs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
|
|
{
|
|
{
|
|
- struct super_block *sb = dir->i_sb;
|
|
|
|
- struct f2fs_sb_info *sbi = F2FS_SB(sb);
|
|
|
|
|
|
+ struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb);
|
|
struct inode *inode;
|
|
struct inode *inode;
|
|
int err;
|
|
int err;
|
|
|
|
|