ioctl.c (faa3d77749ad30d2e1c48e2e4363b9c4889aca27) ioctl.c (572d8b3945a31bee7c40d21556803e4807fd9141)
1/*
2 * ioctl.c - NILFS ioctl operations.
3 *
4 * Copyright (C) 2007, 2008 Nippon Telegraph and Telephone Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

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

177 ret = mnt_want_write_file(filp);
178 if (ret)
179 return ret;
180
181 ret = -EFAULT;
182 if (copy_from_user(&cpmode, argp, sizeof(cpmode)))
183 goto out;
184
1/*
2 * ioctl.c - NILFS ioctl operations.
3 *
4 * Copyright (C) 2007, 2008 Nippon Telegraph and Telephone Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

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

177 ret = mnt_want_write_file(filp);
178 if (ret)
179 return ret;
180
181 ret = -EFAULT;
182 if (copy_from_user(&cpmode, argp, sizeof(cpmode)))
183 goto out;
184
185 down_read(&inode->i_sb->s_umount);
185 mutex_lock(&nilfs->ns_snapshot_mount_mutex);
186
187 nilfs_transaction_begin(inode->i_sb, &ti, 0);
188 ret = nilfs_cpfile_change_cpmode(
189 nilfs->ns_cpfile, cpmode.cm_cno, cpmode.cm_mode);
190 if (unlikely(ret < 0))
191 nilfs_transaction_abort(inode->i_sb);
192 else
193 nilfs_transaction_commit(inode->i_sb); /* never fails */
194
186
187 nilfs_transaction_begin(inode->i_sb, &ti, 0);
188 ret = nilfs_cpfile_change_cpmode(
189 nilfs->ns_cpfile, cpmode.cm_cno, cpmode.cm_mode);
190 if (unlikely(ret < 0))
191 nilfs_transaction_abort(inode->i_sb);
192 else
193 nilfs_transaction_commit(inode->i_sb); /* never fails */
194
195 up_read(&inode->i_sb->s_umount);
195 mutex_unlock(&nilfs->ns_snapshot_mount_mutex);
196out:
197 mnt_drop_write_file(filp);
198 return ret;
199}
200
201static int
202nilfs_ioctl_delete_checkpoint(struct inode *inode, struct file *filp,
203 unsigned int cmd, void __user *argp)

--- 671 unchanged lines hidden ---
196out:
197 mnt_drop_write_file(filp);
198 return ret;
199}
200
201static int
202nilfs_ioctl_delete_checkpoint(struct inode *inode, struct file *filp,
203 unsigned int cmd, void __user *argp)

--- 671 unchanged lines hidden ---