Messages in this thread | | | Date | Sat, 6 Oct 2012 19:59:21 +0100 | From | Al Viro <> | Subject | Re: [PATCH 11/16] f2fs: add inode operations for special inodes |
| |
On Fri, Oct 05, 2012 at 09:03:09PM +0900, ????????? wrote: > +static int f2fs_create(struct inode *dir, struct dentry *dentry, umode_t mode, > + bool excl) > +{ > + struct super_block *sb = dir->i_sb; > + struct f2fs_sb_info *sbi = F2FS_SB(sb); > + struct inode *inode; > + nid_t ino = 0; > + int err; > + > + if (dentry->d_name.len > F2FS_MAX_NAME_LEN) > + return -ENAMETOOLONG;
Pointless - failing those on ->lookup() with ENAMETOOLONG is enough. The same goes for all entry creation methods.
> + if (inode->i_nlink >= F2FS_LINK_MAX) > + return -EMLINK;
Just set ->s_max_links and be done with that.
> + if (dir->i_nlink >= F2FS_LINK_MAX) > + return err;
Ditto.
> + if (old_dir_entry) { > + err = -EMLINK; > + if (new_dir->i_nlink >= F2FS_LINK_MAX) > + goto out_dir;
... and here as well.
| |