lkml.org 
[lkml]   [2006]   [Sep]   [4]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 4 Sep 2006 08:59:08 +0200 (MEST)
FromJan Engelhardt <>
SubjectRe: [PATCH 05/22][RFC] Unionfs: Copyup Functionality
>+/* Determine the mode based on the copyup flags, and the existing dentry. */
>+static int copyup_permissions(struct super_block *sb,
>+			      struct dentry *old_hidden_dentry,
>+			      struct dentry *new_hidden_dentry)
>+{
>+	struct iattr newattrs;
>+	int err;
>+
>+	newattrs.ia_atime = old_hidden_dentry->d_inode->i_atime;
>+	newattrs.ia_mtime = old_hidden_dentry->d_inode->i_mtime;
>+	newattrs.ia_ctime = old_hidden_dentry->d_inode->i_ctime;

How about,

	struct inode *ohi = old_hidden_dentry->d_inode;
	newattrs.ia_atime = ohi->i_atime;

reduces typing a little.

>+	if (S_ISDIR(old_mode)) {
>+		args.u.mkdir.parent = new_hidden_parent_dentry->d_inode;
>+		args.u.mkdir.dentry = new_hidden_dentry;
>+		args.u.mkdir.mode = old_mode;

Like above maybe?

>+	} else {
>+		printk(KERN_ERR "Unknown inode type %d\n",
>+				old_mode);
>+		BUG();
>+	}

Is BUG the right thing, what do others think? (Using WARN, and set err to
something useful?)

>+	} while ((read_bytes > 0) && (len > 0));

-()

>+/* This function creates a copy of a file represented by 'file' which currently
>+ * resides in branch 'bstart' to branch 'new_bindex.
                                                     ^

+'

>+struct dentry *create_parents(struct inode *dir, struct dentry *dentry,
>+			      int bindex)
>+{
>+	struct dentry *hidden_dentry;
>+
>+	hidden_dentry =
>+	    create_parents_named(dir, dentry, dentry->d_name.name, bindex);
>+
>+	return (hidden_dentry);
>+}

{
	return create_parents_named(dir, dentry, dentry->d_name.name, bindex);
}

>+struct dentry *create_parents_named(struct inode *dir, struct dentry *dentry,
>+				    const char *name, int bindex)
>+{
>+	struct dentry **path = NULL;
>+	path = (struct dentry **)kzalloc(kmalloc_size, GFP_KERNEL);

Nocast.

>+	if (!path)
>+		;

Woha?!

>+			tmp_path =
>+			    (struct dentry **)kzalloc(kmalloc_size, GFP_KERNEL);

Nocast.



Jan Engelhardt
-- 

-- 
VGER BF report: H 0
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-09-04 09:05    [from the cache]
©2003-2008