aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/xattr_user.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-07-12 23:21:28 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-12 23:21:28 -0400
commitbd4c625c061c2a38568d0add3478f59172455159 (patch)
tree1c44a17c55bce2ee7ad5ea3d15a208ecc0955f74 /fs/reiserfs/xattr_user.c
parent7fa94c8868edfef8cb6a201fcc9a5078b7b961da (diff)
reiserfs: run scripts/Lindent on reiserfs code
This was a pure indentation change, using: scripts/Lindent fs/reiserfs/*.c include/linux/reiserfs_*.h to make reiserfs match the regular Linux indentation style. As Jeff Mahoney <jeffm@suse.com> writes: The ReiserFS code is a mix of a number of different coding styles, sometimes different even from line-to-line. Since the code has been relatively stable for quite some time and there are few outstanding patches to be applied, it is time to reformat the code to conform to the Linux style standard outlined in Documentation/CodingStyle. This patch contains the result of running scripts/Lindent against fs/reiserfs/*.c and include/linux/reiserfs_*.h. There are places where the code can be made to look better, but I'd rather keep those patches separate so that there isn't a subtle by-hand hand accident in the middle of a huge patch. To be clear: This patch is reformatting *only*. A number of patches may follow that continue to make the code more consistent with the Linux coding style. Hans wasn't particularly enthusiastic about these patches, but said he wouldn't really oppose them either. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/reiserfs/xattr_user.c')
-rw-r--r--fs/reiserfs/xattr_user.c89
1 files changed, 44 insertions, 45 deletions
diff --git a/fs/reiserfs/xattr_user.c b/fs/reiserfs/xattr_user.c
index 0772806466a8..51458048ca66 100644
--- a/fs/reiserfs/xattr_user.c
+++ b/fs/reiserfs/xattr_user.c
@@ -13,81 +13,80 @@
13#define XATTR_USER_PREFIX "user." 13#define XATTR_USER_PREFIX "user."
14 14
15static int 15static int
16user_get (struct inode *inode, const char *name, void *buffer, size_t size) 16user_get(struct inode *inode, const char *name, void *buffer, size_t size)
17{ 17{
18 18
19 int error; 19 int error;
20 20
21 if (strlen(name) < sizeof(XATTR_USER_PREFIX)) 21 if (strlen(name) < sizeof(XATTR_USER_PREFIX))
22 return -EINVAL; 22 return -EINVAL;
23 23
24 if (!reiserfs_xattrs_user (inode->i_sb)) 24 if (!reiserfs_xattrs_user(inode->i_sb))
25 return -EOPNOTSUPP; 25 return -EOPNOTSUPP;
26 26
27 error = reiserfs_permission_locked (inode, MAY_READ, NULL); 27 error = reiserfs_permission_locked(inode, MAY_READ, NULL);
28 if (error) 28 if (error)
29 return error; 29 return error;
30 30
31 return reiserfs_xattr_get (inode, name, buffer, size); 31 return reiserfs_xattr_get(inode, name, buffer, size);
32} 32}
33 33
34static int 34static int
35user_set (struct inode *inode, const char *name, const void *buffer, 35user_set(struct inode *inode, const char *name, const void *buffer,
36 size_t size, int flags) 36 size_t size, int flags)
37{ 37{
38 38
39 int error; 39 int error;
40 40
41 if (strlen(name) < sizeof(XATTR_USER_PREFIX)) 41 if (strlen(name) < sizeof(XATTR_USER_PREFIX))
42 return -EINVAL; 42 return -EINVAL;
43 43
44 if (!reiserfs_xattrs_user (inode->i_sb)) 44 if (!reiserfs_xattrs_user(inode->i_sb))
45 return -EOPNOTSUPP; 45 return -EOPNOTSUPP;
46 46
47 if (!S_ISREG (inode->i_mode) && 47 if (!S_ISREG(inode->i_mode) &&
48 (!S_ISDIR (inode->i_mode) || inode->i_mode & S_ISVTX)) 48 (!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX))
49 return -EPERM; 49 return -EPERM;
50 50
51 error = reiserfs_permission_locked (inode, MAY_WRITE, NULL); 51 error = reiserfs_permission_locked(inode, MAY_WRITE, NULL);
52 if (error) 52 if (error)
53 return error; 53 return error;
54 54
55 return reiserfs_xattr_set (inode, name, buffer, size, flags); 55 return reiserfs_xattr_set(inode, name, buffer, size, flags);
56} 56}
57 57
58static int 58static int user_del(struct inode *inode, const char *name)
59user_del (struct inode *inode, const char *name)
60{ 59{
61 int error; 60 int error;
62 61
63 if (strlen(name) < sizeof(XATTR_USER_PREFIX)) 62 if (strlen(name) < sizeof(XATTR_USER_PREFIX))
64 return -EINVAL; 63 return -EINVAL;
65 64
66 if (!reiserfs_xattrs_user (inode->i_sb)) 65 if (!reiserfs_xattrs_user(inode->i_sb))
67 return -EOPNOTSUPP; 66 return -EOPNOTSUPP;
68 67
69 if (!S_ISREG (inode->i_mode) && 68 if (!S_ISREG(inode->i_mode) &&
70 (!S_ISDIR (inode->i_mode) || inode->i_mode & S_ISVTX)) 69 (!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX))
71 return -EPERM; 70 return -EPERM;
72 71
73 error = reiserfs_permission_locked (inode, MAY_WRITE, NULL); 72 error = reiserfs_permission_locked(inode, MAY_WRITE, NULL);
74 if (error) 73 if (error)
75 return error; 74 return error;
76 75
77 return 0; 76 return 0;
78} 77}
79 78
80static int 79static int
81user_list (struct inode *inode, const char *name, int namelen, char *out) 80user_list(struct inode *inode, const char *name, int namelen, char *out)
82{ 81{
83 int len = namelen; 82 int len = namelen;
84 if (!reiserfs_xattrs_user (inode->i_sb)) 83 if (!reiserfs_xattrs_user(inode->i_sb))
85 return 0; 84 return 0;
86 85
87 if (out) 86 if (out)
88 memcpy (out, name, len); 87 memcpy(out, name, len);
89 88
90 return len; 89 return len;
91} 90}
92 91
93struct reiserfs_xattr_handler user_handler = { 92struct reiserfs_xattr_handler user_handler = {