Skip to content

Commit

Permalink
[GFS2] Remove ioctl support
Browse files Browse the repository at this point in the history
The various flags on inodes will in future be set and queried
via the extended attributes interface, so this interface is no
longer required.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Steven Whitehouse committed Mar 21, 2006
1 parent 9a21247 commit 94aabbd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 112 deletions.
95 changes: 0 additions & 95 deletions fs/gfs2/ops_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <linux/blkdev.h>
#include <linux/mm.h>
#include <linux/smp_lock.h>
#include <linux/gfs2_ioctl.h>
#include <linux/fs.h>
#include <linux/gfs2_ondisk.h>
#include <asm/semaphore.h>
Expand Down Expand Up @@ -532,98 +531,6 @@ static int gfs2_readdir(struct file *file, void *dirent, filldir_t filldir)
return error;
}

static int gfs2_ioctl_flags(struct gfs2_inode *ip, unsigned int cmd,
unsigned long arg)
{
unsigned int lmode = (cmd == GFS2_IOCTL_SETFLAGS) ?
LM_ST_EXCLUSIVE : LM_ST_SHARED;
struct buffer_head *dibh;
struct gfs2_holder i_gh;
int error;
__u32 flags = 0, change;

if (cmd == GFS2_IOCTL_SETFLAGS) {
error = get_user(flags, (__u32 __user *)arg);
if (error)
return -EFAULT;
}

error = gfs2_glock_nq_init(ip->i_gl, lmode, 0, &i_gh);
if (error)
return error;

if (cmd == GFS2_IOCTL_SETFLAGS) {
change = flags ^ ip->i_di.di_flags;
error = -EPERM;
if (change & (GFS2_DIF_IMMUTABLE|GFS2_DIF_APPENDONLY)) {
if (!capable(CAP_LINUX_IMMUTABLE))
goto out;
}
error = -EINVAL;
if (flags & (GFS2_DIF_JDATA|GFS2_DIF_DIRECTIO)) {
if (!S_ISREG(ip->i_di.di_mode))
goto out;
}
if (flags &
(GFS2_DIF_INHERIT_JDATA|GFS2_DIF_INHERIT_DIRECTIO)) {
if (!S_ISDIR(ip->i_di.di_mode))
goto out;
}

error = gfs2_trans_begin(ip->i_sbd, RES_DINODE, 0);
if (error)
goto out;

error = gfs2_meta_inode_buffer(ip, &dibh);
if (error)
goto out_trans_end;

ip->i_di.di_flags = flags;

gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);

brelse(dibh);

out_trans_end:
gfs2_trans_end(ip->i_sbd);
} else {
flags = ip->i_di.di_flags;
}
out:
gfs2_glock_dq_uninit(&i_gh);
if (cmd == GFS2_IOCTL_GETFLAGS) {
if (put_user(flags, (__u32 __user *)arg))
return -EFAULT;
}
return error;
}

/**
* gfs2_ioctl - do an ioctl on a file
* @inode: the inode
* @file: the file pointer
* @cmd: the ioctl command
* @arg: the argument
*
* Returns: errno
*/

static int gfs2_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg)
{
struct gfs2_inode *ip = inode->u.generic_ip;

switch (cmd) {
case GFS2_IOCTL_SETFLAGS:
case GFS2_IOCTL_GETFLAGS:
return gfs2_ioctl_flags(ip, cmd, arg);

default:
return -ENOTTY;
}
}

/**
* gfs2_mmap -
* @file: The file to map
Expand Down Expand Up @@ -925,7 +832,6 @@ struct file_operations gfs2_file_fops = {
.write = generic_file_write,
.writev = generic_file_writev,
.aio_write = generic_file_aio_write,
.ioctl = gfs2_ioctl,
.mmap = gfs2_mmap,
.open = gfs2_open,
.release = gfs2_close,
Expand All @@ -937,7 +843,6 @@ struct file_operations gfs2_file_fops = {

struct file_operations gfs2_dir_fops = {
.readdir = gfs2_readdir,
.ioctl = gfs2_ioctl,
.open = gfs2_open,
.release = gfs2_close,
.fsync = gfs2_fsync,
Expand Down
17 changes: 0 additions & 17 deletions include/linux/gfs2_ioctl.h

This file was deleted.

0 comments on commit 94aabbd

Please sign in to comment.