lkml.org 
[lkml]   [2006]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/22][RFC] Unionfs: Common file operations

>+ if (!d_deleted(dentry) &&
>+ ((sbgen > fgen) || (dbstart(dentry) != fbstart(file)))) {

(sbgen > fgen || dbstart(dentry) != fbstart(file)) should suffice. (Read:
reduce the amount of "()" depth.)
>+int unionfs_file_release(struct inode *inode, struct file *file)
>+{
>+ int err = 0;
>+ struct file *hidden_file = NULL;
>+ int bindex, bstart, bend;
>+ int fgen;
>+
>+ /* fput all the hidden files */
>+ fgen = atomic_read(&ftopd(file)->ufi_generation);
>+ bstart = fbstart(file);
>+ bend = fbend(file);
>+
>+ for (bindex = bstart; bindex <= bend; bindex++) {
>+ hidden_file = ftohf_index(file, bindex);
>+
>+ if (hidden_file) {
>+ fput(hidden_file);
>+ unionfs_read_lock(inode->i_sb);
>+ branchput(inode->i_sb, bindex);
>+ unionfs_read_unlock(inode->i_sb);
>+ }
>+ }
>+ kfree(ftohf_ptr(file));
>+
>+ if (ftopd(file)->rdstate) {
>+ ftopd(file)->rdstate->uds_access = jiffies;
>+ printk(KERN_DEBUG "Saving rdstate with cookie %u [%d.%lld]\n",
>+ ftopd(file)->rdstate->uds_cookie,
>+ ftopd(file)->rdstate->uds_bindex,
>+ (long long)ftopd(file)->rdstate->uds_dirpos);
>+ spin_lock(&itopd(inode)->uii_rdlock);
>+ itopd(inode)->uii_rdcount++;
>+ list_add_tail(&ftopd(file)->rdstate->uds_cache,
>+ &itopd(inode)->uii_readdircache);
>+ mark_inode_dirty(inode);
>+ spin_unlock(&itopd(inode)->uii_rdlock);
>+ ftopd(file)->rdstate = NULL;
>+ }
>+ kfree(ftopd(file));
>+ return err;
>+}

"err" is unused in this function. Rid it.

>+ }
>+ }
>+
>+ }



Jan Engelhardt
--
-
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-01 14:57    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site