mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
new helper: file_inode(file)
Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
57eccb830f
commit
496ad9aa8e
306 changed files with 696 additions and 717 deletions
12
fs/ioctl.c
12
fs/ioctl.c
|
|
@ -175,7 +175,7 @@ static int ioctl_fiemap(struct file *filp, unsigned long arg)
|
|||
struct fiemap fiemap;
|
||||
struct fiemap __user *ufiemap = (struct fiemap __user *) arg;
|
||||
struct fiemap_extent_info fieinfo = { 0, };
|
||||
struct inode *inode = filp->f_path.dentry->d_inode;
|
||||
struct inode *inode = file_inode(filp);
|
||||
struct super_block *sb = inode->i_sb;
|
||||
u64 len;
|
||||
int error;
|
||||
|
|
@ -424,7 +424,7 @@ EXPORT_SYMBOL(generic_block_fiemap);
|
|||
*/
|
||||
int ioctl_preallocate(struct file *filp, void __user *argp)
|
||||
{
|
||||
struct inode *inode = filp->f_path.dentry->d_inode;
|
||||
struct inode *inode = file_inode(filp);
|
||||
struct space_resv sr;
|
||||
|
||||
if (copy_from_user(&sr, argp, sizeof(sr)))
|
||||
|
|
@ -449,7 +449,7 @@ int ioctl_preallocate(struct file *filp, void __user *argp)
|
|||
static int file_ioctl(struct file *filp, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
struct inode *inode = filp->f_path.dentry->d_inode;
|
||||
struct inode *inode = file_inode(filp);
|
||||
int __user *p = (int __user *)arg;
|
||||
|
||||
switch (cmd) {
|
||||
|
|
@ -512,7 +512,7 @@ static int ioctl_fioasync(unsigned int fd, struct file *filp,
|
|||
|
||||
static int ioctl_fsfreeze(struct file *filp)
|
||||
{
|
||||
struct super_block *sb = filp->f_path.dentry->d_inode->i_sb;
|
||||
struct super_block *sb = file_inode(filp)->i_sb;
|
||||
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return -EPERM;
|
||||
|
|
@ -527,7 +527,7 @@ static int ioctl_fsfreeze(struct file *filp)
|
|||
|
||||
static int ioctl_fsthaw(struct file *filp)
|
||||
{
|
||||
struct super_block *sb = filp->f_path.dentry->d_inode->i_sb;
|
||||
struct super_block *sb = file_inode(filp)->i_sb;
|
||||
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return -EPERM;
|
||||
|
|
@ -548,7 +548,7 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
|
|||
{
|
||||
int error = 0;
|
||||
int __user *argp = (int __user *)arg;
|
||||
struct inode *inode = filp->f_path.dentry->d_inode;
|
||||
struct inode *inode = file_inode(filp);
|
||||
|
||||
switch (cmd) {
|
||||
case FIOCLEX:
|
||||
|
|
|
|||
Loading…
Reference in a new issue