/* * Do the filesystem syncing work. For simple filesystems * writeback_inodes_sb(sb) just dirties buffers with inodes so we have to * submit IO for these buffers via __sync_blockdev(). This also speeds up the * wait == 1 case since in that case write_inode() functions do * sync_dirty_buffer() and thus effectively write one block at a time. */ static int __sync_filesystem(struct super_block *sb, int wait) { if (wait) sync_inodes_sb(sb); else writeback_inodes_sb(sb, WB_REASON_SYNC); if (sb->s_op->sync_fs) sb->s_op->sync_fs(sb, wait); return __sync_blockdev(sb->s_bdev, wait); }
static int ecryptfs_release(struct inode *inode, struct file *file) { #ifdef CONFIG_SDP struct ecryptfs_crypt_stat *crypt_stat; crypt_stat = &ecryptfs_inode_to_private(inode)->crypt_stat; if(crypt_stat->flags & ECRYPTFS_DEK_IS_SENSITIVE) { #if 0 #ifdef SYNC_ONLY_CURRENT_SB struct super_block *sb = inode->i_sb; sync_inodes_sb(sb); writeback_inodes_sb(sb, WB_REASON_SYNC); #else sys_sync(); #endif DEK_LOGD("%s() sensitive inode being closed. [ino:%lu, state:%lu ref_count:%d efs_flag:0x%0.8x]\n", __func__, inode->i_ino, inode->i_state, atomic_read(&inode->i_count), crypt_stat->flags); spin_lock(&inode->i_lock); if ((inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW)) || (inode->i_mapping->nrpages == 0)) { spin_unlock(&inode->i_lock); } else { printk("freeing sensitive inode\n"); invalidate_mapping_pages(inode->i_mapping, 0, -1); } spin_unlock(&inode->i_lock); #else DEK_LOGD("%s() sensitive inode being closed. [ino:%lu, state:%lu ref_count:%d]\n", __func__, inode->i_ino, inode->i_state, atomic_read(&inode->i_count)); ecryptfs_clean_sdp_dek(crypt_stat); if(ecryptfs_is_persona_locked(crypt_stat->userid)) ecryptfs_mm_drop_cache(crypt_stat->userid); } #endif #endif ecryptfs_put_lower_file(inode); kmem_cache_free(ecryptfs_file_info_cache, ecryptfs_file_to_private(file)); return 0; }
static int __sync_filesystem(struct super_block *sb, int wait) { if (sb->s_bdi == &noop_backing_dev_info) return 0; if (sb->s_qcop && sb->s_qcop->quota_sync) sb->s_qcop->quota_sync(sb, -1, wait); if (wait) sync_inodes_sb(sb); else writeback_inodes_sb(sb, WB_REASON_SYNC); if (sb->s_op->sync_fs) sb->s_op->sync_fs(sb, wait); return __sync_blockdev(sb->s_bdev, wait); }
/* * Do the filesystem syncing work. For simple filesystems * writeback_inodes_sb(sb) just dirties buffers with inodes so we have to * submit IO for these buffers via __sync_blockdev(). This also speeds up the * wait == 1 case since in that case write_inode() functions do * sync_dirty_buffer() and thus effectively write one block at a time. */ static int __sync_filesystem(struct super_block *sb, int wait) { /* * This should be safe, as we require bdi backing to actually * write out data in the first place */ if (sb->s_bdi == &noop_backing_dev_info) return 0; if (sb->s_qcop && sb->s_qcop->quota_sync) sb->s_qcop->quota_sync(sb, -1, wait); if (wait) sync_inodes_sb(sb); else writeback_inodes_sb(sb); if (sb->s_op->sync_fs) sb->s_op->sync_fs(sb, wait); return __sync_blockdev(sb->s_bdev, wait); }
static int __sync_filesystem(struct super_block *sb, int wait) { #ifdef FEATURE_PRINT_FSYNC_PID char b[BDEVNAME_SIZE]; #endif /* * This should be safe, as we require bdi backing to actually * write out data in the first place */ if (sb->s_bdi == &noop_backing_dev_info) return 0; if (sb->s_qcop && sb->s_qcop->quota_sync) sb->s_qcop->quota_sync(sb, -1, wait); if (wait) sync_inodes_sb(sb); else writeback_inodes_sb(sb, WB_REASON_SYNC); if (sb->s_op->sync_fs) sb->s_op->sync_fs(sb, wait); #ifdef FEATURE_PRINT_FSYNC_PID if(sb->s_bdev != NULL) { if((!memcmp(bdevname(sb->s_bdev, b),"mmcblk0",7))) fs_sync_mmcblk0_log(); else if((!memcmp(bdevname(sb->s_bdev, b),"mmcblk1",7))) fs_sync_mmcblk1_log(); } #endif return __sync_blockdev(sb->s_bdev, wait); }
static void sync_inodes_one_sb(struct super_block *sb, void *arg) { if (!(sb->s_flags & MS_RDONLY)) sync_inodes_sb(sb); }