dir.c (18bb1db3e7607e4a997d50991a6f9fa5b0f8722c) dir.c (4acdaf27ebe2034c342f3be57ef49aed1ad885ef)
1/* * This file is part of UBIFS.
2 *
3 * Copyright (C) 2006-2008 Nokia Corporation.
4 * Copyright (C) 2006, 2007 University of Szeged, Hungary
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by
8 * the Free Software Foundation.

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

248 d_add(dentry, inode);
249 return NULL;
250
251out:
252 kfree(dent);
253 return ERR_PTR(err);
254}
255
1/* * This file is part of UBIFS.
2 *
3 * Copyright (C) 2006-2008 Nokia Corporation.
4 * Copyright (C) 2006, 2007 University of Szeged, Hungary
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by
8 * the Free Software Foundation.

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

248 d_add(dentry, inode);
249 return NULL;
250
251out:
252 kfree(dent);
253 return ERR_PTR(err);
254}
255
256static int ubifs_create(struct inode *dir, struct dentry *dentry, int mode,
256static int ubifs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
257 struct nameidata *nd)
258{
259 struct inode *inode;
260 struct ubifs_info *c = dir->i_sb->s_fs_info;
261 int err, sz_change = CALC_DENT_SIZE(dentry->d_name.len);
262 struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
263 .dirtied_ino = 1 };
264 struct ubifs_inode *dir_ui = ubifs_inode(dir);
265
266 /*
267 * Budget request settings: new inode, new direntry, changing the
268 * parent directory inode.
269 */
270
257 struct nameidata *nd)
258{
259 struct inode *inode;
260 struct ubifs_info *c = dir->i_sb->s_fs_info;
261 int err, sz_change = CALC_DENT_SIZE(dentry->d_name.len);
262 struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
263 .dirtied_ino = 1 };
264 struct ubifs_inode *dir_ui = ubifs_inode(dir);
265
266 /*
267 * Budget request settings: new inode, new direntry, changing the
268 * parent directory inode.
269 */
270
271 dbg_gen("dent '%.*s', mode %#x in dir ino %lu",
271 dbg_gen("dent '%.*s', mode %#hx in dir ino %lu",
272 dentry->d_name.len, dentry->d_name.name, mode, dir->i_ino);
273
274 err = ubifs_budget_space(c, &req);
275 if (err)
276 return err;
277
278 inode = ubifs_new_inode(c, dir, mode);
279 if (IS_ERR(inode)) {

--- 929 unchanged lines hidden ---
272 dentry->d_name.len, dentry->d_name.name, mode, dir->i_ino);
273
274 err = ubifs_budget_space(c, &req);
275 if (err)
276 return err;
277
278 inode = ubifs_new_inode(c, dir, mode);
279 if (IS_ERR(inode)) {

--- 929 unchanged lines hidden ---