Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24198
b: refs/heads/master
c: b9a2838
h: refs/heads/master
v: v3
  • Loading branch information
Akinobu Mita authored and Linus Torvalds committed Mar 26, 2006
1 parent 0b0dff6 commit 22695a8
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 55b0f8a68ab475cc68f88d1e7a873490869d022e
refs/heads/master: b9a2838cc26c4c5369fbd2482acbc5ab60573479
4 changes: 2 additions & 2 deletions trunk/fs/ntfs/logfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,10 +515,10 @@ BOOL ntfs_check_logfile(struct inode *log_vi, RESTART_PAGE_HEADER **rp)
log_page_size = PAGE_CACHE_SIZE;
log_page_mask = log_page_size - 1;
/*
* Use generic_ffs() instead of ffs() to enable the compiler to
* Use ntfs_ffs() instead of ffs() to enable the compiler to
* optimize log_page_size and log_page_bits into constants.
*/
log_page_bits = generic_ffs(log_page_size) - 1;
log_page_bits = ntfs_ffs(log_page_size) - 1;
size &= ~(s64)(log_page_size - 1);
/*
* Ensure the log file is big enough to store at least the two restart
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ntfs/mft.c
Original file line number Diff line number Diff line change
Expand Up @@ -2670,7 +2670,7 @@ ntfs_inode *ntfs_mft_record_alloc(ntfs_volume *vol, const int mode,
ni->name_len = 4;

ni->itype.index.block_size = 4096;
ni->itype.index.block_size_bits = generic_ffs(4096) - 1;
ni->itype.index.block_size_bits = ntfs_ffs(4096) - 1;
ni->itype.index.collation_rule = COLLATION_FILE_NAME;
if (vol->cluster_size <= ni->itype.index.block_size) {
ni->itype.index.vcn_size = vol->cluster_size;
Expand Down
29 changes: 29 additions & 0 deletions trunk/fs/ntfs/ntfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,33 @@ extern int ntfs_ucstonls(const ntfs_volume *vol, const ntfschar *ins,
/* From fs/ntfs/upcase.c */
extern ntfschar *generate_default_upcase(void);

static inline int ntfs_ffs(int x)
{
int r = 1;

if (!x)
return 0;
if (!(x & 0xffff)) {
x >>= 16;
r += 16;
}
if (!(x & 0xff)) {
x >>= 8;
r += 8;
}
if (!(x & 0xf)) {
x >>= 4;
r += 4;
}
if (!(x & 3)) {
x >>= 2;
r += 2;
}
if (!(x & 1)) {
x >>= 1;
r += 1;
}
return r;
}

#endif /* _LINUX_NTFS_H */

0 comments on commit 22695a8

Please sign in to comment.