ioctl.c (ac78a07893d24d95ff5f39d0433c25210f224f07) ioctl.c (205cb37b89ab37db553907e5ac17962eec561804)
1/*
2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
3 */
4
5#include <linux/capability.h>
6#include <linux/fs.h>
7#include <linux/mount.h>
8#include <linux/reiserfs_fs.h>

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

15/*
16 * reiserfs_ioctl - handler for ioctl for inode
17 * supported commands:
18 * 1) REISERFS_IOC_UNPACK - try to unpack tail from direct item into indirect
19 * and prevent packing file (argument arg has to be non-zero)
20 * 2) REISERFS_IOC_[GS]ETFLAGS, REISERFS_IOC_[GS]ETVERSION
21 * 3) That's all for a while ...
22 */
1/*
2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
3 */
4
5#include <linux/capability.h>
6#include <linux/fs.h>
7#include <linux/mount.h>
8#include <linux/reiserfs_fs.h>

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

15/*
16 * reiserfs_ioctl - handler for ioctl for inode
17 * supported commands:
18 * 1) REISERFS_IOC_UNPACK - try to unpack tail from direct item into indirect
19 * and prevent packing file (argument arg has to be non-zero)
20 * 2) REISERFS_IOC_[GS]ETFLAGS, REISERFS_IOC_[GS]ETVERSION
21 * 3) That's all for a while ...
22 */
23int reiserfs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
24 unsigned long arg)
23long reiserfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
25{
24{
25 struct inode *inode = filp->f_path.dentry->d_inode;
26 unsigned int flags;
27 int err = 0;
28
29 reiserfs_write_lock(inode->i_sb);
30
31 switch (cmd) {
32 case REISERFS_IOC_UNPACK:
33 if (S_ISREG(inode->i_mode)) {

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

127
128 return err;
129}
130
131#ifdef CONFIG_COMPAT
132long reiserfs_compat_ioctl(struct file *file, unsigned int cmd,
133 unsigned long arg)
134{
26 unsigned int flags;
27 int err = 0;
28
29 reiserfs_write_lock(inode->i_sb);
30
31 switch (cmd) {
32 case REISERFS_IOC_UNPACK:
33 if (S_ISREG(inode->i_mode)) {

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

127
128 return err;
129}
130
131#ifdef CONFIG_COMPAT
132long reiserfs_compat_ioctl(struct file *file, unsigned int cmd,
133 unsigned long arg)
134{
135 struct inode *inode = file->f_path.dentry->d_inode;
136 int ret;
137
138 /* These are just misnamed, they actually get/put from/to user an int */
139 switch (cmd) {
140 case REISERFS_IOC32_UNPACK:
141 cmd = REISERFS_IOC_UNPACK;
142 break;
143 case REISERFS_IOC32_GETFLAGS:
144 cmd = REISERFS_IOC_GETFLAGS;
145 break;

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

151 break;
152 case REISERFS_IOC32_SETVERSION:
153 cmd = REISERFS_IOC_SETVERSION;
154 break;
155 default:
156 return -ENOIOCTLCMD;
157 }
158
135 /* These are just misnamed, they actually get/put from/to user an int */
136 switch (cmd) {
137 case REISERFS_IOC32_UNPACK:
138 cmd = REISERFS_IOC_UNPACK;
139 break;
140 case REISERFS_IOC32_GETFLAGS:
141 cmd = REISERFS_IOC_GETFLAGS;
142 break;

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

148 break;
149 case REISERFS_IOC32_SETVERSION:
150 cmd = REISERFS_IOC_SETVERSION;
151 break;
152 default:
153 return -ENOIOCTLCMD;
154 }
155
159 ret = reiserfs_ioctl(inode, file, cmd, (unsigned long) compat_ptr(arg));
160
161 return ret;
156 return reiserfs_ioctl(file, cmd, (unsigned long) compat_ptr(arg));
162}
163#endif
164
165int reiserfs_commit_write(struct file *f, struct page *page,
166 unsigned from, unsigned to);
167int reiserfs_prepare_write(struct file *f, struct page *page,
168 unsigned from, unsigned to);
169/*

--- 64 unchanged lines hidden ---
157}
158#endif
159
160int reiserfs_commit_write(struct file *f, struct page *page,
161 unsigned from, unsigned to);
162int reiserfs_prepare_write(struct file *f, struct page *page,
163 unsigned from, unsigned to);
164/*

--- 64 unchanged lines hidden ---